The observer interface contains some pure virtual functions to override. The add() and erase() functions are to notify the oberver when one item is added or erased.
The build() and clear() members are to notify the observer about the container is built from an empty container or is cleared to an empty container.
#include <lemon/bits/alteration_notifier.h>
Inherited by NodeObserverProxy, and NodeObserverProxy.
Protected Member Functions | |
ObserverBase () | |
Default constructor. | |
ObserverBase (AlterationNotifier &nf) | |
ObserverBase (const ObserverBase ©) | |
Constructor which attach the obserever to the same notifier. | |
virtual | ~ObserverBase () |
Destructor. | |
void | attach (AlterationNotifier &nf) |
Attaches the observer into an AlterationNotifier. | |
void | detach () |
Detaches the observer into an AlterationNotifier. | |
Notifier * | notifier () const |
Gives back a pointer to the notifier which the map attached into. | |
bool | attached () const |
Gives back true when the observer is attached into a notifier. | |
virtual void | add (const Item &)=0 |
The member function to notificate the observer about an item is added to the container. | |
virtual void | add (const std::vector< Item > &items)=0 |
The member function to notificate the observer about more item is added to the container. | |
virtual void | erase (const Item &)=0 |
The member function to notificate the observer about an item is erased from the container. | |
virtual void | erase (const std::vector< Item > &items)=0 |
The member function to notificate the observer about more item is erased from the container. | |
virtual void | build ()=0 |
The member function to notificate the observer about the container is built. | |
virtual void | clear ()=0 |
The member function to notificate the observer about all items are erased from the container. |
ObserverBase | ( | ) | [inline, protected] |
Default constructor for ObserverBase.
ObserverBase | ( | AlterationNotifier & | nf | ) | [inline, protected] |
Constructor which attach the observer into notifier.
ObserverBase | ( | const ObserverBase & | copy | ) | [inline, protected] |
Constructor which attach the obserever to the same notifier as the other observer is attached to.
void attach | ( | AlterationNotifier & | nf | ) | [inline, protected] |
This member attaches the observer into an AlterationNotifier.
void detach | ( | ) | [inline, protected] |
This member detaches the observer from an AlterationNotifier.
Notifier* notifier | ( | ) | const [inline, protected] |
This function gives back a pointer to the notifier which the map attached into.
virtual void add | ( | const Item & | ) | [protected, pure virtual] |
The add() member function notificates the observer about an item is added to the container. It have to be overrided in the subclasses.
virtual void add | ( | const std::vector< Item > & | items | ) | [protected, pure virtual] |
The add() member function notificates the observer about more item is added to the container. It have to be overrided in the subclasses.
virtual void erase | ( | const Item & | ) | [protected, pure virtual] |
The erase() member function notificates the observer about an item is erased from the container. It have to be overrided in the subclasses.
virtual void erase | ( | const std::vector< Item > & | items | ) | [protected, pure virtual] |
The erase() member function notificates the observer about more item is erased from the container. It have to be overrided in the subclasses.
virtual void build | ( | ) | [protected, pure virtual] |
The build() member function notificates the observer about the container is built from an empty container. It have to be overrided in the subclasses.
virtual void clear | ( | ) | [protected, pure virtual] |
The clear() member function notificates the observer about all items are erased from the container. It have to be overrided in the subclasses.