OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
PropertyFactory.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
9#include "OTCore/JSON.h"
11#include "OTGui/Property.h"
13
14// std header
15#include <map>
16#include <string>
17#include <functional>
18
19namespace ot {
20 class Property;
21
24 public:
25 using PropertyConstructor = std::function<Property* ()>;
26
27 static PropertyFactory& instance(void);
28 static Property* createProperty(const ConstJsonObject& _jsonObject);
29 static Property* createProperty(const std::string& _propertyType);
30
31 static bool registerProperty(const std::string& _type, const PropertyConstructor& _constructor);
32
33 private:
36
37 std::map<std::string, PropertyConstructor> m_constructors;
38 };
39}
This file contains defines that may be used simplyfy class creation.
#define OT_DECL_NOCOPY(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:14
#define OT_GUI_API_EXPORT
Definition OTGuiAPIExport.h:9
Definition PropertyFactory.h:22
std::function< Property *()> PropertyConstructor
Definition PropertyFactory.h:25
The Property class is used as a base class for all Properties that can be displayed and modified in t...
Definition Property.h:21
Definition Connector.h:8
rapidjson::GenericObject< true, rapidjson::GenericValue< rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator< rapidjson::CrtAllocator > > > ConstJsonObject
Read only JSON Object.
Definition JSON.h:35