13#ifndef ML_PROPERTY_CONTAINER_H
14#define ML_PROPERTY_CONTAINER_H
25#include <boost/shared_ptr.hpp>
27class MLPropertyContainerWrapper;
34 friend class ::MLPropertyContainerWrapper;
50 return !(*
this ==
other);
59 return _manager.get();
64 return _manager.get();
72 return _values.size();
80 return _values[index];
86 return _values[index].get<
T>();
90 template <
typename T>
const T&
property(
size_t index)
const
92 return _values[index].get<
T>();
104 return _values[_manager->getPropertyIndex(name)];
106 template <
typename T>
T&
property(
const std::string& name)
108 return _values[_manager->getPropertyIndex(name)].get<
T>();
110 template <
typename T>
const T&
property(
const std::string& name)
const
112 return _values[_manager->getPropertyIndex(name)].get<
T>();
const PropertyValue & property(const std::string &name) const
Get the property with name name.
std::vector< PropertyValue > _values
PropertyManager::Pointer ManagerPointer
~PropertyContainer() override
const PropertyValue & property(size_t index) const
Get the property with index index as PropertyValue.
PropertyContainer(const ManagerPointer &manager)
void addStateToTree(TreeNode *parent) const override
bool operator==(const PropertyContainer &other) const
Check for equality (managers and values).
const T & property(const std::string &name) const
void copyProperties(const PropertyContainer &other)
Copy all properties from the given container to this object.
PropertyContainer(const PropertyContainer &other)
PropertyMap getPropertyMap() const
Get a map of the contained properties, can be useful for comparison.
T & property(size_t index)
Get the property with index index with type T.
const T & property(size_t index) const
Get the property with index index with type T, const version.
const PropertyManager * getPropertyManager() const
Get read-only access to the associated property manager.
virtual void reset()
Set all properties to default values.
PropertyManager::ConstPointer ConstManagerPointer
PropertyManager::PropertyMap PropertyMap
T & property(const std::string &name)
ML_ABSTRACT_CLASS_HEADER(PropertyContainer)
bool operator!=(const PropertyContainer &other) const
Check for inequality (managers and values).
size_t numberOfProperties() const
Return the number of properties currently available.
PropertyManager * getPropertyManager()
Get access to the associated property manager.
void readStateFromTree(TreeNode *parent) override
Reads the object state from the children of the given parent node.
ML_SET_ADDSTATE_VERSION(1)
Set current addStateToTree() version number:
boost::intrusive_ptr< const type > ConstPointer
boost::intrusive_ptr< type > Pointer
std::map< std::string, PropertyValue > PropertyMap
Class PropertyValue, which is used to hold properties of a given set of allowed types in typesafe way...
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
#define VESSELGRAPH_END_NAMESPACE
#define VESSELGRAPH_EXPORT
Definiert systemspezifische Macros, die f"ur diese DLL gelten sollen.
#define VESSELGRAPH_BEGIN_NAMESPACE