Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
Event/message/notification class. More...
#include <mitkMessage.h>
Public Types | |
typedef MessageBase< MessageAbstractDelegate< A > > | Super |
typedef Super::ListenerList | ListenerList |
Public Types inherited from mitk::MessageBase< MessageAbstractDelegate< A > > | |
typedef std::vector< MessageAbstractDelegate< A > * > | ListenerList |
Public Member Functions | |
void | Send () |
void | operator() () |
Public Member Functions inherited from mitk::MessageBase< MessageAbstractDelegate< A > > | |
virtual | ~MessageBase () |
MessageBase () | |
MessageBase (const MessageBase &o) | |
MessageBase & | operator= (const MessageBase &o) |
void | AddListener (const MessageAbstractDelegate< A > &delegate) const |
void | operator+= (const MessageAbstractDelegate< A > &delegate) const |
void | RemoveListener (const MessageAbstractDelegate< A > &delegate) const |
void | operator-= (const MessageAbstractDelegate< A > &delegate) const |
const ListenerList & | GetListeners () const |
bool | HasListeners () const |
bool | IsEmpty () const |
Additional Inherited Members | |
Protected Attributes inherited from mitk::MessageBase< MessageAbstractDelegate< A > > | |
ListenerList | m_Listeners |
List of listeners. More... | |
itk::SimpleFastMutexLock | m_Mutex |
Event/message/notification class.
This totally ITK, Qt, VTK, whatever toolkit independent class allows one class to send out messages and another class to receive these message. This class is templated over the return type (A) of the callback functions. There are variations of this class (Message1, Message2, etc.) for sending one, two or more parameters along with the messages.
This is an implementation of the Observer pattern.
To conveniently add methods for registering/unregistering observers to Message variables of your class, you can use the mitkNewMessageMacro macros.
Here is an example how to use the macros and templates:
Another example of how to use these message classes can be found in the directory Testing, file mitkMessageTest.cpp
Definition at line 572 of file mitkMessage.h.
typedef Super::ListenerList mitk::Message< A >::ListenerList |
Definition at line 576 of file mitkMessage.h.
typedef MessageBase<MessageAbstractDelegate<A> > mitk::Message< A >::Super |
Definition at line 575 of file mitkMessage.h.
|
inline |
Definition at line 595 of file mitkMessage.h.
References mitk::Message< A >::Send().
|
inline |
Definition at line 578 of file mitkMessage.h.
References mitk::MessageBase< MessageAbstractDelegate< A > >::m_Listeners, and mitk::MessageBase< MessageAbstractDelegate< A > >::m_Mutex.
Referenced by mitk::Message< A >::operator()(), and mitk::SliceNavigationController::SendSlice().