Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Examples  

corelinux::Subject Class Reference

Subject knows its Observer objects, communicates with its observers through event notification. More...

#include <Subject.hpp>

Inheritance diagram for corelinux::Subject

Inheritance graph
[legend]
List of all members.

Public Methods

 Subject ( void )
 Default constructor.

 Subject ( SubjectCref )
 Copy constructor. More...

virtual ~Subject ( void )
 Virtual destructor.

SubjectRef operator= ( SubjectCref )
 Assignment operator.

bool operator== ( SubjectCref ) const
 Equality operator.

bool operator!= ( SubjectCref ) const
 In-Equality operator.

virtual void addObserver ( ObserverPtr, Event<Identifier> * ) = 0 throw ( NullPointerException )
 Add an observer for a specific event. More...

virtual void removeObserver ( ObserverPtr ) = 0 throw ( NullPointerException )
 Remove an observer from all event notifications. More...

virtual void removeObserver ( ObserverPtr, Event<Identifier> * ) = 0 throw ( NullPointerException )
 Remove an observer from specific event notifications. More...

virtual Iterator<ObserverPtr>* createIterator ( void ) = 0
 Create a iterator for all observers. More...

virtual Iterator<ObserverPtr>* createIterator ( Event<Identifier> * ) = 0 throw ( NullPointerException )
 Create a iterator for observers of this event. More...

virtual void destroyIterator ( Iterator<ObserverPtr> * ) = 0 throw ( NullPointerException )
 Deletes the iterator instance. More...


Protected Methods

virtual void notifyObservers ( Event<Identifier> * ) throw ( NullPointerException )
 Performs the notification of observers for a specific event. More...

virtual void notifyAllObservers ( Event<Identifier> * ) throw ( NullPointerException )
 Performs the notification of ALL observers for a with a specific event. More...


Detailed Description

Subject knows its Observer objects, communicates with its observers through event notification.


Constructor & Destructor Documentation

corelinux::Subject::Subject ( SubjectCref )
 

Copy constructor.

Parameters:
Subject   const referencee


Member Function Documentation

void corelinux::Subject::addObserver ( ObserverPtr aObserver,
Event< Identifier >* ) throw ( NullPointerException ) [pure virtual]
 

Add an observer for a specific event.

Parameters:
Event   the type of event interested in
Exceptions:
NullPointer   exception if event is null

Iterator< ObserverPtr >* corelinux::Subject::createIterator ( Event< Identifier >* ) throw ( NullPointerException ) [pure virtual]
 

Create a iterator for observers of this event.

Parameters:
Event   defines the event type predicate
Returns:
Iterator
Exceptions:
NullPointerException   if event null

Iterator< ObserverPtr >* corelinux::Subject::createIterator ( void ) [pure virtual]
 

Create a iterator for all observers.

Returns:
Iterator

Reimplemented in SubjectObserver.

void corelinux::Subject::destroyIterator ( Iterator< ObserverPtr >* aIterator ) throw ( NullPointerException ) [pure virtual]
 

Deletes the iterator instance.

Parameters:
Iterator  
Exceptions:
NullPointerException   if iterator null

Reimplemented in SubjectObserver.

void corelinux::Subject::notifyAllObservers ( Event< Identifier >* anEvent ) throw ( NullPointerException ) [protected, virtual]
 

Performs the notification of ALL observers for a with a specific event.

Parameters:
Event   key
Exceptions:
NullPointerException   if event is null

void corelinux::Subject::notifyObservers ( Event< Identifier >* anEvent ) throw ( NullPointerException ) [protected, virtual]
 

Performs the notification of observers for a specific event.

Parameters:
Event   key
Exceptions:
NullPointerException   if event is null

void corelinux::Subject::removeObserver ( ObserverPtr aObserver,
Event< Identifier >* ) throw ( NullPointerException ) [pure virtual]
 

Remove an observer from specific event notifications.

Parameters:
Observer   to remove
Exceptions:
NullPointer   exception Observer or Event is null

void corelinux::Subject::removeObserver ( ObserverPtr aObserver ) throw ( NullPointerException ) [pure virtual]
 

Remove an observer from all event notifications.

Parameters:
Observer   to remove
Exceptions:
NullPointer   exception Observer is null

Reimplemented in SubjectObserver.


The documentation for this class was generated from the following files:
This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium