Design Pattern Examples
Overview of object-oriented design patterns
IEventNotifications Struct Referenceabstract

Represents a Subject that takes observers implementing the IObserverNumberChanged interface. More...

#include <ObserverSubject_NumberProducer.h>

Inheritance diagram for IEventNotifications:
Inheritance graph
Collaboration diagram for IEventNotifications:
Collaboration graph

Public Member Functions

virtual ~IEventNotifications ()
 Virtual destructor required for interfaces in abstract classes.
 
virtual void SubscribeToNumberChanged (IObserverNumberChanged::shared_ptr_t observer)=0
 
virtual void UnsubscribeFromNumberChanged (IObserverNumberChanged::shared_ptr_t observer)=0
 

Detailed Description

Represents a Subject that takes observers implementing the IObserverNumberChanged interface.

In more complex systems, an interface like this might have multiple subscribe/unsubscribe methods for different kinds of observers. For C#, such multiple methods might actually be one Subscribe/Unsubscribe method that uses overloading to take different observer interfaces.

This interface is use to ensure the Subject implements all the necessary methods to support observers.

Definition at line 79 of file ObserverSubject_NumberProducer.h.

Constructor & Destructor Documentation

◆ ~IEventNotifications()

virtual ~IEventNotifications ( )
inlinevirtual

Virtual destructor required for interfaces in abstract classes.

Definition at line 84 of file ObserverSubject_NumberProducer.h.

Member Function Documentation

◆ SubscribeToNumberChanged()

virtual void SubscribeToNumberChanged ( IObserverNumberChanged::shared_ptr_t  observer)
pure virtual

◆ UnsubscribeFromNumberChanged()

virtual void UnsubscribeFromNumberChanged ( IObserverNumberChanged::shared_ptr_t  observer)
pure virtual

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