MeVisLab Toolbox Reference
|
#include <mlPropertyManager.h>
Public Types | |
typedef PropertyManager | type |
typedef boost::intrusive_ptr< type > | Pointer |
typedef boost::intrusive_ptr< const type > | ConstPointer |
typedef std::map< std::string, PropertyValue > | PropertyMap |
Public Member Functions | |
PropertyManager () | |
Empty default constructor. More... | |
PropertyManager (const PropertyManager &other) | |
Copy Constructor. More... | |
~PropertyManager () override | |
PropertyManager & | operator= (const PropertyManager &item) |
Assignment operator. Resets all registered GraphProperties. More... | |
bool | operator== (const PropertyManager &other) const |
Comparison operator, checks names and defaultValues without respect to their order. More... | |
void | clearProperties () |
Clear the list of property names and all registered GraphProperties. More... | |
size_t | createProperty (const std::string &name, const PropertyValue &defaultValue) |
Create property with name name and return its' index. More... | |
const PropertyValue & | getPropertyDefault (size_t propertyIndex) const |
Get the default value that is set for the property. More... | |
const PropertyValue & | getPropertyDefault (const std::string &propertyName) const |
PropertyMap | getPropertyDefaultMap () const |
Get a map of property-names and default-values. More... | |
size_t | getPropertyIndex (const std::string &propertyName) const |
Return the index of property with name propertyName . Throws std::logic_error if the property does not exist. More... | |
std::optional< size_t > | getOptionalPropertyIndex (const std::string &propertyName) const |
Return the index of property with name propertyName , if it exists. More... | |
const std::string & | getPropertyName (size_t index) const |
Return the name of property with index index . More... | |
const std::vector< std::string > & | getPropertyNames () const |
Return the list of available property names. More... | |
template<typename T > | |
std::vector< std::string > | getPropertyNames () const |
Return a list of names of properties of type T. More... | |
bool | hasProperty (const std::string &name) const |
Returns whether a property with name name exists. More... | |
size_t | numberOfProperties () const |
Return the number of properties currently available. More... | |
void | removeProperty (const std::string &name) |
Remove property with name name . Throws ML_BAD_PARAMETER if the property does not exists. More... | |
ML_CLASS_HEADER (PropertyManager) | |
Persistence | |
Attaches the object state as children of the given parent node. | |
void | addStateToTree (TreeNode *parent) const override |
ML_SET_ADDSTATE_VERSION (1) | |
Set current addStateToTree() version number: More... | |
void | readStateFromTree (TreeNode *parent) override |
Reads the object state from the children of the given parent node. More... | |
Friends | |
class | PropertyContainer |
class | SmartPropertyIndex |
Additional Inherited Members | |
![]() | |
IntrusivePtrBase () | |
Definition at line 33 of file mlPropertyManager.h.
typedef boost::intrusive_ptr<const type> PropertyManager::ConstPointer |
Definition at line 37 of file mlPropertyManager.h.
typedef boost::intrusive_ptr<type> PropertyManager::Pointer |
Definition at line 36 of file mlPropertyManager.h.
typedef std::map<std::string, PropertyValue> PropertyManager::PropertyMap |
Definition at line 38 of file mlPropertyManager.h.
typedef PropertyManager PropertyManager::type |
Definition at line 35 of file mlPropertyManager.h.
PropertyManager::PropertyManager | ( | ) |
Empty default constructor.
PropertyManager::PropertyManager | ( | const PropertyManager & | other | ) |
Copy Constructor.
|
override |
|
override |
void PropertyManager::clearProperties | ( | ) |
Clear the list of property names and all registered GraphProperties.
size_t PropertyManager::createProperty | ( | const std::string & | name, |
const PropertyValue & | defaultValue | ||
) |
Create property with name name
and return its' index.
If a property with this name already exists, just return the corresponding index.
Referenced by DefaultPropertyAccessor< T >::operator()().
std::optional<size_t> PropertyManager::getOptionalPropertyIndex | ( | const std::string & | propertyName | ) | const |
Return the index of property with name propertyName
, if it exists.
|
inline |
Definition at line 61 of file mlPropertyManager.h.
|
inline |
Get the default value that is set for the property.
Definition at line 60 of file mlPropertyManager.h.
PropertyMap PropertyManager::getPropertyDefaultMap | ( | ) | const |
Get a map of property-names and default-values.
size_t PropertyManager::getPropertyIndex | ( | const std::string & | propertyName | ) | const |
Return the index of property with name propertyName
. Throws std::logic_error if the property does not exist.
|
inline |
Return the name of property with index index
.
Definition at line 73 of file mlPropertyManager.h.
|
inline |
Return the list of available property names.
Definition at line 76 of file mlPropertyManager.h.
std::vector< std::string > PropertyManager::getPropertyNames |
Return a list of names of properties of type T.
Definition at line 138 of file mlPropertyManager.h.
References T, and PropertyValue::which().
|
inline |
Returns whether a property with name name
exists.
Definition at line 83 of file mlPropertyManager.h.
PropertyManager::ML_CLASS_HEADER | ( | PropertyManager | ) |
PropertyManager::ML_SET_ADDSTATE_VERSION | ( | 1 | ) |
Set current addStateToTree() version number:
|
inline |
Return the number of properties currently available.
Definition at line 86 of file mlPropertyManager.h.
PropertyManager& PropertyManager::operator= | ( | const PropertyManager & | item | ) |
Assignment operator. Resets all registered GraphProperties.
bool PropertyManager::operator== | ( | const PropertyManager & | other | ) | const |
Comparison operator, checks names and defaultValues without respect to their order.
|
override |
Reads the object state from the children of the given parent node.
void PropertyManager::removeProperty | ( | const std::string & | name | ) |
Remove property with name name
. Throws ML_BAD_PARAMETER if the property does not exists.
|
friend |
Definition at line 92 of file mlPropertyManager.h.
|
friend |
Definition at line 93 of file mlPropertyManager.h.