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)
 Create property with name name and return its' index.
 
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 name. Throws ML_BAD_PARAMETER if the property does not exist.
 
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

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:
 
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

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

Definition at line 38 of file mlPropertyManager.h.

◆ type

Constructor & Destructor Documentation

◆ PropertyManager() [1/2]

PropertyManager::PropertyManager ( )

Empty default constructor.

◆ PropertyManager() [2/2]

PropertyManager::PropertyManager ( const PropertyManager & other)

Copy Constructor.

◆ ~PropertyManager()

PropertyManager::~PropertyManager ( )
override

Member Function Documentation

◆ addStateToTree()

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

◆ 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.

◆ getPropertyDefault() [1/2]

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

Definition at line 61 of file mlPropertyManager.h.

References mlrange_cast().

◆ 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.

References mlrange_cast().

◆ 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 name. Throws ML_BAD_PARAMETER if the property does not exist.

◆ getPropertyName()

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

Return the name of property with index index.

Definition at line 70 of file mlPropertyManager.h.

◆ getPropertyNames() [1/2]

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

Return the list of available property names.

Definition at line 73 of file mlPropertyManager.h.

◆ getPropertyNames() [2/2]

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

Return a list of names of properties of type T.

Definition at line 135 of file mlPropertyManager.h.

References mlrange_cast(), T, and PropertyValue::which().

◆ hasProperty()

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

Returns whether a property with name name exists.

Definition at line 80 of file mlPropertyManager.h.

◆ ML_CLASS_HEADER()

PropertyManager::ML_CLASS_HEADER ( 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 83 of file mlPropertyManager.h.

◆ operator=()

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

Assignment operator. Resets all registered GraphProperties.

◆ operator==()

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

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

◆ 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.

Friends And Related Symbol Documentation

◆ PropertyContainer

Definition at line 89 of file mlPropertyManager.h.

◆ SmartPropertyIndex

Definition at line 90 of file mlPropertyManager.h.


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