1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
#ifndef RAREDISPLAY_H
#define RAREDISPLAY_H
#include "sabundvector.hpp"
#include "calculator.h"
#include "fileoutput.h"
#include "display.h"
/***********************************************************************/
//Each display is responsible for one calculator. The FileOutput class handles creating the outputfile for the calc.
//This class uses mutex and lock_guard to prevent thread errors.
class RareDisplay : public Display {
public:
RareDisplay(Calculator* calc, FileOutput* file) : estimate(calc), output(file), nIters(1) {};
~RareDisplay() { delete estimate; delete output; }
void init(string);
void reset();
void update(SAbundVector&);
void update(vector<SharedRAbundVector*> shared, int numSeqs);
void close();
bool isCalcMultiple() { return estimate->getMultiple(); }
private:
Calculator* estimate;
FileOutput* output;
string label;
map<int, vector<double> > results; //maps seqCount to results for that number of sequences
int nIters;
Utils util;
std::mutex mutex;
};
#endif
|