23 #include <tulip/TulipException.h>
24 #include <tulip/ForEach.h>
25 #include <tulip/vectorgraph.h>
52 enum EventType {TLP_DELETE = 0, TLP_MODIFICATION, TLP_INFORMATION, TLP_INVALID};
56 EventType type()
const {
143 static void holdObservers();
154 static void unholdObservers();
161 return _oHoldCounter;
170 void addObserver(
Observable *
const observer)
const;
178 void addListener(
Observable *
const listener)
const;
186 void removeObserver(
Observable *
const observerver)
const;
194 void removeListener(
Observable *
const listener)
const;
200 unsigned int getSent()
const;
206 unsigned int getReceived()
const;
212 unsigned int countObservers()
const;
218 unsigned int countListeners()
const;
245 static const tlp::VectorGraph& getObservableGraph();
268 void sendEvent(
const Event &message);
278 virtual void treatEvents(
const std::vector<Event> &events);
287 virtual void treatEvent(
const Event &message);
302 void observableDeleted();
316 bool hasOnlookers()
const;
321 _DEPRECATED tlp::Iterator<tlp::Observable *> * getObservables()
const;
326 _DEPRECATED
void notifyObservers();
329 enum OBSERVABLEEDGETYPE {OBSERVABLE = 0x01, OBSERVER = 0x02, LISTENER = 0x04};
339 mutable bool queuedEvent;
354 unsigned int received;
364 tlp::Iterator<Observable *> *getOnlookers()
const;
370 tlp::Iterator<tlp::node> *getInObjects()
const;
376 tlp::Iterator<tlp::node> *getOutObjects()
const;
388 void addOnlooker(
const Observable &obs, OBSERVABLEEDGETYPE type)
const;
403 void removeOnlooker(
const Observable &obs, OBSERVABLEEDGETYPE type)
const;
415 static tlp::VectorGraph _oGraph;
420 static tlp::NodeProperty<Observable *> _oPointer;
425 static tlp::NodeProperty<bool> _oAlive;
430 static tlp::EdgeProperty<unsigned char> _oType;
435 static std::vector<tlp::node> _oDelayedDelNode;
437 static std::set<std::pair<tlp::node, tlp::node> > _oDelayedEvents;
442 static unsigned int _oNotifying;
447 static unsigned int _oUnholding;
452 static unsigned int _oHoldCounter;
457 static bool _oInitialized;
462 static void updateObserverGraph();
470 bool isBound()
const {