2#pragma warning(disable : 4251)
13namespace ot {
class PropertyGroup; };
15class __declspec(dllexport) EntityProperties
18 EntityProperties() : m_needsUpdate(false) {};
19 EntityProperties(
const EntityProperties &other);
20 virtual ~EntityProperties();
22 void merge(EntityProperties& other);
25 bool createProperty(EntityPropertiesBase *property,
const std::string &group,
bool addToFront =
false);
26 bool updateProperty(EntityPropertiesBase *property,
const std::string &group);
27 bool deleteProperty(
const std::string &_name,
const std::string& _groupName =
"");
28 bool propertyExists(
const std::string &_name,
const std::string& _groupName =
"");
30 EntityPropertiesBase *getProperty(
const std::string &_name,
const std::string& _groupName =
"");
32 void setNeedsUpdate(
void) { m_needsUpdate =
true; };
33 bool anyPropertyNeedsUpdate(
void)
const {
return m_needsUpdate; };
34 void checkWhetherUpdateNecessary(
void);
35 void forceResetUpdateForAllProperties();
39 void buildFromConfiguration(
const ot::PropertyGroup* _groupConfig, EntityBase* root);
41 std::string createJSON(EntityBase* root,
bool visibleOnly);
42 void buildFromJSON(
const std::string& prop, EntityBase* root);
44 void checkMatchingProperties(EntityProperties &other);
45 void readFromProperties(
const EntityProperties &other, EntityBase *root);
47 EntityProperties& operator=(
const EntityProperties &other);
49 void setAllPropertiesReadOnly(
void);
50 void setAllPropertiesNonProtected(
void);
52 std::list<EntityPropertiesBase*> getListOfAllProperties(
void);
53 std::list<EntityPropertiesBase *> getListOfPropertiesWhichNeedUpdate(
void);
54 std::list<EntityPropertiesDouble *> getListOfNumericalProperties(
void);
55 size_t getNumberOfProperties(
void)
const {
return m_properties.size(); }
57 std::list<std::string> getListOfPropertiesForGroup(
const std::string &group)
const;
59 static std::string createKey(
const std::string& _name,
const std::string& _group);
60 bool isKey(
const std::string _accesser)
const;
61 std::string extractNameFromKey(
const std::string& _key)
const;
64 void deleteAllProperties(
void);
67 std::map<std::string, EntityPropertiesBase *> m_properties;
68 std::list<EntityPropertiesBase *> m_propertiesList;