Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Observable Class Reference

Simple observable class. More...

#include <ObserverPattern.h>

Public Member Functions

void attach (Observer *listener)
 
void detach (Observer *listener)
 
void notify ()
 Update all of the observers that a change has been made. More...
 

Private Attributes

std::set< Observer * > m_observers
 

Detailed Description

Simple observable class.

This is used to signify if a change has been made and then needs to notify its observers.

Definition at line 30 of file ObserverPattern.h.

Member Function Documentation

◆ attach()

void Observable::attach ( Observer listener)
inline
Parameters
listener:: want to be notified when this observer changes

Definition at line 37 of file ObserverPattern.h.

References m_observers.

◆ detach()

void Observable::detach ( Observer listener)
inline
Parameters
listener:: no longer want to be notified when this observer changes

Definition at line 41 of file ObserverPattern.h.

References m_observers.

◆ notify()

void Observable::notify ( )
inline

Update all of the observers that a change has been made.

Definition at line 45 of file ObserverPattern.h.

References m_observers.

Member Data Documentation

◆ m_observers

std::set<Observer *> Observable::m_observers
private

Definition at line 31 of file ObserverPattern.h.

Referenced by attach(), detach(), and notify().


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