![]() |
Blue Brain BioExplorer
|
#include <PropertyObject.h>
Public Member Functions | |
void | setCurrentType (const std::string &type) |
const std::string & | getCurrentType () const |
template<typename T > | |
void | updateProperty (const std::string &name, const T &value, const bool triggerCallback=true) |
bool | hasProperty (const std::string &name) const |
template<typename T > | |
T | getProperty (const std::string &name) const |
template<typename T > | |
T | getPropertyOrValue (const std::string &name, T val) const |
void | setProperties (const PropertyMap &properties) |
void | setProperties (const std::string &type, const PropertyMap &properties) |
void | updateProperties (const PropertyMap &properties) |
const auto & | getPropertyMap () const |
const auto & | getPropertyMap (const std::string &type) const |
strings | getTypes () const |
void | clonePropertiesFrom (const PropertyObject &obj) |
![]() | |
BaseObject ()=default | |
virtual | ~BaseObject ()=default |
BaseObject (const BaseObject &) | |
BaseObject & | operator= (const BaseObject &rhs) |
bool | isModified () const |
void | resetModified () |
void | markModified (const bool triggerCallback=true) |
void | onModified (const ModifiedCallback &callback) |
void | clearModifiedCallback () |
Protected Attributes | |
std::string | _currentType |
std::map< std::string, PropertyMap > | _properties |
Additional Inherited Members | |
![]() | |
using | ModifiedCallback = std::function< void(const BaseObject &)> |
![]() | |
template<typename T > | |
void | _updateValue (T &member, const T &newValue, const bool triggerCallback=true) |
template<class T > | |
bool | _isEqual (const T &a, const T &b, typename std::enable_if< std::is_floating_point< T >::value >::type *=0) |
template<class T > | |
bool | _isEqual (const T &a, const T &b, typename std::enable_if<!std::is_floating_point< T >::value >::type *=0) |
Maps generic properties to user-defined types/keys/names and tracks the current type/key/name for querying, setting and updating its properties.
Definition at line 36 of file PropertyObject.h.
|
inline |
Clear all current properties and clone new properties from object
Definition at line 124 of file PropertyObject.h.
|
inline |
Definition at line 50 of file PropertyObject.h.
|
inline |
Definition at line 75 of file PropertyObject.h.
|
inline |
Definition at line 110 of file PropertyObject.h.
|
inline |
Definition at line 112 of file PropertyObject.h.
|
inline |
Definition at line 85 of file PropertyObject.h.
|
inline |
Definition at line 115 of file PropertyObject.h.
|
inline |
Definition at line 68 of file PropertyObject.h.
|
inline |
Set the current type to use for 'type-less' queries and updates.
Definition at line 40 of file PropertyObject.h.
|
inline |
Assign a new set of properties to the current type.
Definition at line 91 of file PropertyObject.h.
|
inline |
Assign a new set of properties to the given type.
Definition at line 94 of file PropertyObject.h.
|
inline |
Update or add all the properties from the given map to the current type.
Definition at line 103 of file PropertyObject.h.
|
inline |
Update the value of the given property for the current type.
Definition at line 53 of file PropertyObject.h.
|
protected |
Definition at line 142 of file PropertyObject.h.
|
protected |
Definition at line 143 of file PropertyObject.h.