gatb.core-API-1.4.2
Subject Class Reference

Class that notifies potential observers. More...

#include <Observer.hpp>

Inheritance diagram for Subject:
Inheritance graph

Public Member Functions

 Subject ()
 
 Subject (const InterfaceId &interface)
 
virtual ~Subject ()
 
InterfaceId getInterface ()
 
void addObserver (IObserver *observer)
 
void removeObserver (IObserver *observer)
 
void notify (EventInfo *event)
 
- Public Member Functions inherited from ISubject
virtual ~ISubject ()
 

Detailed Description

Class that notifies potential observers.

The main purpose of this class is to manage the set of IObservers attached to the subject.

Then, classes that want subject-like behavior can inherit from Subject or have a Subject attribute.

See also
ISubject

Constructor & Destructor Documentation

Subject ( )

Constructor.

Subject ( const InterfaceId &  interface)

Constructor.

Parameters
[in]interface: the identifier of the subject.
~Subject ( )
virtual

Destructor.

Member Function Documentation

void addObserver ( IObserver observer)
virtual

Attach an observer to this subject.

Parameters
[in]observer: the observer to be attached.

Implements ISubject.

InterfaceId getInterface ( )
inlinevirtual

Returns the identifier of the subject.

Implements ISubject.

void notify ( EventInfo event)
virtual

Notify observers by sending a EventInfo instance.

Parameters
[in]event: the information to be sent to the observers.

Implements ISubject.

void removeObserver ( IObserver observer)
virtual

Detach an observer from this subject.

Parameters
[in]observer: the observer to be detached.

Implements ISubject.


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