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

 Subject (const Subject &)=delete
 
 Subject (Subject &&)=delete
 
Subjectoperator= (const Subject &)=delete
 
Subjectoperator= (Subject &&)=delete
 
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() [1/3]

template<typename T >
openmsx::Subject< T >::Subject ( const Subject< T > &  )
delete

◆ Subject() [2/3]

template<typename T >
openmsx::Subject< T >::Subject ( Subject< T > &&  )
delete

◆ Subject() [3/3]

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

◆ ~Subject()

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

Definition at line 45 of file Subject.hh.

Member Function Documentation

◆ anyObservers()

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

Definition at line 27 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 71 of file Subject.hh.

References ranges::remove().

◆ operator=() [1/2]

template<typename T >
Subject & openmsx::Subject< T >::operator= ( const Subject< T > &  )
delete

◆ operator=() [2/2]

template<typename T >
Subject & openmsx::Subject< T >::operator= ( Subject< T > &&  )
delete

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