ApparatusFramework::Observer< Event > Class Template Reference

#include <PatternServices/current/include/Observer.h>

List of all members.

Public Member Functions

 Observer ()
virtual ~Observer ()
virtual void update (Event event, Observable< Event > *origin)=0

Detailed Description

template<class Event>
class ApparatusFramework::Observer< Event >

The observer class implements one part of the observer pattern. We use the same terminology and concepts as the implementation provided by the java standard library. The observer virtual method update is called each time the observable object has modified a relevant aspect of its internal state. The observable object is responsible to call the update method. The observer class is realized as a template based mixin class. The derived class can redefined the update method. This redefinition allows the use of the pattern for passive and active class. In the case of an active object, the update method can simply send a message to itself on each update call.

The update method can be freely updated. This flexibility allows to use this pattern for passive and for active objects. The method can contain code to process the update information or simply set up and send a kernel message to the task embodied in the observer object.

Definition at line 94 of file Observer.h.


Constructor & Destructor Documentation

template<class Event >
ApparatusFramework::Observer< Event >::Observer (  )  [inline]

constructors, destructors Constructs a new observer

Definition at line 117 of file Observer.h.

template<class Event >
ApparatusFramework::Observer< Event >::~Observer (  )  [inline, virtual]

Destructs the previously created observer

Definition at line 121 of file Observer.h.


Member Function Documentation

template<class Event>
virtual void ApparatusFramework::Observer< Event >::update ( Event  event,
Observable< Event > *  origin 
) [pure virtual]

public member methods The update method is called by the observable object each time a relevant change happens.

Parameters:
event The event sent by the observable object when a change happens. The event object is often used to provide a hint which change happened.
origin If you use a model with more than one observable, here is the pointer with the address of the observable which has changed its state.
© 2004-2010 bbv Software Services AG / Apparatus Services