Medical Imaging Interaction Toolkit  2018.4.99-65942676
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 345 of file mitkMessage.h.

Member Typedef Documentation

◆ ListenerList

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

Definition at line 348 of file mitkMessage.h.

Constructor & Destructor Documentation

◆ ~MessageBase()

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

Definition at line 350 of file mitkMessage.h.

◆ MessageBase() [1/2]

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

Definition at line 358 of file mitkMessage.h.

◆ MessageBase() [2/2]

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

Definition at line 359 of file mitkMessage.h.

Member Function Documentation

◆ AddListener()

template<typename AbstractDelegate>
void mitk::MessageBase< AbstractDelegate >::AddListener ( const AbstractDelegate &  delegate) const
inline

Definition at line 374 of file mitkMessage.h.

◆ GetListeners()

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

Definition at line 410 of file mitkMessage.h.

◆ HasListeners()

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

Definition at line 411 of file mitkMessage.h.

◆ IsEmpty()

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

Definition at line 412 of file mitkMessage.h.

◆ operator+=()

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

Definition at line 392 of file mitkMessage.h.

◆ operator-=()

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

Definition at line 409 of file mitkMessage.h.

◆ operator=()

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

Definition at line 367 of file mitkMessage.h.

◆ RemoveListener()

template<typename AbstractDelegate>
void mitk::MessageBase< AbstractDelegate >::RemoveListener ( const AbstractDelegate &  delegate) const
inline

Definition at line 393 of file mitkMessage.h.

Member Data Documentation

◆ m_Listeners

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 431 of file mitkMessage.h.

Referenced by mitk::MessageBase< MessageAbstractDelegate3< double, double, bool, void > >::MessageBase(), and mitk::MessageBase< MessageAbstractDelegate3< double, double, bool, void > >::operator=().

◆ m_Mutex

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

Definition at line 432 of file mitkMessage.h.


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