forked from hundlab/LongQt-model
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gridmeasuremanager.h
47 lines (40 loc) · 1.44 KB
/
gridmeasuremanager.h
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
38
39
40
41
42
43
44
45
46
47
#ifndef GRIDMEASUREMANAGER_H
#define GRIDMEASUREMANAGER_H
#include "measuremanager.h"
#include "measure.h"
#include "gridCell.h"
#include "grid.h"
#include <QFile>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <memory>
class GridMeasureManager: public MeasureManager {
public:
GridMeasureManager(shared_ptr<GridCell> cell);
virtual ~GridMeasureManager() = default;
virtual GridMeasureManager* clone();
void dataNodes(set<pair<int,int>> nodes);
set<pair<int,int>> dataNodes();
void cell(shared_ptr<GridCell> cell);
virtual bool writeMVarsFile(QXmlStreamWriter& xml);
virtual bool readMvarsFile(QXmlStreamReader& xml);
virtual void setupMeasures(string filename);
virtual void measure(double time);
virtual void write(QFile* file = 0);
virtual void writeSingleCell(pair<int,int> node, QFile* file = 0);
virtual void writeLast(string filename);
virtual std::string nameString(pair<int,int> node) const;
virtual void close();
virtual void clear();
virtual void resetMeasures(pair<int,int> node);
private:
GridMeasureManager(const GridMeasureManager&);
set<pair<int,int>> __dataNodes;
map<pair<int,int>,shared_ptr<QFile>> ofiles;
map<pair<int,int>,string> lasts;
map<pair<int,int>,map<string,shared_ptr<Measure>>> measures;
Grid* grid = 0;
};
#endif