13#ifndef ML_PROPERTY_CONTAINER_H
14#define ML_PROPERTY_CONTAINER_H
25#include <boost/shared_ptr.hpp>
27class MLPropertyContainerWrapper;
33 friend class ::MLPropertyContainerWrapper;
67 T&
property(
size_t index) {
return _values[index].get<
T>(); }
70 const T&
property(
size_t index)
const {
return _values[index].get<
T>(); }
79 const PropertyValue&
property(
const std::string& name)
const {
return _values[_manager->getPropertyIndex(name)]; }
81 T&
property(
const std::string& name) {
return _values[_manager->getPropertyIndex(name)].get<
T>(); }
83 const T&
property(
const std::string& name)
const {
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. Throws boost::bad_get exception if the currently store...
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 ...
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