MeVisLab Toolbox Reference
PropertyContainer Class Reference

#include <mlPropertyContainer.h>

Inheritance diagram for PropertyContainer:
BaseGraphItem Skeleton VesselEdge VesselNode

Public Types

typedef PropertyManager::Pointer ManagerPointer
 
typedef PropertyManager::ConstPointer ConstManagerPointer
 
typedef PropertyManager::PropertyMap PropertyMap
 

Public Member Functions

 PropertyContainer (const ManagerPointer &manager)
 
 PropertyContainer (const PropertyContainer &other)
 
 ~PropertyContainer () override
 
bool operator== (const PropertyContainer &other) const
 Check for equality (managers and values). More...
 
bool operator!= (const PropertyContainer &other) const
 Check for inequality (managers and values). More...
 
void copyProperties (const PropertyContainer &other)
 Copy all properties from the given container to this object. More...
 
const PropertyManagergetPropertyManager () const
 Get read-only access to the associated property manager. More...
 
PropertyManagergetPropertyManager ()
 Get access to the associated property manager. More...
 
PropertyMap getPropertyMap () const
 Get a map of the contained properties, can be useful for comparison. More...
 
size_t numberOfProperties () const
 Return the number of properties currently available. More...
 
const PropertyValueproperty (size_t index) const
 Get the property with index index as PropertyValue. More...
 
template<typename T >
Tproperty (size_t index)
 Get the property with index index with type T. Throws boost::bad_get exception if the currently stored property has a different type. More...
 
template<typename T >
const Tproperty (size_t index) const
 Get the property with index index with type T, const version. Throws boost::bad_get exception if the currently stored property has a different type. More...
 
const PropertyValueproperty (const std::string &name) const
 Get the property with name name. More...
 
template<typename T >
Tproperty (const std::string &name)
 
template<typename T >
const Tproperty (const std::string &name) const
 
virtual void reset ()
 Set all properties to default values. More...
 
 ML_ABSTRACT_CLASS_HEADER (PropertyContainer)
 
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...
 

Protected Attributes

std::vector< PropertyValue_values
 
ManagerPointer _manager
 

Friends

class PropertyManager
 
class ::MLPropertyContainerWrapper
 

Detailed Description

Definition at line 31 of file mlPropertyContainer.h.

Member Typedef Documentation

◆ ConstManagerPointer

◆ ManagerPointer

◆ PropertyMap

Constructor & Destructor Documentation

◆ PropertyContainer() [1/2]

PropertyContainer::PropertyContainer ( const ManagerPointer manager)

◆ PropertyContainer() [2/2]

PropertyContainer::PropertyContainer ( const PropertyContainer other)

◆ ~PropertyContainer()

PropertyContainer::~PropertyContainer ( )
override

Member Function Documentation

◆ addStateToTree()

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

◆ copyProperties()

void PropertyContainer::copyProperties ( const PropertyContainer other)

Copy all properties from the given container to this object.

◆ getPropertyManager() [1/2]

PropertyManager* PropertyContainer::getPropertyManager ( )
inline

Get access to the associated property manager.

Definition at line 54 of file mlPropertyContainer.h.

◆ getPropertyManager() [2/2]

const PropertyManager* PropertyContainer::getPropertyManager ( ) const
inline

Get read-only access to the associated property manager.

Definition at line 52 of file mlPropertyContainer.h.

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

◆ getPropertyMap()

PropertyMap PropertyContainer::getPropertyMap ( ) const

Get a map of the contained properties, can be useful for comparison.

◆ ML_ABSTRACT_CLASS_HEADER()

PropertyContainer::ML_ABSTRACT_CLASS_HEADER ( PropertyContainer  )

◆ ML_SET_ADDSTATE_VERSION()

PropertyContainer::ML_SET_ADDSTATE_VERSION ( )

Set current addStateToTree() version number:

◆ numberOfProperties()

size_t PropertyContainer::numberOfProperties ( ) const
inline

Return the number of properties currently available.

Definition at line 59 of file mlPropertyContainer.h.

◆ operator!=()

bool PropertyContainer::operator!= ( const PropertyContainer other) const
inline

Check for inequality (managers and values).

Definition at line 46 of file mlPropertyContainer.h.

◆ operator==()

bool PropertyContainer::operator== ( const PropertyContainer other) const

Check for equality (managers and values).

◆ property() [1/6]

template<typename T >
T& PropertyContainer::property ( const std::string &  name)
inline

Definition at line 81 of file mlPropertyContainer.h.

References T.

◆ property() [2/6]

const PropertyValue& PropertyContainer::property ( const std::string &  name) const
inline

Get the property with name name.

This requires a lookup of the index in the graph container. If you need to access the same property for many different objects, it is more efficient to do the lookup manually and use the index-based access. Have a look at SmartPropertyIndex for how a convenient and safe way to do index-based lookups. Throws ML_BAD_PARAMETER if the property does not exist.

Definition at line 79 of file mlPropertyContainer.h.

◆ property() [3/6]

template<typename T >
const T& PropertyContainer::property ( const std::string &  name) const
inline

Definition at line 83 of file mlPropertyContainer.h.

References T.

◆ property() [4/6]

template<typename T >
T& PropertyContainer::property ( size_t  index)
inline

Get the property with index index with type T. Throws boost::bad_get exception if the currently stored property has a different type.

Definition at line 67 of file mlPropertyContainer.h.

References T.

◆ property() [5/6]

const PropertyValue& PropertyContainer::property ( size_t  index) const
inline

Get the property with index index as PropertyValue.

Get the property with index index as PropertyValue, const version.

Definition at line 64 of file mlPropertyContainer.h.

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

◆ property() [6/6]

template<typename T >
const T& PropertyContainer::property ( size_t  index) const
inline

Get the property with index index with type T, const version. Throws boost::bad_get exception if the currently stored property has a different type.

Definition at line 70 of file mlPropertyContainer.h.

References T.

◆ readStateFromTree()

void PropertyContainer::readStateFromTree ( TreeNode *  parent)
override

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

◆ reset()

virtual void PropertyContainer::reset ( )
virtual

Set all properties to default values.

Friends And Related Function Documentation

◆ ::MLPropertyContainerWrapper

friend class ::MLPropertyContainerWrapper
friend

Definition at line 33 of file mlPropertyContainer.h.

◆ PropertyManager

friend class PropertyManager
friend

Definition at line 32 of file mlPropertyContainer.h.

Member Data Documentation

◆ _manager

ManagerPointer PropertyContainer::_manager
protected

Definition at line 91 of file mlPropertyContainer.h.

◆ _values

std::vector<PropertyValue> PropertyContainer::_values
protected

Definition at line 89 of file mlPropertyContainer.h.


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