A subject that can be watched for signals by observers.
More...
#include <subject.h>
A subject that can be watched for signals by observers.
- Author
- Thomas Montano
- Date
- July 29 2020
◆ getNumObservers()
int rune::Subject::getNumObservers |
( |
void |
| ) |
|
|
protected |
Get the number of observers subscribed to this subject.
- Returns
- The number of observers currently subscribed to this subject.
◆ sendSignal()
void rune::Subject::sendSignal |
( |
Signal |
signalToSend | ) |
|
|
protected |
Send a signal to all observers.
- Parameters
-
signalToSend | The signal to be sent out to all the observers. |
◆ subscribe()
void rune::Subject::subscribe |
( |
Observer & |
newObserver | ) |
|
Tell the subject that an observer would like to be notified of signals.
- Parameters
-
newObserver | The observer that would like to be notified of signals. |
- Returns
- Whether or not the observer was successfully subscribed.
◆ unsubscribe()
bool rune::Subject::unsubscribe |
( |
Observer & |
observer | ) |
|
Tell the subject that an observer would no longer like to be notified of signals.
- Parameters
-
observer | The observer that would no longer like to be notified of signals. |
- Returns
- Whether or not the observer was successfully subscribed.
The documentation for this class was generated from the following files: