OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
EntityResultTableData.h
Go to the documentation of this file.
1#pragma once
2#pragma warning(disable : 4251)
3
4
5#include "EntityBase.h"
6#include "OldTreeIcon.h"
7
8#include <list>
9#include <vector>
10
11template <class T>
12class __declspec(dllexport) EntityResultTableData : public EntityBase
13{
14public:
15 EntityResultTableData(ot::UID ID, EntityBase *parent, EntityObserver *obs, ModelState *ms, ClassFactoryHandler* factory, const std::string &owner);
16 virtual ~EntityResultTableData();
17
18 virtual bool getEntityBox(double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax) override;
19
20 virtual void StoreToDataBase(void) override;
21
22 virtual std::string getClassName(void) { return className; };
23
24 virtual entityType getEntityType(void) override { return DATA; };
25 virtual void removeChild(EntityBase *child) override;
26
27 void setNumberOfColumns(uint64_t cols);
28 void setNumberOfRows(uint64_t rows);
29
30 void setHeaderText(unsigned int col, const std::string &text);
31 void setValue(unsigned int row, unsigned int col, T value);
32
33 void setRow(unsigned int row, std::vector<T>& value);
34 void setColumn(unsigned int column, std::vector<T>& value);
35
36 uint64_t getNumberOfRows(void);
37 uint64_t getNumberOfColumns(void);
38 std::string getHeaderText(unsigned int col);
39 T getValue(unsigned int row, unsigned int col);
40
41private:
42 virtual int getSchemaVersion(void) { return 1; };
43 virtual void AddStorageData(bsoncxx::builder::basic::document &storage);
44 virtual void readSpecificDataFromDataBase(bsoncxx::document::view &doc_view, std::map<ot::UID, EntityBase *> &entityMap) override;
45
46 std::string className = "EntityResultTableData";
47 std::vector<std::string> header;
48 std::vector<std::vector<T>> data;
49};
50
52
53
bsoncxx::types::value value
Definition DocumentManager.h:16
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27