OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
BasicEntityInformation.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
9#include "OTCore/CoreTypes.h"
10#include "OTCore/Serializable.h"
11
12// std header
13#include <string>
14
15#pragma warning(disable:4251)
16
17namespace ot {
18
20 public:
22 BasicEntityInformation(const std::string& _entityName);
23 BasicEntityInformation(const std::string& _entityName, UID _entityId, UID _entityVersion);
26
27 BasicEntityInformation& operator = (const BasicEntityInformation& _other);
28
32 virtual void addToJsonObject(ot::JsonValue& _object, ot::JsonAllocator& _allocator) const override;
33
37 virtual void setFromJsonObject(const ot::ConstJsonObject& _object) override;
38
39 void setEntityName(const std::string& _entityName) { m_entityName = _entityName; };
40 const std::string& getEntityName(void) const { return m_entityName; };
41
42 void setEntityID(UID _entityId) { m_entityId = _entityId; };
43 UID getEntityID(void) const { return m_entityId; };
44
45 void setEntityVersion(UID _entityVersion) { m_entityVersion = _entityVersion; };
46 UID getEntityVersion(void) const { return m_entityVersion; };
47
48 private:
49 std::string m_entityName;
50 UID m_entityId;
51 UID m_entityVersion;
52 };
53
54}
#define OT_CORE_API_EXPORT
Dll import.
Definition CoreAPIExport.h:8
Definition BasicEntityInformation.h:19
void setEntityID(UID _entityId)
Definition BasicEntityInformation.h:42
UID getEntityVersion(void) const
Definition BasicEntityInformation.h:46
void setEntityName(const std::string &_entityName)
Definition BasicEntityInformation.h:39
UID getEntityID(void) const
Definition BasicEntityInformation.h:43
void setEntityVersion(UID _entityVersion)
Definition BasicEntityInformation.h:45
const std::string & getEntityName(void) const
Definition BasicEntityInformation.h:40
The Serializable class is the default interface of serializable objects.
Definition Serializable.h:17
Definition Connector.h:8
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.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