19#include <tulip/PluginProgress.h>
20#include <tulip/PropertyInterface.h>
23template <
typename ATTRIBUTETYPE>
28template <
typename ATTRIBUTETYPE>
31 notifyBeforeSetAttribute(name);
32 data.
set(name, value);
33 notifyAfterSetAttribute(name);
36template <
typename PropertyType>
40 assert(
dynamic_cast<PropertyType *
>(prop) !=
nullptr);
41 return dynamic_cast<PropertyType *
>(prop);
43 PropertyType *prop =
new PropertyType(
this, name);
49template <
typename PropertyType>
53 assert(
dynamic_cast<PropertyType *
>(prop) !=
nullptr);
54 return dynamic_cast<PropertyType *
>(prop);
A container that can store data from any type.
bool get(const std::string &key, T &value) const
Returns the stored value associated with the given key. The stored value is a copy of the original va...
void set(const std::string &key, const T &value)
Stores a copy of the given param, associated with the key. The value must have a well-formed copy con...
const DataSet & getAttributes() const
Gets the attributes of the graph.
void setAttribute(const std::string &name, const ATTRIBUTETYPE &value)
Sets an attribute on the graph.
virtual PropertyInterface * getProperty(const std::string &name) const =0
Gets an existing property. In DEBUG mode an assertion checks the existence of the property.
virtual bool existLocalProperty(const std::string &name) const =0
Checks if a property exists in this graph.
PropertyType * getLocalProperty(const std::string &name)
Gets a property on this graph. The name of a property identifies it uniquely. Either there already ex...
bool getAttribute(const std::string &name, ATTRIBUTETYPE &value) const
Gets an attribute on the graph.
virtual void addLocalProperty(const std::string &name, PropertyInterface *prop)=0
Adds a property to the graph. The graph takes ownership of the property. If you want to delete it,...
virtual bool existProperty(const std::string &name) const =0
Checks if a property exists in this graph or one of its ancestors.
PropertyInterface describes the interface of a graph property.