13#ifndef ML_PROPERTY_MANAGER_H 
   14#define ML_PROPERTY_MANAGER_H 
   26#include <boost/intrusive_ptr.hpp> 
   36  typedef boost::intrusive_ptr<type> 
Pointer;
 
   80  std::vector<std::string> getPropertyNames() 
const;
 
   83  bool hasProperty(
const std::string& name)
 const { 
return std::find(_names.begin(), _names.end(), name)!=_names.end(); }
 
  108  void _notifySmartIndices() 
const;
 
  111  std::vector<std::string> _names;
 
  114  std::vector<PropertyValue> _defaultValues;
 
  117  std::set<PropertyContainer*> _propertyContainers;
 
  119  std::set<SmartPropertyIndex*> _smartIndices;
 
 
  144  #pragma GCC diagnostic push 
  145  #pragma GCC diagnostic ignored "-Wold-style-cast" 
  147  BOOST_MPL_ASSERT(( boost::mpl::contains<PropertyValue::SupportedPropertyTypes, T> ));
 
  149  #pragma GCC diagnostic pop 
  152  std::vector<std::string> 
names;
 
  156  const size_t which = v.
which();
 
  157  for(
size_t i=0;
i<_defaultValues.size(); ++
i) {
 
  158    if (_defaultValues[
i].which()==which) {
 
  159      names.push_back(_names[
i]);
 
 
A base-class enabling the use of boost::intrusive_ptr in derived classes.
 
PropertyManager & operator=(const PropertyManager &item)
Assignment operator. Resets all registered GraphProperties.
 
size_t getPropertyIndex(const std::string &propertyName) const
Return the index of property with name propertyName. Throws std::logic_error if the property does not...
 
void clearProperties()
Clear the list of property names and all registered GraphProperties.
 
PropertyManager()
Empty default constructor.
 
bool operator==(const PropertyManager &other) const
Comparison operator, checks names and defaultValues without respect to their order.
 
void readStateFromTree(TreeNode *parent) override
Reads the object state from the children of the given parent node.
 
boost::intrusive_ptr< const type > ConstPointer
 
boost::intrusive_ptr< type > Pointer
 
void removeProperty(const std::string &name)
Remove property with name name. Throws ML_BAD_PARAMETER if the property does not exists.
 
std::map< std::string, PropertyValue > PropertyMap
 
const PropertyValue & getPropertyDefault(size_t propertyIndex) const
Get the default value that is set for the property.
 
void addStateToTree(TreeNode *parent) const override
 
~PropertyManager() override
 
const std::string & getPropertyName(size_t index) const
Return the name of property with index index.
 
const PropertyValue & getPropertyDefault(const std::string &propertyName) const
 
ML_CLASS_HEADER(PropertyManager)
 
bool hasProperty(const std::string &name) const
Returns whether a property with name name exists.
 
std::optional< size_t > getOptionalPropertyIndex(const std::string &propertyName) const
Return the index of property with name propertyName, if it exists.
 
size_t numberOfProperties() const
Return the number of properties currently available.
 
PropertyManager(const PropertyManager &other)
Copy Constructor.
 
const std::vector< std::string > & getPropertyNames() const
Return the list of available property names.
 
PropertyMap getPropertyDefaultMap() const
Get a map of property-names and default-values.
 
ML_SET_ADDSTATE_VERSION(1)
Set current addStateToTree() version number:
 
size_t createProperty(const std::string &name, const PropertyValue &defaultValue)
Create property with name name and return its' index.
 
Class PropertyValue, which is used to hold properties of a given set of allowed types in typesafe way...
 
A self-updating index for efficient name-based access of properties.
 
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