CoreLinux++
0.4.32
|
Subject knows its Observer objects, communicates with its observers through event notification. More...
#include <Subject.hpp>
Public Member Functions | |
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 Member Functions | |
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... | |
corelinux::Subject::Subject | ( | SubjectCref | ) |
Copy constructor.
Subject | const referencee |
|
pure virtual |
Add an observer for a specific event.
Event | the type of event interested in |
NullPointer | exception if event is null |
|
pure virtual |
Create a iterator for all observers.
Referenced by notifyAllObservers(), and notifyObservers().
|
pure virtual |
Create a iterator for observers of this event.
Event | defines the event type predicate |
NullPointerException | if event null |
|
pure virtual |
|
protectedvirtual |
Performs the notification of ALL observers for a with a specific event.
Event | key |
NullPointerException | if event is null |
References createIterator(), corelinux::Iterator< ElementType >::getElement(), corelinux::Iterator< ElementType >::isValid(), and corelinux::Iterator< ElementType >::setNext().
|
protectedvirtual |
Performs the notification of observers for a specific event.
Event | key |
NullPointerException | if event is null |
References createIterator(), corelinux::Iterator< ElementType >::getElement(), corelinux::Iterator< ElementType >::isValid(), and corelinux::Iterator< ElementType >::setNext().
|
pure virtual |
|
pure virtual |