20Logger
g_log(
"PropertyManagerOwner");
50 m_properties->declareOrReplaceProperty(std::move(p), doc);
69 const std::unordered_set<std::string> &ignoreProperties,
bool createMissing) {
70 m_properties->setProperties(propertiesJson,
this, ignoreProperties, createMissing);
80 const std::unordered_set<std::string> &ignoreProperties,
bool createMissing) {
81 m_properties->setProperties(jsonValue,
this, ignoreProperties, createMissing);
91 const std::unordered_set<std::string> &ignoreProperties) {
92 m_properties->setPropertiesWithString(propertiesString, ignoreProperties);
187 std::vector<std::string> names;
189 names.reserve(props.size());
190 std::transform(props.cbegin(), props.cend(), std::back_inserter(names),
191 [](
auto &propPtr) { return propPtr->name(); });
220 return m_properties->getPointerToProperty(name)->isDefault();
double value
The value of the point.
std::map< DeltaEMode::Type, std::string > index
Kernel/PropertyManagerOwner.h.
Property * getPointerToProperty(const std::string &name) const override
Get a property by name.
bool validateProperties() const override
Validates all the properties in the collection.
PropertyManagerOwner & operator=(const PropertyManagerOwner &)
Assignment operator.
void afterPropertySet(const std::string &) override
Override this method to perform a custom action right after a property was set.
void setProperties(const std::string &propertiesJson, const std::unordered_set< std::string > &ignoreProperties=std::unordered_set< std::string >(), bool createMissing=false) override
Set the ordered list of properties by one string of values, separated by semicolons.
void setPropertyValue(const std::string &name, const std::string &value) override
Set the value of a property by string N.B.
void declareOrReplaceProperty(std::unique_ptr< Property > p, const std::string &doc="") override
Add or replace property in the list of managed properties.
std::string getPropertyValue(const std::string &name) const override
Get the value of a property as a string.
void clear() override
Clears all properties under management.
void setPropertyOrdinal(const int &index, const std::string &value) override
Set the value of a property by an index N.B.
void declareProperty(std::unique_ptr< Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
::Json::Value asJson(bool withDefaultValues=false) const override
Return the property manager serialized as a json object.
void setPropertyValueFromJson(const std::string &name, const Json::Value &value) override
Set the value of a property by Json::Value object.
const std::vector< Property * > & getProperties() const override
Get the list of managed properties.
std::vector< std::string > getDeclaredPropertyNames() const noexcept override
Return the list of declared property names.
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
void setPropertiesWithString(const std::string &propertiesString, const std::unordered_set< std::string > &ignoreProperties=std::unordered_set< std::string >()) override
Sets all the declared properties from a string.
bool existsProperty(const std::string &name) const override
Checks whether the named property is already in the list of managed property.
Property * getPointerToPropertyOrdinal(const int &index) const override
Get a property by an index.
std::shared_ptr< PropertyManager > m_properties
Shared pointer to the 'real' property manager.
size_t propertyCount() const override
Count the number of properties under management.
bool isDefault(const std::string &name) const
PropertyManagerOwner()
Default constructor.
void removeProperty(const std::string &name, const bool delproperty=true) override
Removes the property from management.
void resetProperties() override
Reset property values back to initial values (blank or default values)
std::unique_ptr< Property > takeProperty(const size_t index) override
Removes the property from management returning a pointer to it.
std::string asString(bool withDefaultValues=false) const override
Return the property manager serialized as a string.
Property manager helper class.
Base class for properties.
Logger g_log("DateAndTime")
Utility class that enables the getProperty() method to effectively be templated on the return type.