Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::MessageBase< AbstractDelegate > Class Template Reference

#include <mitkMessage.h>

Inheritance diagram for mitk::MessageBase< AbstractDelegate >:
Collaboration diagram for mitk::MessageBase< AbstractDelegate >:

Public Types

typedef std::vector< AbstractDelegate * > ListenerList
 

Public Member Functions

virtual ~MessageBase ()
 
 MessageBase ()
 
 MessageBase (const MessageBase &o)
 
MessageBaseoperator= (const MessageBase &o)
 
void AddListener (const AbstractDelegate &delegate) const
 
void operator+= (const AbstractDelegate &delegate) const
 
void RemoveListener (const AbstractDelegate &delegate) const
 
void operator-= (const AbstractDelegate &delegate) const
 
const ListenerListGetListeners () const
 
bool HasListeners () const
 
bool IsEmpty () const
 

Protected Attributes

ListenerList m_Listeners
 List of listeners. More...
 
itk::SimpleFastMutexLock m_Mutex
 

Detailed Description

template<typename AbstractDelegate>
class mitk::MessageBase< AbstractDelegate >

Definition at line 349 of file mitkMessage.h.

Member Typedef Documentation

template<typename AbstractDelegate>
typedef std::vector<AbstractDelegate *> mitk::MessageBase< AbstractDelegate >::ListenerList

Definition at line 352 of file mitkMessage.h.

Constructor & Destructor Documentation

template<typename AbstractDelegate>
virtual mitk::MessageBase< AbstractDelegate >::~MessageBase ( )
inlinevirtual

Definition at line 354 of file mitkMessage.h.

template<typename AbstractDelegate>
mitk::MessageBase< AbstractDelegate >::MessageBase ( )
inline

Definition at line 362 of file mitkMessage.h.

template<typename AbstractDelegate>
mitk::MessageBase< AbstractDelegate >::MessageBase ( const MessageBase< AbstractDelegate > &  o)
inline

Definition at line 363 of file mitkMessage.h.

Member Function Documentation

template<typename AbstractDelegate>
const ListenerList& mitk::MessageBase< AbstractDelegate >::GetListeners ( ) const
inline

Definition at line 414 of file mitkMessage.h.

template<typename AbstractDelegate>
bool mitk::MessageBase< AbstractDelegate >::HasListeners ( ) const
inline

Definition at line 415 of file mitkMessage.h.

template<typename AbstractDelegate>
bool mitk::MessageBase< AbstractDelegate >::IsEmpty ( ) const
inline

Definition at line 416 of file mitkMessage.h.

template<typename AbstractDelegate>
void mitk::MessageBase< AbstractDelegate >::operator+= ( const AbstractDelegate &  delegate) const
inline

Definition at line 396 of file mitkMessage.h.

template<typename AbstractDelegate>
void mitk::MessageBase< AbstractDelegate >::operator-= ( const AbstractDelegate &  delegate) const
inline

Definition at line 413 of file mitkMessage.h.

template<typename AbstractDelegate>
MessageBase& mitk::MessageBase< AbstractDelegate >::operator= ( const MessageBase< AbstractDelegate > &  o)
inline

Definition at line 371 of file mitkMessage.h.

Member Data Documentation

template<typename AbstractDelegate>
ListenerList mitk::MessageBase< AbstractDelegate >::m_Listeners
mutableprotected

List of listeners.

This is declared mutable for a reason: Imagine an object that sends out notifications, e.g.

class Database {
public:
Message Modified;
};

Now imaginge someone gets a const Database object, because he/she should not write to the database. He/she should anyway be able to register for notifications about changes in the database – this is why AddListener and RemoveListener are declared const. m_Listeners must be mutable so that AddListener and RemoveListener can modify it regardless of the object's constness.

Definition at line 435 of file mitkMessage.h.

Referenced by mitk::MessageBase< MessageAbstractDelegate3< double, double, bool, void > >::AddListener(), mitk::MessageBase< MessageAbstractDelegate3< double, double, bool, void > >::GetListeners(), mitk::MessageBase< MessageAbstractDelegate3< double, double, bool, void > >::HasListeners(), mitk::MessageBase< MessageAbstractDelegate3< double, double, bool, void > >::IsEmpty(), mitk::MessageBase< MessageAbstractDelegate3< double, double, bool, void > >::MessageBase(), mitk::MessageBase< MessageAbstractDelegate3< double, double, bool, void > >::operator=(), mitk::MessageBase< MessageAbstractDelegate3< double, double, bool, void > >::RemoveListener(), and mitk::MessageBase< MessageAbstractDelegate3< double, double, bool, void > >::~MessageBase().

template<typename AbstractDelegate>
itk::SimpleFastMutexLock mitk::MessageBase< AbstractDelegate >::m_Mutex
mutableprotected

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