MeVisLabToolboxReference
ml::PropertyContainer Class Reference

#include <mlPropertyContainer.h>

Inheritance diagram for ml::PropertyContainer:
ml::Base ml::BaseGraphItem ml::Skeleton ml::VesselEdge ml::VesselNode

List of all members.

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)
virtual ~PropertyContainer ()
virtual bool operator== (const PropertyContainer &other) const
 Check for equality (managers and values).
virtual bool operator!= (const PropertyContainer &other) const
 Check for inequality (managers and values).
virtual void copyProperties (const PropertyContainer &other)
 Copy all properties from the given container to this object.
const PropertyManagergetPropertyManager () const
 Get read-only access to the associated property manager.
PropertyManagergetPropertyManager ()
 Get access to the associated property manager.
PropertyMap getPropertyMap () const
 Get a map of the contained properties, can be useful for comparison.
size_t numberOfProperties () const
 Return the number of properties currently available.
const PropertyValueproperty (size_t index) const
 Get the property with index index as PropertyValue.
template<typename T >
T & property (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.
template<typename T >
const T & property (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.
const PropertyValueproperty (const std::string &name) const
 Get the property with name name.
template<typename T >
T & property (const std::string &name)
template<typename T >
const T & property (const std::string &name) const
virtual void reset ()
 Set all properties to default values.
Persistence
virtual void addStateToTree (TreeNode *parent) const
 Attaches the object state as children of the given parent node.
 ML_SET_ADDSTATE_VERSION (1)
 Set current addStateToTree() version number:
virtual void readStateFromTree (TreeNode *parent)
 Reads the object state from the children of the given parent node.

Protected Attributes

std::vector< PropertyValue_values
ManagerPointer _manager

Friends

class PropertyManager
class ::MLPropertyContainerWrapper

Detailed Description

Definition at line 28 of file mlPropertyContainer.h.


Member Typedef Documentation


Constructor & Destructor Documentation

ml::PropertyContainer::PropertyContainer ( const ManagerPointer manager)
ml::PropertyContainer::PropertyContainer ( const PropertyContainer other)
virtual ml::PropertyContainer::~PropertyContainer ( ) [virtual]

Member Function Documentation

virtual void ml::PropertyContainer::addStateToTree ( TreeNode parent) const [virtual]

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

Reimplemented from ml::Base.

Reimplemented in ml::BaseGraphItem, ml::Skeleton, ml::VesselEdge, and ml::VesselNode.

virtual void ml::PropertyContainer::copyProperties ( const PropertyContainer other) [virtual]

Copy all properties from the given container to this object.

const PropertyManager* ml::PropertyContainer::getPropertyManager ( ) const [inline]

Get read-only access to the associated property manager.

Definition at line 49 of file mlPropertyContainer.h.

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

PropertyManager* ml::PropertyContainer::getPropertyManager ( ) [inline]

Get access to the associated property manager.

Definition at line 51 of file mlPropertyContainer.h.

PropertyMap ml::PropertyContainer::getPropertyMap ( ) const

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

ml::PropertyContainer::ML_SET_ADDSTATE_VERSION ( )

Set current addStateToTree() version number:

size_t ml::PropertyContainer::numberOfProperties ( ) const [inline]

Return the number of properties currently available.

Definition at line 56 of file mlPropertyContainer.h.

virtual bool ml::PropertyContainer::operator!= ( const PropertyContainer other) const [inline, virtual]

Check for inequality (managers and values).

Definition at line 43 of file mlPropertyContainer.h.

virtual bool ml::PropertyContainer::operator== ( const PropertyContainer other) const [virtual]

Check for equality (managers and values).

template<typename T >
T& ml::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 64 of file mlPropertyContainer.h.

References T.

template<typename T >
const T& ml::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 67 of file mlPropertyContainer.h.

References T.

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

Definition at line 80 of file mlPropertyContainer.h.

References T.

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

Definition at line 78 of file mlPropertyContainer.h.

References T.

const PropertyValue& ml::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 61 of file mlPropertyContainer.h.

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

const PropertyValue& ml::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 76 of file mlPropertyContainer.h.

virtual void ml::PropertyContainer::readStateFromTree ( TreeNode parent) [virtual]

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

Reimplemented from ml::Base.

Reimplemented in ml::BaseGraphItem, ml::Skeleton, ml::VesselEdge, and ml::VesselNode.

virtual void ml::PropertyContainer::reset ( ) [virtual]

Set all properties to default values.


Friends And Related Function Documentation

friend class ::MLPropertyContainerWrapper [friend]

Definition at line 30 of file mlPropertyContainer.h.

friend class PropertyManager [friend]

Definition at line 29 of file mlPropertyContainer.h.


Member Data Documentation

Definition at line 98 of file mlPropertyContainer.h.


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