19 #include <tulip/PluginProgress.h> 20 #include <tulip/PropertyInterface.h> 23 template <
typename ATTRIBUTETYPE>
28 template <
typename ATTRIBUTETYPE>
31 notifyBeforeSetAttribute(name);
32 data.
set(name, value);
33 notifyAfterSetAttribute(name);
36 template <
typename PropertyType>
40 assert(dynamic_cast<PropertyType *>(prop) !=
nullptr);
41 return dynamic_cast<PropertyType *
>(prop);
43 PropertyType *prop =
new PropertyType(
this, name);
49 template <
typename PropertyType>
53 assert(dynamic_cast<PropertyType *>(prop) !=
nullptr);
54 return dynamic_cast<PropertyType *
>(prop);
56 return getLocalProperty<PropertyType>(name);
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...
PropertyType * getLocalProperty(const std::string &name)
Gets a property on this graph. The name of a property identifies it uniquely. Either there already ex...
PropertyInterface describes the interface of a graph property.
bool getAttribute(const std::string &name, ATTRIBUTETYPE &value) const
Gets an attribute on the graph.
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...
A container that can store data from any type.
const DataSet & getAttributes() const
Gets the attributes of 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 existProperty(const std::string &name) const =0
Checks if a property exists in this graph or one of its ancestors.
virtual bool existLocalProperty(const std::string &name) const =0
Checks if a property exists in this graph.
void setAttribute(const std::string &name, const ATTRIBUTETYPE &value)
Sets 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...