Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
berry::Message< A > Class Template Reference

Event/message/notification class. More...

#include <berryMessage.h>

Collaboration diagram for berry::Message< A >:

Public Types

typedef Message Self
 
typedef MessageAbstractDelegate< A > AbstractDelegate
 
typedef DelegateList< AbstractDelegate >::ListType ListenerList
 

Public Member Functions

void AddListener (const AbstractDelegate &delegate) const
 
void operator+= (const AbstractDelegate &delegate) const
 
void RemoveListener (const AbstractDelegate &delegate) const
 
void operator-= (const AbstractDelegate &delegate) const
 
void Send () const
 
void operator() () const
 
void SetExceptionHandler (const AbstractExceptionHandler &handler)
 
AbstractExceptionHandlerGetExceptionHandler () const
 
ListenerList GetListeners () const
 
bool HasListeners () const
 
bool IsEmpty () const
 

Protected Attributes

DelegateList< AbstractDelegatedelegates
 

Detailed Description

template<typename A = void>
class berry::Message< A >

Event/message/notification class.

This class allows one class to send out messages and another class to receive these message. There are subclasses for sending parameters along with the messages.

This is an implementation of the Observer pattern.

  • There is no guarantee about the order of which observer is notified first. At the moment the observers which register first will be notified first.
  • Notifications are synchronous, by direct method calls. There is no support for asynchronous messages.

Definition at line 716 of file berryMessage.h.

Member Typedef Documentation

◆ AbstractDelegate

template<typename A = void>
typedef MessageAbstractDelegate<A> berry::Message< A >::AbstractDelegate

Definition at line 721 of file berryMessage.h.

◆ ListenerList

template<typename A = void>
typedef DelegateList<AbstractDelegate>::ListType berry::Message< A >::ListenerList

Definition at line 722 of file berryMessage.h.

◆ Self

template<typename A = void>
typedef Message berry::Message< A >::Self

Definition at line 720 of file berryMessage.h.

Member Function Documentation

◆ AddListener()

template<typename A = void>
void berry::Message< A >::AddListener ( const AbstractDelegate delegate) const
inline

Definition at line 724 of file berryMessage.h.

References berry::Message< A >::delegates.

Referenced by berry::Message< A >::operator+=().

◆ GetExceptionHandler()

template<typename A = void>
AbstractExceptionHandler* berry::Message< A >::GetExceptionHandler ( ) const
inline

Definition at line 759 of file berryMessage.h.

References berry::Message< A >::delegates.

◆ GetListeners()

template<typename A = void>
ListenerList berry::Message< A >::GetListeners ( ) const
inline

Definition at line 764 of file berryMessage.h.

References berry::Message< A >::delegates.

◆ HasListeners()

template<typename A = void>
bool berry::Message< A >::HasListeners ( ) const
inline

Definition at line 769 of file berryMessage.h.

References berry::Message< A >::delegates.

◆ IsEmpty()

template<typename A = void>
bool berry::Message< A >::IsEmpty ( ) const
inline

Definition at line 774 of file berryMessage.h.

References berry::Message< A >::delegates.

◆ operator()()

template<typename A = void>
void berry::Message< A >::operator() ( ) const
inline

Definition at line 749 of file berryMessage.h.

References berry::Message< A >::Send().

◆ operator+=()

template<typename A = void>
void berry::Message< A >::operator+= ( const AbstractDelegate delegate) const
inline

Definition at line 729 of file berryMessage.h.

References berry::Message< A >::AddListener().

◆ operator-=()

template<typename A = void>
void berry::Message< A >::operator-= ( const AbstractDelegate delegate) const
inline

Definition at line 739 of file berryMessage.h.

References berry::Message< A >::RemoveListener().

◆ RemoveListener()

template<typename A = void>
void berry::Message< A >::RemoveListener ( const AbstractDelegate delegate) const
inline

Definition at line 734 of file berryMessage.h.

References berry::Message< A >::delegates.

Referenced by berry::Message< A >::operator-=().

◆ Send()

template<typename A = void>
void berry::Message< A >::Send ( ) const
inline

Definition at line 744 of file berryMessage.h.

References berry::Message< A >::delegates.

Referenced by berry::Message< A >::operator()().

◆ SetExceptionHandler()

template<typename A = void>
void berry::Message< A >::SetExceptionHandler ( const AbstractExceptionHandler handler)
inline

Definition at line 754 of file berryMessage.h.

References berry::Message< A >::delegates.

Member Data Documentation

◆ delegates


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