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;
 
  133   bool rename(
const std::string& newName);
 
  167   virtual std::string getNodeStringValue( 
const node n ) 
const = 0;
 
  174   virtual std::string getEdgeStringValue( 
const edge e ) 
const = 0;
 
  182   virtual bool setNodeStringValue( 
const node n, 
const std::string & value ) = 0;
 
  190   virtual bool setEdgeStringValue( 
const edge e, 
const std::string & value ) = 0;
 
  196   virtual std::string getNodeDefaultStringValue() 
const = 0;
 
  202   virtual std::string getEdgeDefaultStringValue() 
const = 0;
 
  210   virtual bool setAllNodeStringValue( 
const std::string & value ) = 0;
 
  218   virtual bool setAllEdgeStringValue( 
const std::string & value ) = 0;
 
  225   virtual DataMem* getNodeDefaultDataMemValue() 
const = 0;
 
  232   virtual DataMem* getEdgeDefaultDataMemValue() 
const = 0;
 
  239   virtual void setAllNodeDataMemValue(
const DataMem* value) = 0;
 
  246   virtual void setAllEdgeDataMemValue(
const DataMem* v ) = 0;
 
  255   virtual DataMem* getNodeDataMemValue( 
const node n ) 
const = 0;
 
  264   virtual DataMem* getEdgeDataMemValue( 
const edge e ) 
const = 0;
 
  273   virtual DataMem* getNonDefaultDataMemValue( 
const node n ) 
const = 0;
 
  282   virtual DataMem* getNonDefaultDataMemValue( 
const edge e ) 
const = 0;
 
  289   virtual void setNodeDataMemValue( 
const node n, 
const DataMem* value) = 0;
 
  296   virtual void setEdgeDataMemValue( 
const edge e, 
const DataMem* v) = 0;
 
  305   virtual tlp::Iterator<node>* getNonDefaultValuatedNodes(
const Graph* = NULL) 
const = 0;
 
  314   virtual tlp::Iterator<edge>* getNonDefaultValuatedEdges(
const Graph* = NULL) 
const = 0;
 
  324   virtual void computeMetaValue(node metaNode, Graph* subgraph, Graph* metaGraph)=0;
 
  332   virtual void computeMetaValue(edge metaEdge, tlp::Iterator<edge>* it, Graph* metaGraph)=0;
 
  347     return metaValueCalculator;
 
  357     metaValueCalculator = calculator;
 
  366   virtual int compare(
const node n1,
const node n2) 
const = 0;
 
  374   virtual int compare(
const edge e1,
const edge e2) 
const = 0;
 
  377   MetaValueCalculator* metaValueCalculator;
 
  380   void notifyBeforeSetNodeValue(
const node n);
 
  381   void notifyAfterSetNodeValue(
const node n);
 
  382   void notifyBeforeSetEdgeValue(
const edge e);
 
  383   void notifyAfterSetEdgeValue(
const edge e);
 
  384   void notifyBeforeSetAllNodeValue();
 
  385   void notifyAfterSetAllNodeValue();
 
  386   void notifyBeforeSetAllEdgeValue();
 
  387   void notifyAfterSetAllEdgeValue();
 
  388   void notifyDestroy();
 
  389   void notifyRename(
const std::string& newName);
 
  403   enum PropertyEventType {TLP_BEFORE_SET_NODE_VALUE = 0,
 
  404                           TLP_AFTER_SET_NODE_VALUE,
 
  405                           TLP_BEFORE_SET_ALL_NODE_VALUE,
 
  406                           TLP_AFTER_SET_ALL_NODE_VALUE,
 
  407                           TLP_BEFORE_SET_ALL_EDGE_VALUE,
 
  408                           TLP_AFTER_SET_ALL_EDGE_VALUE,
 
  409                           TLP_BEFORE_SET_EDGE_VALUE,
 
  410                           TLP_AFTER_SET_EDGE_VALUE
 
  413                 Event::EventType evtType = Event::TLP_MODIFICATION,
 
  414                 unsigned int id = UINT_MAX)
 
  415     : 
Event(prop, evtType), evtType(propEvtType), eltId(
id) {}
 
  421   node getNode()
 const {
 
  422     assert(evtType < TLP_BEFORE_SET_ALL_NODE_VALUE);
 
  426   edge getEdge()
 const {
 
  427     assert(evtType > TLP_AFTER_SET_ALL_EDGE_VALUE);
 
  431   PropertyEventType getType()
 const {
 
  436   PropertyEventType evtType;
 
  444 #ifndef DOXYGEN_NOTFOR_DEVEL 
  446 TLP_BEGIN_HASH_NAMESPACE {
 
  448   struct TLP_SCOPE hash<const tlp::PropertyInterface *> {
 
  452   struct TLP_SCOPE hash<tlp::PropertyInterface *> {
 
  455 } TLP_END_HASH_NAMESPACE
 
  457 #endif // DOXYGEN_NOTFOR_DEVEL 
  459 #endif // PROPERTY_INTERFACE_H