OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
PropertyBool.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
9#include "OTGui/Property.h"
10
11namespace ot {
12
15 public:
16 PropertyBool(const PropertyBool* _other);
17 PropertyBool(const PropertyBase& _base);
18 PropertyBool(PropertyFlags _flags = PropertyFlags(NoFlags));
19 PropertyBool(bool _value, PropertyFlags _flags = PropertyFlags(NoFlags));
20 PropertyBool(const std::string& _name, bool _value, PropertyFlags _flags = PropertyFlags(NoFlags));
21 virtual ~PropertyBool() {};
22
23 static std::string propertyTypeString(void) { return "Bool"; };
24 virtual std::string getPropertyType(void) const override { return PropertyBool::propertyTypeString(); };
25
26 virtual Property* createCopy(void) const override;
27
28 void setValue(bool _value) { m_value = _value; };
29 bool getValue(void) const { return m_value; };
30
31 protected:
36 virtual void getPropertyData(ot::JsonValue& _object, ot::JsonAllocator& _allocator) const override;
37
41 virtual void setPropertyData(const ot::ConstJsonObject& _object) override;
42
43 private:
44 bool m_value;
45 };
46
47}
#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
The PropertyBase class is used to hold general Property information.
Definition PropertyBase.h:25
Definition PropertyBool.h:13
void setValue(bool _value)
Definition PropertyBool.h:28
virtual ~PropertyBool()
Definition PropertyBool.h:21
virtual std::string getPropertyType(void) const override
Definition PropertyBool.h:24
static std::string propertyTypeString(void)
Definition PropertyBool.h:23
bool getValue(void) const
Definition PropertyBool.h:29
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::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