20 #ifndef PROPERTY_INTERFACE_H
21 #define PROPERTY_INTERFACE_H
24 #include <tulip/tulipconf.h>
25 #include <tulip/Observable.h>
26 #include <tulip/Node.h>
27 #include <tulip/Edge.h>
34 template<
class itType >
53 friend class PropertyManager;
69 virtual void erase(
const node) = 0;
75 virtual void erase(
const edge) = 0;
86 bool ifNotDefault =
false) =0;
96 bool ifNotDefault =
false) =0;
117 virtual std::string getTypename()
const = 0;
160 virtual std::string getNodeStringValue(
const node n )
const = 0;
167 virtual std::string getEdgeStringValue(
const edge e )
const = 0;
175 virtual bool setNodeStringValue(
const node n,
const std::string & value ) = 0;
183 virtual bool setEdgeStringValue(
const edge e,
const std::string & value ) = 0;
189 virtual std::string getNodeDefaultStringValue()
const = 0;
195 virtual std::string getEdgeDefaultStringValue()
const = 0;
203 virtual bool setAllNodeStringValue(
const std::string & value ) = 0;
211 virtual bool setAllEdgeStringValue(
const std::string & value ) = 0;
218 virtual DataMem* getNodeDefaultDataMemValue()
const = 0;
225 virtual DataMem* getEdgeDefaultDataMemValue()
const = 0;
232 virtual void setAllNodeDataMemValue(
const DataMem* value) = 0;
239 virtual void setAllEdgeDataMemValue(
const DataMem* v ) = 0;
248 virtual DataMem* getNodeDataMemValue(
const node n )
const = 0;
257 virtual DataMem* getEdgeDataMemValue(
const edge e )
const = 0;
266 virtual DataMem* getNonDefaultDataMemValue(
const node n )
const = 0;
275 virtual DataMem* getNonDefaultDataMemValue(
const edge e )
const = 0;
282 virtual void setNodeDataMemValue(
const node n,
const DataMem* value) = 0;
289 virtual void setEdgeDataMemValue(
const edge e,
const DataMem* v) = 0;
298 virtual tlp::Iterator<node>* getNonDefaultValuatedNodes(
const Graph* = NULL)
const = 0;
307 virtual tlp::Iterator<edge>* getNonDefaultValuatedEdges(
const Graph* = NULL)
const = 0;
317 virtual void computeMetaValue(node metaNode, Graph* subgraph, Graph* metaGraph)=0;
325 virtual void computeMetaValue(edge metaEdge, tlp::Iterator<edge>* it, Graph* metaGraph)=0;
340 return metaValueCalculator;
350 metaValueCalculator = calculator;
359 virtual int compare(
const node n1,
const node n2)
const = 0;
367 virtual int compare(
const edge e1,
const edge e2)
const = 0;
370 MetaValueCalculator* metaValueCalculator;
373 void notifyBeforeSetNodeValue(
const node n);
374 void notifyAfterSetNodeValue(
const node n);
375 void notifyBeforeSetEdgeValue(
const edge e);
376 void notifyAfterSetEdgeValue(
const edge e);
377 void notifyBeforeSetAllNodeValue();
378 void notifyAfterSetAllNodeValue();
379 void notifyBeforeSetAllEdgeValue();
380 void notifyAfterSetAllEdgeValue();
381 void notifyDestroy();
395 enum PropertyEventType {TLP_BEFORE_SET_NODE_VALUE = 0,
396 TLP_AFTER_SET_NODE_VALUE,
397 TLP_BEFORE_SET_ALL_NODE_VALUE,
398 TLP_AFTER_SET_ALL_NODE_VALUE,
399 TLP_BEFORE_SET_ALL_EDGE_VALUE,
400 TLP_AFTER_SET_ALL_EDGE_VALUE,
401 TLP_BEFORE_SET_EDGE_VALUE,
402 TLP_AFTER_SET_EDGE_VALUE
405 Event::EventType evtType = Event::TLP_MODIFICATION,
406 unsigned int id = UINT_MAX)
407 :
Event(prop, evtType), evtType(propEvtType), eltId(
id) {}
413 node getNode()
const {
414 assert(evtType < TLP_BEFORE_SET_ALL_NODE_VALUE);
418 edge getEdge()
const {
419 assert(evtType > TLP_AFTER_SET_ALL_EDGE_VALUE);
423 PropertyEventType getType()
const {
428 PropertyEventType evtType;
436 #ifndef DOXYGEN_NOTFOR_DEVEL
438 TLP_BEGIN_HASH_NAMESPACE {
440 struct TLP_SCOPE hash<const tlp::PropertyInterface *> {
444 struct TLP_SCOPE hash<tlp::PropertyInterface *> {
447 } TLP_END_HASH_NAMESPACE
449 #endif // DOXYGEN_NOTFOR_DEVEL
451 #endif // PROPERTY_INTERFACE_H