gatb.core-API-0.0.0
AbstractSubjectIterator Class Reference

Factorization of code for the subject part of the Observer pattern. More...

#include <IteratorHelpers.hpp>

Inheritance diagram for AbstractSubjectIterator:
Inheritance graph

Public Member Functions

 AbstractSubjectIterator ()
 
 ~AbstractSubjectIterator ()
 
void addObserver (IteratorListener *f)
 
void removeObserver (IteratorListener *f)
 
void setMessage (const std::string &message)
 

Protected Member Functions

void notifyInc (u_int64_t current)
 
void notifyInit ()
 
void notifyFinish ()
 

Detailed Description

Factorization of code for the subject part of the Observer pattern.

Constructor & Destructor Documentation

Constructor.

Destructor.

Member Function Documentation

void addObserver ( IteratorListener f)
inline

Add an observer to the iterator. Such an observer is provided as a functor.

Parameters
[in]f: functor to be subscribed to the iterator notifications.
void notifyFinish ( )
inlineprotected

Notify all the subscribed functors about the start of the iteration.

void notifyInc ( u_int64_t  current)
inlineprotected

Notify all the subscribed functors.

Parameters
[in]current: number of currently iterated items during the iteration.
void notifyInit ( )
inlineprotected

Notify all the subscribed functors about the start of the iteration.

void removeObserver ( IteratorListener f)
inline

Remove an observer from the iterator. Such an observer is provided as a functor.

Parameters
[in]f: functor to be unsubscribed from the iterator notifications.
void setMessage ( const std::string &  message)
inline

Set a message to the observers.


The documentation for this class was generated from the following file: