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. More...
 
 PropertyManager (const PropertyManager &other)
 Copy Constructor. More...
 
 ~PropertyManager () override
 
PropertyManageroperator= (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 PropertyValuegetPropertyDefault (size_t propertyIndex) const
 Get the default value that is set for the property. More...
 
const PropertyValuegetPropertyDefault (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 name. Throws ML_BAD_PARAMETER if the property does not exist. 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

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

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

Referenced by DefaultPropertyAccessor< T >::operator()().

◆ getPropertyDefault() [1/2]

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

Definition at line 61 of file mlPropertyManager.h.

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

Return a list of names of properties of type T.

Definition at line 135 of file mlPropertyManager.h.

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

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 Function Documentation

◆ PropertyContainer

friend class PropertyContainer
friend

Definition at line 89 of file mlPropertyManager.h.

◆ SmartPropertyIndex

friend class SmartPropertyIndex
friend

Definition at line 90 of file mlPropertyManager.h.


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