Tulip  4.2.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
tlp::GraphNeedsSavingObserver Class Reference

#include <GraphNeedsSavingObserver.h>

Inherits QObject, and tlp::Observable.

Signals

void savingNeeded ()
 

Public Member Functions

 GraphNeedsSavingObserver (Graph *graph)
 
bool needsSaving () const
 
void saved ()
 

Protected Member Functions

virtual void treatEvents (const std::vector< Event > &)
 

Additional Inherited Members

- Private Member Functions inherited from tlp::Observable
void addListener (Observable *const listener) const
 
void addObserver (Observable *const observer) const
 
unsigned int countListeners () const
 
unsigned int countObservers () const
 
unsigned int getReceived () const
 
unsigned int getSent () const
 
void removeListener (Observable *const listener) const
 
void removeObserver (Observable *const observerver) const
 
 Observable (const Observable &)
 
tlp::Iterator< tlp::Observable * > * getObservables () const
 
bool hasOnlookers () const
 
void notifyObservers ()
 
void observableDeleted ()
 
Observableoperator= (const Observable &)
 
void sendEvent (const Event &message)
 
virtual void treatEvent (const Event &message)
 
- Static Private Member Functions inherited from tlp::Observable
static ObservablegetObject (tlp::node n)
 
static const tlp::VectorGraph & getObservableGraph ()
 
static void holdObservers ()
 
static bool isAlive (tlp::node n)
 
static unsigned int observersHoldCounter ()
 
static void unholdObservers ()
 

Detailed Description

The GraphNeedsSavingObserver class will observe a graph and tells if it has been modified.

See Also
Observable
  • The constructor. Observe the graph given in parameter for modification
  • needsSaving. Returns true is the graph has been modified
  • saved. The graph has been saved, and the status of the class must be reset. needsSaving will return false if called after saved().
  • savingNeeded. Signal send when the status of the graph evolves.

Definition at line 42 of file GraphNeedsSavingObserver.h.

Constructor & Destructor Documentation

tlp::GraphNeedsSavingObserver::GraphNeedsSavingObserver ( Graph graph)

GraphNeedsSavingObserver Class constructor.

Parameters
graphthe graph which needs to be observed for modifications

Member Function Documentation

bool tlp::GraphNeedsSavingObserver::needsSaving ( ) const

needsSaving Indicates if the graph has been modified, and thus needs to be saved.

Returns
true if the graph needs to be saved, false otherwise.
void tlp::GraphNeedsSavingObserver::saved ( )

saved If the graph has been saved, one has to call this method to reset the status of the graph (it does not need to be saved). to indicate that the graph does not need to be saved until a new modification.

void tlp::GraphNeedsSavingObserver::savingNeeded ( )
signal

savingNeeded This signal is sent when the graph needs to be saved (it has been modified).

virtual void tlp::GraphNeedsSavingObserver::treatEvents ( const std::vector< Event > &  )
protectedvirtual

treatEvents This function is called when events are sent to Observers, and Observers only.

See Also
Listener
Observer
Observable
Observable::treatEvents(const std::vector<Event>&)
Parameters
eventsThe events that happened since the last unHoldObservers().

Reimplemented from tlp::Observable.