Event-Driven Programming in C++ 1.0
A case study on event-driven programming in C++
Loading...
Searching...
No Matches
observer::IObserver Class Referenceabstract

Interface for observer objects. More...

#include <observer.hpp>

Inheritance diagram for observer::IObserver:
ConcreteObserver TestObserver

Public Member Functions

virtual ~IObserver ()=default
 Virtual destructor.
 
virtual void onNotify (const std::string &message)=0
 Notifies the observer of an event.
 

Detailed Description

Interface for observer objects.

The IObserver interface declares the onNotify() method that must be implemented by any class that wishes to be notified of events by a Subject.

Constructor & Destructor Documentation

◆ ~IObserver()

virtual observer::IObserver::~IObserver ( )
virtualdefault

Virtual destructor.

Ensures that derived classes are properly destroyed.

Member Function Documentation

◆ onNotify()

virtual void observer::IObserver::onNotify ( const std::string &  message)
pure virtual

Notifies the observer of an event.

This pure virtual function must be overridden by derived classes to handle event notifications.

Parameters
messageA string containing details about the event.

Implemented in ConcreteObserver, and TestObserver.


The documentation for this class was generated from the following file: