OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
GenericDocument.h
Go to the documentation of this file.
1#pragma once
2#include <map>
3#include <stdint.h>
4#include <list>
5#include <vector>
6#include <string>
7#include <memory>
8#include "OTCore/Variable.h"
9
10class __declspec(dllexport) GenericDocument
11{
12public:
13 const std::string getDocumentName() const { return _documentName; }
14 const std::vector<const GenericDocument *> getSubDocuments() const { return _subDocuments; }
15 void setDocumentName(std::string documentName) { _documentName = documentName; };
16 const std::map<std::string, std::list<ot::Variable>>* getFields() const { return &_fields; };
17
18 void AddSubDocument(GenericDocument* subDocument) { _subDocuments.push_back(subDocument); };
19
20 void InsertInDocumentField(const std::string& fieldName, const std::list<ot::Variable>& values);
21 void InsertInDocumentField(const std::string& fieldName, std::list<ot::Variable>&& values);
22
23protected:
24
25 std::map<std::string, std::list<ot::Variable>> _fields;
26 std::string _documentName;
27 std::vector<const GenericDocument*> _subDocuments;
28
29 virtual void CheckForIlligalName(std::string fieldName) {};
30};