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>
38 if (existLocalProperty(name)) {
40 assert(
dynamic_cast<PropertyType *
>(prop) !=
nullptr);
41 return dynamic_cast<PropertyType *
>(prop);
43 PropertyType *prop =
new PropertyType(
this, name);
44 this->addLocalProperty(name, prop);
49 template <
typename PropertyType>
51 if (existProperty(name)) {
53 assert(
dynamic_cast<PropertyType *
>(prop) !=
nullptr);
54 return dynamic_cast<PropertyType *
>(prop);
56 return getLocalProperty<PropertyType>(name);
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...
virtual PropertyInterface * getProperty(const std::string &name) const =0
Gets an existing property. In DEBUG mode an assertion checks the existence of the property.
void setAttribute(const std::string &name, const ATTRIBUTETYPE &value)
Sets an attribute on the graph.
const DataSet & getAttributes() const
Gets the attributes of the 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.
PropertyInterface describes the interface of a graph property.