OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
Serializable.h
Go to the documentation of this file.
1
5// ###########################################################################################################################################################################################################################################################################################################################
6
7#pragma once
8
9// OT header
10#include "OTCore/JSON.h"
12
13namespace ot {
14
18 public:
20 virtual ~Serializable() {};
21
25 virtual void addToJsonObject(ot::JsonValue& _object, ot::JsonAllocator& _allocator) const = 0;
26
30 virtual void setFromJsonObject(const ot::ConstJsonObject& _object) = 0;
31 };
32}
#define OT_CORE_API_EXPORTONLY
Definition CoreAPIExport.h:11
The Serializable class is the default interface of serializable objects.
Definition Serializable.h:17
Serializable()
Definition Serializable.h:19
virtual void addToJsonObject(ot::JsonValue &_object, ot::JsonAllocator &_allocator) const =0
Add the object contents to the provided JSON object.
virtual ~Serializable()
Definition Serializable.h:20
virtual void setFromJsonObject(const ot::ConstJsonObject &_object)=0
Set the object contents from the provided JSON object.
Definition Connector.h:8
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