Medical Imaging Interaction Toolkit  2018.4.99-87d68d9f
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.

◆ GetExceptionHandler()

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

Definition at line 759 of file berryMessage.h.

◆ GetListeners()

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

Definition at line 764 of file berryMessage.h.

◆ HasListeners()

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

Definition at line 769 of file berryMessage.h.

◆ IsEmpty()

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

Definition at line 774 of file berryMessage.h.

◆ operator()()

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

Definition at line 749 of file berryMessage.h.

◆ operator+=()

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

Definition at line 729 of file berryMessage.h.

◆ operator-=()

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

Definition at line 739 of file berryMessage.h.

◆ RemoveListener()

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

Definition at line 734 of file berryMessage.h.

◆ Send()

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

Definition at line 744 of file berryMessage.h.

Referenced by berry::Object::~Object().

◆ SetExceptionHandler()

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

Definition at line 754 of file berryMessage.h.

Member Data Documentation

◆ delegates

template<typename A = void>
DelegateList<AbstractDelegate> berry::Message< A >::delegates
protected

Definition at line 781 of file berryMessage.h.


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