Medical Imaging Interaction Toolkit
2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
|
Go to the documentation of this file.
24 #define mitkNewMessageMacro(msgHandleObject) \
26 ::mitk::Message<> m_##msgHandleObject##Message; \
29 inline void Add##msgHandleObject##Listener(const ::mitk::MessageAbstractDelegate<> &delegate) \
31 m_##msgHandleObject##Message += delegate; \
33 inline void Remove##msgHandleObject##Listener(const ::mitk::MessageAbstractDelegate<> &delegate) \
35 m_##msgHandleObject##Message -= delegate; \
38 #define mitkNewMessageWithReturnMacro(msgHandleObject, returnType) \
40 ::mitk::Message<returnType> m_##msgHandleObject##Message; \
43 inline void Add##msgHandleObject##Listener(const ::mitk::MessageAbstractDelegate<returnType> &delegate) \
45 m_##msgHandleObject##Message += delegate; \
47 inline void Remove##msgHandleObject##Listener(const ::mitk::MessageAbstractDelegate<returnType> &delegate) \
49 m_##msgHandleObject##Message -= delegate; \
52 #define mitkNewMessage1Macro(msgHandleObject, type1) \
54 ::mitk::Message1<type1> m_##msgHandleObject##Message; \
57 void Add##msgHandleObject##Listener(const ::mitk::MessageAbstractDelegate1<type1> &delegate) const \
59 m_##msgHandleObject##Message += delegate; \
61 void Remove##msgHandleObject##Listener(const ::mitk::MessageAbstractDelegate1<type1> &delegate) const \
63 m_##msgHandleObject##Message -= delegate; \
66 #define mitkNewMessage2Macro(msgHandleObject, type1, type2) \
68 ::mitk::Message2<type1, type2> m_##msgHandleObject##Message; \
71 void Add##msgHandleObject##Listener(const ::mitk::MessageAbstractDelegate2<type1, type2> &delegate) \
73 m_##msgHandleObject##Message += delegate; \
75 void Remove##msgHandleObject##Listener(const ::mitk::MessageAbstractDelegate2<type1, type2> &delegate) \
77 m_##msgHandleObject##Message -= delegate; \
82 template <
typename A =
void>
92 template <
typename T,
typename A =
void>
97 virtual A
Execute(T t)
const = 0;
102 template <
typename T,
typename U,
typename A =
void>
107 virtual A
Execute(T t, U u)
const = 0;
112 template <
typename T,
typename U,
typename V,
typename A =
void>
117 virtual A
Execute(T t, U u, V v)
const = 0;
122 template <
typename T,
typename U,
typename V,
typename W,
typename A =
void>
127 virtual A
Execute(T t, U u, V v, W w)
const = 0;
140 template <
class R,
typename A =
void>
147 : m_Object(object), m_MemberFunctionPointer(memberFunctionPointer)
155 return (m_Object->*m_MemberFunctionPointer)();
164 if ((
void *)this->m_Object != (
void *)cmd->m_Object)
166 if (this->m_MemberFunctionPointer != cmd->m_MemberFunctionPointer)
174 A (R::*m_MemberFunctionPointer)();
188 template <
class R,
typename T,
typename A =
void>
195 : m_Object(object), m_MemberFunctionPointer(memberFunctionPointer)
203 return (m_Object->*m_MemberFunctionPointer)(t);
212 if ((
void *)this->m_Object != (
void *)cmd->m_Object)
214 if (this->m_MemberFunctionPointer != cmd->m_MemberFunctionPointer)
222 A (R::*m_MemberFunctionPointer)(T);
225 template <
class R,
typename T,
typename U,
typename A =
void>
232 : m_Object(object), m_MemberFunctionPointer(memberFunctionPointer)
240 return (m_Object->*m_MemberFunctionPointer)(t, u);
249 if ((
void *)this->m_Object != (
void *)cmd->m_Object)
251 if (this->m_MemberFunctionPointer != cmd->m_MemberFunctionPointer)
259 A (R::*m_MemberFunctionPointer)(T, U);
262 template <
class R,
typename T,
typename U,
typename V,
typename A =
void>
269 : m_Object(object), m_MemberFunctionPointer(memberFunctionPointer)
277 return (m_Object->*m_MemberFunctionPointer)(t, u, v);
286 if ((
void *)this->m_Object != (
void *)cmd->m_Object)
288 if (this->m_MemberFunctionPointer != cmd->m_MemberFunctionPointer)
300 A (R::*m_MemberFunctionPointer)(T, U, V);
303 template <
class R,
typename T,
typename U,
typename V,
typename W,
typename A =
void>
310 : m_Object(object), m_MemberFunctionPointer(memberFunctionPointer)
318 return (m_Object->*m_MemberFunctionPointer)(t, u, v, w);
323 const MessageDelegate4<R, T, U, V, W, A> *cmd =
dynamic_cast<const MessageDelegate4<R, T, U, V, W, A> *
>(c);
327 if ((
void *)this->m_Object != (
void *)cmd->m_Object)
329 if (this->m_MemberFunctionPointer != cmd->m_MemberFunctionPointer)
341 A (R::*m_MemberFunctionPointer)(T, U, V, W);
344 template <
typename AbstractDelegate>
376 AbstractDelegate *msgCmd = delegate.Clone();
381 if ((*iter)->operator==(msgCmd))
398 if ((*iter)->operator==(&delegate))
451 template <
typename A =
void>
464 listeners.assign(this->
m_Listeners.begin(), this->m_Listeners.end());
468 for (
auto iter = listeners.begin(); iter != listeners.end(); ++iter)
479 template <
typename T,
typename A =
void>
492 listeners.assign(this->
m_Listeners.begin(), this->m_Listeners.end());
496 for (
auto iter = listeners.begin(); iter != listeners.end(); ++iter)
507 template <
typename T,
typename U,
typename A =
void>
520 listeners.assign(this->
m_Listeners.begin(), this->m_Listeners.end());
524 for (
auto iter = listeners.begin(); iter != listeners.end(); ++iter)
527 (*iter)->Execute(t, u);
535 template <
typename T,
typename U,
typename V,
typename A =
void>
548 listeners.assign(this->
m_Listeners.begin(), this->m_Listeners.end());
552 for (
typename ListenerList::iterator iter = listeners.begin(); iter != listeners.end(); ++iter)
555 (*iter)->Execute(t, u, v);
563 template <
typename T,
typename U,
typename V,
typename W,
typename A =
void>
570 void Send(T t, U u, V v, W w)
const
576 listeners.assign(this->
m_Listeners.begin(), this->m_Listeners.end());
580 for (
typename ListenerList::iterator iter = listeners.begin(); iter != listeners.end(); ++iter)
583 (*iter)->Execute(t, u, v, w);
MessageAbstractDelegate< A > * Clone() const override
MessageAbstractDelegate3< T, U, V, A > * Clone() const override
MessageBase & operator=(const MessageBase &o)
void swap(CustomMimeType &l, CustomMimeType &r)
ListenerList m_Listeners
List of listeners.
Super::ListenerList ListenerList
virtual MessageAbstractDelegate1 * Clone() const =0
void operator()(T t, U u) const
virtual A Execute() const =0
void Send(T t, U u) const
Super::ListenerList ListenerList
virtual MessageAbstractDelegate3 * Clone() const =0
Super::ListenerList ListenerList
virtual A Execute(T t, U u, V v, W w) const
void RemoveListener(const AbstractDelegate &delegate) const
virtual ~MessageAbstractDelegate3()
virtual A Execute(T t, U u, V v, W w) const =0
MessageBase< MessageAbstractDelegate2< T, U, A > > Super
bool operator==(const MessageAbstractDelegate< A > *c) const override
MessageDelegate3(R *object, A(R::*memberFunctionPointer)(T, U, V))
virtual bool operator==(const MessageAbstractDelegate1 *cmd) const =0
virtual bool operator==(const MessageAbstractDelegate2 *cmd) const =0
MessageDelegate1(R *object, A(R::*memberFunctionPointer)(T))
void operator+=(const AbstractDelegate &delegate) const
void Send(T t, U u, V v, W w) const
virtual ~MessageAbstractDelegate2()
Super::ListenerList ListenerList
MessageBase< MessageAbstractDelegate< A > > Super
virtual ~MessageAbstractDelegate()
A Execute() const override
void Send(T t, U u, V v) const
void operator()(T t, U u, V v, W w) const
virtual ~MessageDelegate4()
void AddListener(const AbstractDelegate &delegate) const
bool operator==(const MessageAbstractDelegate1< T, A > *c) const override
virtual MessageAbstractDelegate4 * Clone() const =0
bool operator==(const MessageAbstractDelegate4< T, U, V, W, A > *c) const
Find image slices visible on a given plane.
virtual bool operator==(const MessageAbstractDelegate4 *cmd) const =0
virtual A Execute(T t) const =0
virtual ~MessageAbstractDelegate1()
MessageBase< MessageAbstractDelegate3< T, U, V, A > > Super
void operator()(T t) const
virtual MessageAbstractDelegate * Clone() const =0
MessageDelegate2(R *object, A(R::*memberFunctionPointer)(T, U))
virtual MessageAbstractDelegate2 * Clone() const =0
MessageAbstractDelegate1< T, A > * Clone() const override
virtual bool operator==(const MessageAbstractDelegate3 *cmd) const =0
virtual ~MessageAbstractDelegate4()
~MessageDelegate2() override
bool operator==(const MessageAbstractDelegate3< T, U, V, A > *c) const override
MessageAbstractDelegate2< T, U, A > * Clone() const override
bool HasListeners() const
std::vector< AbstractDelegate * > ListenerList
virtual A Execute(T t, U u) const =0
MessageBase(const MessageBase &o)
~MessageDelegate3() override
void operator()(T t, U u, V v) const
~MessageDelegate() override
virtual A Execute(T t, U u, V v) const =0
bool operator==(const MessageAbstractDelegate2< T, U, A > *c) const override
MessageBase< MessageAbstractDelegate4< T, U, V, W, A > > Super
const ListenerList & GetListeners() const
A Execute(T t) const override
Super::ListenerList ListenerList
A Execute(T t, U u) const override
virtual bool operator==(const MessageAbstractDelegate *cmd) const =0
A Execute(T t, U u, V v) const override
MessageDelegate4(R *object, A(R::*memberFunctionPointer)(T, U, V, W))
MessageDelegate(R *object, A(R::*memberFunctionPointer)())
void operator-=(const AbstractDelegate &delegate) const
MessageAbstractDelegate4< T, U, V, W, A > * Clone() const
Event/message/notification class.
~MessageDelegate1() override
MessageBase< MessageAbstractDelegate1< T, A > > Super