#include <Subject.hpp>
Public Member Functions | |
Subject (void) | |
Default constructor. | |
Subject (SubjectCref) | |
Copy constructor. | |
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. | |
virtual void | removeObserver (ObserverPtr)=0 throw ( NullPointerException ) |
Remove an observer from all event notifications. | |
virtual void | removeObserver (ObserverPtr, Event< Identifier > *)=0 throw ( NullPointerException ) |
Remove an observer from specific event notifications. | |
virtual Iterator< ObserverPtr > * | createIterator (void)=0 |
Create a iterator for all observers. | |
virtual Iterator< ObserverPtr > * | createIterator (Event< Identifier > *)=0 throw ( NullPointerException ) |
Create a iterator for observers of this event. | |
virtual void | destroyIterator (Iterator< ObserverPtr > *)=0 throw ( NullPointerException ) |
Deletes the iterator instance. | |
Protected Member Functions | |
virtual void | notifyObservers (Event< Identifier > *) throw ( NullPointerException ) |
Performs the notification of observers for a specific event. | |
virtual void | notifyAllObservers (Event< Identifier > *) throw ( NullPointerException ) |
Performs the notification of ALL observers for a with a specific event. |
corelinux::Subject::Subject | ( | SubjectCref | ) |
virtual void corelinux::Subject::addObserver | ( | ObserverPtr | , | |
Event< Identifier > * | ||||
) | throw ( NullPointerException ) [pure virtual] |
Add an observer for a specific event.
Event | the type of event interested in |
NullPointer | exception if event is null |
virtual void corelinux::Subject::removeObserver | ( | ObserverPtr | ) | throw ( NullPointerException ) [pure virtual] |
virtual void corelinux::Subject::removeObserver | ( | ObserverPtr | , | |
Event< Identifier > * | ||||
) | throw ( NullPointerException ) [pure virtual] |
virtual Iterator<ObserverPtr>* corelinux::Subject::createIterator | ( | void | ) | [pure virtual] |
Create a iterator for all observers.
Referenced by notifyAllObservers(), and notifyObservers().
virtual Iterator<ObserverPtr>* corelinux::Subject::createIterator | ( | Event< Identifier > * | ) | throw ( NullPointerException ) [pure virtual] |
Create a iterator for observers of this event.
Event | defines the event type predicate |
NullPointerException | if event null |
virtual void corelinux::Subject::destroyIterator | ( | Iterator< ObserverPtr > * | ) | throw ( NullPointerException ) [pure virtual] |
Deletes the iterator instance.
Iterator |
NullPointerException | if iterator null |
void corelinux::Subject::notifyObservers | ( | Event< Identifier > * | anEvent | ) | throw ( NullPointerException ) [protected, virtual] |
Performs the notification of observers for a specific event.
Event | key |
NullPointerException | if event is null |
References createIterator(), corelinux::Observer::event(), corelinux::Iterator< ElementType >::getElement(), corelinux::Iterator< ElementType >::isValid(), and corelinux::Iterator< ElementType >::setNext().
void corelinux::Subject::notifyAllObservers | ( | Event< Identifier > * | anEvent | ) | throw ( NullPointerException ) [protected, virtual] |
Performs the notification of ALL observers for a with a specific event.
Event | key |
NullPointerException | if event is null |
References createIterator(), corelinux::Observer::event(), corelinux::Iterator< ElementType >::getElement(), corelinux::Iterator< ElementType >::isValid(), and corelinux::Iterator< ElementType >::setNext().