Represents the Subject to the observers. This is the minimum needed by observers to get access to the data provided by the Subject class. More...
#include <ObserverSubject_NumberProducer.h>
Public Types | |
using | shared_ptr_t = std::shared_ptr< INumberProducer > |
Alias to make it easier to use this shared pointer. | |
Public Member Functions | |
virtual | ~INumberProducer () |
Virtual destructor required for interfaces in abstract classes. | |
virtual void | Update ()=0 |
Update the number then notify all observers. | |
virtual uint32_t | FetchNumber ()=0 |
Return the current value from the Subject. | |
Represents the Subject to the observers. This is the minimum needed by observers to get access to the data provided by the Subject class.
An interface is used to represent the Subject to the observers so the observers do not have too much knowledge about the Subject, allowing more freedom to change the Subject class implementation without affecting observers. This interface would naturally have to change if the observers needed more data from the Subject.
Definition at line 107 of file ObserverSubject_NumberProducer.h.
using shared_ptr_t = std::shared_ptr<INumberProducer> |
Alias to make it easier to use this shared pointer.
Definition at line 112 of file ObserverSubject_NumberProducer.h.
|
inlinevirtual |
Virtual destructor required for interfaces in abstract classes.
Definition at line 117 of file ObserverSubject_NumberProducer.h.
|
pure virtual |
Return the current value from the Subject.
Implemented in ObserverSubject_NumberProducer.
|
pure virtual |
Update the number then notify all observers.
Implemented in ObserverSubject_NumberProducer.