OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
GenericDataStruct.h
Go to the documentation of this file.
1#pragma once
3#pragma warning(disable:4251)
4
5namespace ot
6{
7
8 class __declspec(dllexport) GenericDataStruct : public Serializable
9 {
10 public:
11 GenericDataStruct(const std::string& _typeName = "", uint32_t _numberOfEntries = 0) :m_numberOfEntries(_numberOfEntries), m_typeName(_typeName) {}
12 virtual ~GenericDataStruct()
13 {
14 };
15
16 virtual void addToJsonObject(ot::JsonValue& _object, ot::JsonAllocator& _allocator) const override;
17 virtual void setFromJsonObject(const ot::ConstJsonObject& _object) override;
18 const uint32_t getNumberOfEntries() const { return m_numberOfEntries; }
19
20 std::string getTypeIdentifyer() { return m_typeName; }
21
22 protected:
23 uint32_t m_numberOfEntries;
24 std::string m_typeName;
25 };
26
27 using GenericDataStructList = std::list<ot::GenericDataStruct*>;
28}
Definition Connector.h:8
std::list< ot::GenericDataStruct * > GenericDataStructList
Definition GenericDataStruct.h:27
rapidjson::Value JsonValue
Writable JSON value.
Definition JSON.h:27
rapidjson::GenericObject< true, rapidjson::GenericValue< rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator< rapidjson::CrtAllocator > > > ConstJsonObject
Read only JSON Object.
Definition JSON.h:35
rapidjson::MemoryPoolAllocator< rapidjson::CrtAllocator > JsonAllocator
Allocator used for writing to JSON values.
Definition JSON.h:30