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

SubjectObserver Class Reference

SubjectObserver maintains the observer list and definitions for subject. More...

#include <SubjectObserver.hpp>

Inheritance diagram for SubjectObserver

Inheritance graph
[legend]
Collaboration diagram for SubjectObserver:

Collaboration graph
[legend]
List of all members.

Public Methods

 SubjectObserver ( void )
 Default constructor.

virtual ~SubjectObserver ( void )
 Virtual destructor.

bool operator= ( SubjectObserverCref ) const
 Equality operator.

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

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

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

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

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

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


Protected Methods

 SubjectObserver ( SubjectObserverCref ) throw ( corelinux::Assertion )
 Copy constructor.

SubjectObserverRef operator= ( SubjectObserverCref ) throw ( corelinux::Assertion )
 Assignment operator.


Detailed Description

SubjectObserver maintains the observer list and definitions for subject.

Because we have the need for all of our subjects to also be observers, this factors the behavior as well.


Member Function Documentation

void SubjectObserver::addObserver ( ObserverPtr aObserver,
Event< corelinux::Identifier >* forEvent ) throw ( corelinux::NullPointerException ) [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 >* SubjectObserver::createIterator ( Event< corelinux::Identifier >* anId ) throw ( corelinux::NullPointerException ) [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 >* SubjectObserver::createIterator ( void ) [virtual]
 

Create a iterator for all observers.

Returns:
Iterator

Reimplemented from corelinux::Subject.

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

Deletes the iterator instance.

Parameters:
Iterator  
Exceptions:
NullPointerException   if iterator null

Reimplemented from corelinux::Subject.

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

Remove an observer from specific event notifications.

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

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

Remove an observer from all event notifications.

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

Reimplemented from corelinux::Subject.


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