MeVisLab Toolbox Reference
PropertyManager Class Reference

#include <mlPropertyManager.h>

Inheritance diagram for PropertyManager:
IntrusivePtrBase< PropertyManager >

Public Types

typedef PropertyManager type
typedef boost::intrusive_ptr< typePointer
typedef boost::intrusive_ptr< const typeConstPointer
typedef std::map< std::string, PropertyValuePropertyMap

Public Member Functions

 PropertyManager ()
 Empty default constructor.
 PropertyManager (const PropertyManager &other)
 Copy Constructor.
 ~PropertyManager () override
PropertyManageroperator= (const PropertyManager &item)
 Assignment operator. Resets all registered GraphProperties.
bool operator== (const PropertyManager &other) const
 Comparison operator, checks names and defaultValues without respect to their order.
void clearProperties ()
 Clear the list of property names and all registered GraphProperties.
size_t createProperty (const std::string &name, const PropertyValue &defaultValue)
const PropertyValuegetPropertyDefault (size_t propertyIndex) const
 Get the default value that is set for the property.
const PropertyValuegetPropertyDefault (const std::string &propertyName) const
PropertyMap getPropertyDefaultMap () const
 Get a map of property-names and default-values.
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.
std::optional< size_t > getOptionalPropertyIndex (const std::string &propertyName) const
 Return the index of property with name propertyName, if it exists.
const std::string & getPropertyName (size_t index) const
 Return the name of property with index index.
const std::vector< std::string > & getPropertyNames () const
 Return the list of available property names.
template<typename T>
std::vector< std::string > getPropertyNames () const
 Return a list of names of properties of type T.
bool hasProperty (const std::string &name) const
 Returns whether a property with name name exists.
size_t numberOfProperties () const
 Return the number of properties currently available.
void removeProperty (const std::string &name)
 Remove property with name name. Throws ML_BAD_PARAMETER if the property does not exists.
 ML_CLASS_HEADER (PropertyManager)
Persistence
void addStateToTree (TreeNode *parent) const override
 ML_SET_ADDSTATE_VERSION (1)
 Set current addStateToTree() version number:
void readStateFromTree (TreeNode *parent) override
 Reads the object state from the children of the given parent node.

Friends

class PropertyContainer
class SmartPropertyIndex

Additional Inherited Members

Protected Member Functions inherited from IntrusivePtrBase< PropertyManager >
 IntrusivePtrBase ()

Detailed Description

Definition at line 33 of file mlPropertyManager.h.

Member Typedef Documentation

◆ ConstPointer

typedef boost::intrusive_ptr<const type> PropertyManager::ConstPointer

Definition at line 37 of file mlPropertyManager.h.

◆ Pointer

typedef boost::intrusive_ptr<type> PropertyManager::Pointer

Definition at line 36 of file mlPropertyManager.h.

◆ PropertyMap

typedef std::map<std::string, PropertyValue> PropertyManager::PropertyMap

Definition at line 38 of file mlPropertyManager.h.

◆ type

Definition at line 35 of file mlPropertyManager.h.

Constructor & Destructor Documentation

◆ PropertyManager() [1/2]

PropertyManager::PropertyManager ( )

Empty default constructor.

Referenced by ML_CLASS_HEADER(), operator=(), operator==(), and PropertyManager().

◆ PropertyManager() [2/2]

PropertyManager::PropertyManager ( const PropertyManager & other)

Copy Constructor.

References PropertyManager().

◆ ~PropertyManager()

PropertyManager::~PropertyManager ( )
override

Member Function Documentation

◆ addStateToTree()

void PropertyManager::addStateToTree ( TreeNode * parent) const
override

Attaches the object state as children of the given parent node.

◆ clearProperties()

void PropertyManager::clearProperties ( )

Clear the list of property names and all registered GraphProperties.

◆ createProperty()

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()().

◆ getOptionalPropertyIndex()

std::optional< size_t > PropertyManager::getOptionalPropertyIndex ( const std::string & propertyName) const

Return the index of property with name propertyName, if it exists.

◆ getPropertyDefault() [1/2]

const PropertyValue & PropertyManager::getPropertyDefault ( const std::string & propertyName) const
inline

Definition at line 61 of file mlPropertyManager.h.

References getPropertyIndex().

◆ getPropertyDefault() [2/2]

const PropertyValue & PropertyManager::getPropertyDefault ( size_t propertyIndex) const
inline

Get the default value that is set for the property.

Definition at line 60 of file mlPropertyManager.h.

◆ getPropertyDefaultMap()

PropertyMap PropertyManager::getPropertyDefaultMap ( ) const

Get a map of property-names and default-values.

◆ getPropertyIndex()

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.

Referenced by getPropertyDefault().

◆ getPropertyName()

const std::string & PropertyManager::getPropertyName ( size_t index) const
inline

Return the name of property with index index.

Definition at line 73 of file mlPropertyManager.h.

◆ getPropertyNames() [1/2]

template<typename T>
std::vector< std::string > PropertyManager::getPropertyNames ( ) const

Return a list of names of properties of type T.

Definition at line 138 of file mlPropertyManager.h.

References T, and PropertyValue::which().

◆ getPropertyNames() [2/2]

const std::vector< std::string > & PropertyManager::getPropertyNames ( ) const
inline

Return the list of available property names.

Definition at line 76 of file mlPropertyManager.h.

◆ hasProperty()

bool PropertyManager::hasProperty ( const std::string & name) const
inline

Returns whether a property with name name exists.

Definition at line 83 of file mlPropertyManager.h.

◆ ML_CLASS_HEADER()

PropertyManager::ML_CLASS_HEADER ( PropertyManager )

References PropertyManager().

◆ ML_SET_ADDSTATE_VERSION()

PropertyManager::ML_SET_ADDSTATE_VERSION ( 1 )

Set current addStateToTree() version number:

◆ numberOfProperties()

size_t PropertyManager::numberOfProperties ( ) const
inline

Return the number of properties currently available.

Definition at line 86 of file mlPropertyManager.h.

◆ operator=()

PropertyManager & PropertyManager::operator= ( const PropertyManager & item)

Assignment operator. Resets all registered GraphProperties.

References PropertyManager().

◆ operator==()

bool PropertyManager::operator== ( const PropertyManager & other) const

Comparison operator, checks names and defaultValues without respect to their order.

References PropertyManager().

◆ readStateFromTree()

void PropertyManager::readStateFromTree ( TreeNode * parent)
override

Reads the object state from the children of the given parent node.

◆ removeProperty()

void PropertyManager::removeProperty ( const std::string & name)

Remove property with name name. Throws ML_BAD_PARAMETER if the property does not exists.

◆ PropertyContainer

friend class PropertyContainer
friend

Definition at line 92 of file mlPropertyManager.h.

References PropertyContainer.

Referenced by PropertyContainer, and SmartPropertyIndex.

◆ SmartPropertyIndex

friend class SmartPropertyIndex
friend

Definition at line 93 of file mlPropertyManager.h.

References PropertyContainer, and SmartPropertyIndex.

Referenced by SmartPropertyIndex.


The documentation for this class was generated from the following file: