|
Event-Driven Programming in C++ 1.0
A case study on event-driven programming in C++
|
A test observer that records notification messages. More...
Public Member Functions | |
| void | onNotify (const std::string &message) override |
| Callback method invoked when the subject notifies the observer. | |
| const std::vector< std::string > & | getMessages () const |
| Retrieves the messages received by this observer. | |
Public Member Functions inherited from observer::IObserver | |
| virtual | ~IObserver ()=default |
| Virtual destructor. | |
Private Attributes | |
| std::vector< std::string > | messages |
| Container to store received notification messages. | |
A test observer that records notification messages.
This class implements the IObserver interface and stores any messages it receives in a vector. It is used to verify that notifications are delivered correctly.
|
inline |
Retrieves the messages received by this observer.
|
inlineoverridevirtual |
Callback method invoked when the subject notifies the observer.
The received message is appended to an internal vector for later verification.
| message | The message provided by the subject. |
Implements observer::IObserver.
|
private |
Container to store received notification messages.