Medical Imaging Interaction Toolkit  2016.11.0
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 720 of file berryMessage.h.

Member Typedef Documentation

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

Definition at line 725 of file berryMessage.h.

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

Definition at line 726 of file berryMessage.h.

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

Definition at line 724 of file berryMessage.h.

Member Function Documentation

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

Definition at line 728 of file berryMessage.h.

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

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

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

Definition at line 763 of file berryMessage.h.

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

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

Definition at line 768 of file berryMessage.h.

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

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

Definition at line 773 of file berryMessage.h.

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

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

Definition at line 778 of file berryMessage.h.

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

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

Definition at line 753 of file berryMessage.h.

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

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

Definition at line 733 of file berryMessage.h.

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

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

Definition at line 743 of file berryMessage.h.

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

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

Definition at line 738 of file berryMessage.h.

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

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

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

Definition at line 758 of file berryMessage.h.

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

Member Data Documentation


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