openMSX
Public Member Functions | Protected Member Functions | List of all members
openmsx::Subject< T > Class Template Reference

Generic Gang-of-Four Subject class of the Observer pattern, templatized edition. More...

#include <Subject.hh>

Inheritance diagram for openmsx::Subject< T >:
Inheritance graph
[legend]

Public Member Functions

void attach (Observer< T > &observer)
 
void detach (Observer< T > &observer)
 
bool anyObservers () const
 

Protected Member Functions

 Subject ()=default
 
 ~Subject ()
 
void notify () const
 

Detailed Description

template<typename T>
class openmsx::Subject< T >

Generic Gang-of-Four Subject class of the Observer pattern, templatized edition.

Definition at line 17 of file Subject.hh.

Constructor & Destructor Documentation

◆ Subject()

template<typename T >
openmsx::Subject< T >::Subject ( )
protecteddefault

◆ ~Subject()

template<typename T >
openmsx::Subject< T >::~Subject ( )
protected

Definition at line 40 of file Subject.hh.

Member Function Documentation

◆ anyObservers()

template<typename T >
bool openmsx::Subject< T >::anyObservers ( ) const
inline

Definition at line 22 of file Subject.hh.

◆ attach()

template<typename T >
void openmsx::Subject< T >::attach ( Observer< T > &  observer)

◆ detach()

template<typename T >
void openmsx::Subject< T >::detach ( Observer< T > &  observer)

◆ notify()

template<typename T >
void openmsx::Subject< T >::notify ( ) const
protected

Definition at line 67 of file Subject.hh.

References ranges::remove().


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