Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
mitkMessage.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkMessage_h
14 #define mitkMessage_h
15 
16 #include <functional>
17 #include <mutex>
18 #include <vector>
19 
24 #define mitkNewMessageMacro(msgHandleObject) \
25 private: \
26  ::mitk::Message<> m_##msgHandleObject##Message; \
27  \
28 public: \
29  inline void Add##msgHandleObject##Listener(const ::mitk::MessageAbstractDelegate<> &delegate) \
30  { \
31  m_##msgHandleObject##Message += delegate; \
32  } \
33  inline void Remove##msgHandleObject##Listener(const ::mitk::MessageAbstractDelegate<> &delegate) \
34  { \
35  m_##msgHandleObject##Message -= delegate; \
36  }
37 
38 #define mitkNewMessageWithReturnMacro(msgHandleObject, returnType) \
39 private: \
40  ::mitk::Message<returnType> m_##msgHandleObject##Message; \
41  \
42 public: \
43  inline void Add##msgHandleObject##Listener(const ::mitk::MessageAbstractDelegate<returnType> &delegate) \
44  { \
45  m_##msgHandleObject##Message += delegate; \
46  } \
47  inline void Remove##msgHandleObject##Listener(const ::mitk::MessageAbstractDelegate<returnType> &delegate) \
48  { \
49  m_##msgHandleObject##Message -= delegate; \
50  }
51 
52 #define mitkNewMessage1Macro(msgHandleObject, type1) \
53 private: \
54  ::mitk::Message1<type1> m_##msgHandleObject##Message; \
55  \
56 public: \
57  void Add##msgHandleObject##Listener(const ::mitk::MessageAbstractDelegate1<type1> &delegate) \
58  { \
59  m_##msgHandleObject##Message += delegate; \
60  } \
61  void Remove##msgHandleObject##Listener(const ::mitk::MessageAbstractDelegate1<type1> &delegate) \
62  { \
63  m_##msgHandleObject##Message -= delegate; \
64  }
65 
66 #define mitkNewMessage2Macro(msgHandleObject, type1, type2) \
67 private: \
68  ::mitk::Message2<type1, type2> m_##msgHandleObject##Message; \
69  \
70 public: \
71  void Add##msgHandleObject##Listener(const ::mitk::MessageAbstractDelegate2<type1, type2> &delegate) \
72  { \
73  m_##msgHandleObject##Message += delegate; \
74  } \
75  void Remove##msgHandleObject##Listener(const ::mitk::MessageAbstractDelegate2<type1, type2> &delegate) \
76  { \
77  m_##msgHandleObject##Message -= delegate; \
78  }
79 
80 namespace mitk
81 {
82  template <typename A = void>
84  {
85  public:
87  virtual A Execute() const = 0;
88  virtual bool operator==(const MessageAbstractDelegate *cmd) const = 0;
89  virtual MessageAbstractDelegate *Clone() const = 0;
90  };
91 
92  template <typename T, typename A = void>
94  {
95  public:
97  virtual A Execute(T t) const = 0;
98  virtual bool operator==(const MessageAbstractDelegate1 *cmd) const = 0;
99  virtual MessageAbstractDelegate1 *Clone() const = 0;
100  };
101 
102  template <typename T, typename U, typename A = void>
104  {
105  public:
107  virtual A Execute(T t, U u) const = 0;
108  virtual bool operator==(const MessageAbstractDelegate2 *cmd) const = 0;
109  virtual MessageAbstractDelegate2 *Clone() const = 0;
110  };
111 
112  template <typename T, typename U, typename V, typename A = void>
114  {
115  public:
117  virtual A Execute(T t, U u, V v) const = 0;
118  virtual bool operator==(const MessageAbstractDelegate3 *cmd) const = 0;
119  virtual MessageAbstractDelegate3 *Clone() const = 0;
120  };
121 
122  template <typename T, typename U, typename V, typename W, typename A = void>
124  {
125  public:
127  virtual A Execute(T t, U u, V v, W w) const = 0;
128  virtual bool operator==(const MessageAbstractDelegate4 *cmd) const = 0;
129  virtual MessageAbstractDelegate4 *Clone() const = 0;
130  };
131 
140  template <class R, typename A = void>
142  {
143  public:
144  // constructor - takes pointer to an object and pointer to a member and stores
145  // them in two private variables
146  MessageDelegate(R *object, A (R::*memberFunctionPointer)())
147  : m_Object(object), m_MemberFunctionPointer(memberFunctionPointer)
148  {
149  }
150 
151  ~MessageDelegate() override {}
152  // override function "Call"
153  A Execute() const override
154  {
155  return (m_Object->*m_MemberFunctionPointer)(); // execute member function
156  }
157 
158  bool operator==(const MessageAbstractDelegate<A> *c) const override
159  {
160  const MessageDelegate<R, A> *cmd = dynamic_cast<const MessageDelegate<R, A> *>(c);
161  if (!cmd)
162  return false;
163 
164  if ((void *)this->m_Object != (void *)cmd->m_Object)
165  return false;
166  if (this->m_MemberFunctionPointer != cmd->m_MemberFunctionPointer)
167  return false;
168  return true;
169  }
170 
171  MessageAbstractDelegate<A> *Clone() const override { return new MessageDelegate(m_Object, m_MemberFunctionPointer); }
172  private:
173  R *m_Object; // pointer to object
174  A (R::*m_MemberFunctionPointer)(); // pointer to member function
175  };
176 
188  template <class R, typename T, typename A = void>
190  {
191  public:
192  // constructor - takes pointer to an object and pointer to a member and stores
193  // them in two private variables
194  MessageDelegate1(R *object, A (R::*memberFunctionPointer)(T))
195  : m_Object(object), m_MemberFunctionPointer(memberFunctionPointer)
196  {
197  }
198 
199  ~MessageDelegate1() override {}
200  // override function "Call"
201  A Execute(T t) const override
202  {
203  return (m_Object->*m_MemberFunctionPointer)(t); // execute member function
204  }
205 
206  bool operator==(const MessageAbstractDelegate1<T, A> *c) const override
207  {
208  const MessageDelegate1<R, T, A> *cmd = dynamic_cast<const MessageDelegate1<R, T, A> *>(c);
209  if (!cmd)
210  return false;
211 
212  if ((void *)this->m_Object != (void *)cmd->m_Object)
213  return false;
214  if (this->m_MemberFunctionPointer != cmd->m_MemberFunctionPointer)
215  return false;
216  return true;
217  }
218 
219  MessageAbstractDelegate1<T, A> *Clone() const override { return new MessageDelegate1(m_Object, m_MemberFunctionPointer); }
220  private:
221  R *m_Object; // pointer to object
222  A (R::*m_MemberFunctionPointer)(T); // pointer to member function
223  };
224 
225  template <class R, typename T, typename U, typename A = void>
227  {
228  public:
229  // constructor - takes pointer to an object and pointer to a member and stores
230  // them in two private variables
231  MessageDelegate2(R *object, A (R::*memberFunctionPointer)(T, U))
232  : m_Object(object), m_MemberFunctionPointer(memberFunctionPointer)
233  {
234  }
235 
236  ~MessageDelegate2() override {}
237  // override function "Call"
238  A Execute(T t, U u) const override
239  {
240  return (m_Object->*m_MemberFunctionPointer)(t, u); // execute member function
241  }
242 
243  bool operator==(const MessageAbstractDelegate2<T, U, A> *c) const override
244  {
245  const MessageDelegate2<R, T, U, A> *cmd = dynamic_cast<const MessageDelegate2<R, T, U, A> *>(c);
246  if (!cmd)
247  return false;
248 
249  if ((void *)this->m_Object != (void *)cmd->m_Object)
250  return false;
251  if (this->m_MemberFunctionPointer != cmd->m_MemberFunctionPointer)
252  return false;
253  return true;
254  }
255 
256  MessageAbstractDelegate2<T, U, A> *Clone() const override { return new MessageDelegate2(m_Object, m_MemberFunctionPointer); }
257  private:
258  R *m_Object; // pointer to object
259  A (R::*m_MemberFunctionPointer)(T, U); // pointer to member function
260  };
261 
262  template <class R, typename T, typename U, typename V, typename A = void>
263  class MessageDelegate3 : public MessageAbstractDelegate3<T, U, V, A>
264  {
265  public:
266  // constructor - takes pointer to an object and pointer to a member and stores
267  // them in two private variables
268  MessageDelegate3(R *object, A (R::*memberFunctionPointer)(T, U, V))
269  : m_Object(object), m_MemberFunctionPointer(memberFunctionPointer)
270  {
271  }
272 
273  ~MessageDelegate3() override {}
274  // override function "Call"
275  A Execute(T t, U u, V v) const override
276  {
277  return (m_Object->*m_MemberFunctionPointer)(t, u, v); // execute member function
278  }
279 
280  bool operator==(const MessageAbstractDelegate3<T, U, V, A> *c) const override
281  {
282  const MessageDelegate3<R, T, U, V, A> *cmd = dynamic_cast<const MessageDelegate3<R, T, U, V, A> *>(c);
283  if (!cmd)
284  return false;
285 
286  if ((void *)this->m_Object != (void *)cmd->m_Object)
287  return false;
288  if (this->m_MemberFunctionPointer != cmd->m_MemberFunctionPointer)
289  return false;
290  return true;
291  }
292 
294  {
295  return new MessageDelegate3(m_Object, m_MemberFunctionPointer);
296  }
297 
298  private:
299  R *m_Object; // pointer to object
300  A (R::*m_MemberFunctionPointer)(T, U, V); // pointer to member function
301  };
302 
303  template <class R, typename T, typename U, typename V, typename W, typename A = void>
304  class MessageDelegate4 : public MessageAbstractDelegate4<T, U, V, W, A>
305  {
306  public:
307  // constructor - takes pointer to an object and pointer to a member and stores
308  // them in two private variables
309  MessageDelegate4(R *object, A (R::*memberFunctionPointer)(T, U, V, W))
310  : m_Object(object), m_MemberFunctionPointer(memberFunctionPointer)
311  {
312  }
313 
314  virtual ~MessageDelegate4() {}
315  // override function "Call"
316  virtual A Execute(T t, U u, V v, W w) const
317  {
318  return (m_Object->*m_MemberFunctionPointer)(t, u, v, w); // execute member function
319  }
320 
322  {
323  const MessageDelegate4<R, T, U, V, W, A> *cmd = dynamic_cast<const MessageDelegate4<R, T, U, V, W, A> *>(c);
324  if (!cmd)
325  return false;
326 
327  if ((void *)this->m_Object != (void *)cmd->m_Object)
328  return false;
329  if (this->m_MemberFunctionPointer != cmd->m_MemberFunctionPointer)
330  return false;
331  return true;
332  }
333 
335  {
336  return new MessageDelegate4(m_Object, m_MemberFunctionPointer);
337  }
338 
339  private:
340  R *m_Object; // pointer to object
341  A (R::*m_MemberFunctionPointer)(T, U, V, W); // pointer to member function
342  };
343 
344  template <typename AbstractDelegate>
346  {
347  public:
348  typedef std::vector<AbstractDelegate *> ListenerList;
349 
350  virtual ~MessageBase()
351  {
352  for (auto iter = m_Listeners.begin(); iter != m_Listeners.end(); ++iter)
353  {
354  delete *iter;
355  }
356  }
357 
360  {
361  for (typename ListenerList::iterator iter = o.m_Listeners.begin(); iter != o.m_Listeners.end(); ++iter)
362  {
363  m_Listeners.push_back((*iter)->Clone());
364  }
365  }
366 
368  {
369  MessageBase tmp(o);
370  std::swap(tmp.m_Listeners, this->m_Listeners);
371  return *this;
372  }
373 
374  void AddListener(const AbstractDelegate &delegate) const
375  {
376  AbstractDelegate *msgCmd = delegate.Clone();
377 
378  m_Mutex.lock();
379  for (auto iter = m_Listeners.begin(); iter != m_Listeners.end(); ++iter)
380  {
381  if ((*iter)->operator==(msgCmd))
382  {
383  delete msgCmd;
384  m_Mutex.unlock();
385  return;
386  }
387  }
388  m_Listeners.push_back(msgCmd);
389  m_Mutex.unlock();
390  }
391 
392  void operator+=(const AbstractDelegate &delegate) const { this->AddListener(delegate); }
393  void RemoveListener(const AbstractDelegate &delegate) const
394  {
395  m_Mutex.lock();
396  for (auto iter = m_Listeners.begin(); iter != m_Listeners.end(); ++iter)
397  {
398  if ((*iter)->operator==(&delegate))
399  {
400  delete *iter;
401  m_Listeners.erase(iter);
402  m_Mutex.unlock();
403  return;
404  }
405  }
406  m_Mutex.unlock();
407  }
408 
409  void operator-=(const AbstractDelegate &delegate) const { this->RemoveListener(delegate); }
410  const ListenerList &GetListeners() const { return m_Listeners; }
411  bool HasListeners() const { return !m_Listeners.empty(); }
412  bool IsEmpty() const { return m_Listeners.empty(); }
413  protected:
424  mutable std::mutex m_Mutex;
425  };
426 
451  template <typename A = void>
452  class Message : public MessageBase<MessageAbstractDelegate<A>>
453  {
454  public:
457 
458  void Send() const
459  {
460  ListenerList listeners;
461 
462  {
463  this->m_Mutex.lock();
464  listeners.assign(this->m_Listeners.begin(), this->m_Listeners.end());
465  this->m_Mutex.unlock();
466  }
467 
468  for (auto iter = listeners.begin(); iter != listeners.end(); ++iter)
469  {
470  // notify each listener
471  (*iter)->Execute();
472  }
473  }
474 
475  void operator()() const { this->Send(); }
476  };
477 
478  // message with 1 parameter and return type
479  template <typename T, typename A = void>
480  class Message1 : public MessageBase<MessageAbstractDelegate1<T, A>>
481  {
482  public:
485 
486  void Send(T t) const
487  {
488  ListenerList listeners;
489 
490  {
491  this->m_Mutex.lock();
492  listeners.assign(this->m_Listeners.begin(), this->m_Listeners.end());
493  this->m_Mutex.unlock();
494  }
495 
496  for (auto iter = listeners.begin(); iter != listeners.end(); ++iter)
497  {
498  // notify each listener
499  (*iter)->Execute(t);
500  }
501  }
502 
503  void operator() (T t) const { this->Send(t); }
504  };
505 
506  // message with 2 parameters and return type
507  template <typename T, typename U, typename A = void>
508  class Message2 : public MessageBase<MessageAbstractDelegate2<T, U, A>>
509  {
510  public:
513 
514  void Send(T t, U u) const
515  {
516  ListenerList listeners;
517 
518  {
519  this->m_Mutex.lock();
520  listeners.assign(this->m_Listeners.begin(), this->m_Listeners.end());
521  this->m_Mutex.unlock();
522  }
523 
524  for (auto iter = listeners.begin(); iter != listeners.end(); ++iter)
525  {
526  // notify each listener
527  (*iter)->Execute(t, u);
528  }
529  }
530 
531  void operator()(T t, U u) const { this->Send(t, u); }
532  };
533 
534  // message with 3 parameters and return type
535  template <typename T, typename U, typename V, typename A = void>
536  class Message3 : public MessageBase<MessageAbstractDelegate3<T, U, V, A>>
537  {
538  public:
541 
542  void Send(T t, U u, V v) const
543  {
544  ListenerList listeners;
545 
546  {
547  this->m_Mutex.lock();
548  listeners.assign(this->m_Listeners.begin(), this->m_Listeners.end());
549  this->m_Mutex.unlock();
550  }
551 
552  for (typename ListenerList::iterator iter = listeners.begin(); iter != listeners.end(); ++iter)
553  {
554  // notify each listener
555  (*iter)->Execute(t, u, v);
556  }
557  }
558 
559  void operator()(T t, U u, V v) const { this->Send(t, u, v); }
560  };
561 
562  // message with 4 parameters and return type
563  template <typename T, typename U, typename V, typename W, typename A = void>
564  class Message4 : public MessageBase<MessageAbstractDelegate4<T, U, V, W>>
565  {
566  public:
569 
570  void Send(T t, U u, V v, W w) const
571  {
572  ListenerList listeners;
573 
574  {
575  this->m_Mutex.lock();
576  listeners.assign(this->m_Listeners.begin(), this->m_Listeners.end());
577  this->m_Mutex.unlock();
578  }
579 
580  for (typename ListenerList::iterator iter = listeners.begin(); iter != listeners.end(); ++iter)
581  {
582  // notify each listener
583  (*iter)->Execute(t, u, v, w);
584  }
585  }
586 
587  void operator()(T t, U u, V v, W w) const { this->Send(t, u, v, w); }
588  };
589 
590 /* Here is an example how to use the macros and templates:
591 *
592 * // An object to be sent around
593 * class Law
594 * {
595 * private:
596 * std::string m_Description;
597 *
598 * public:
599 *
600 * Law(const std::string law) : m_Description(law)
601 * { }
602 *
603 * std::string GetDescription() const
604 * {
605 * return m_Description;
606 * }
607 * };
608 *
609 * // The NewtonMachine will issue specific events
610 * class NewtonMachine
611 * {
612 * mitkNewMessageMacro(AnalysisStarted);
613 * mitkNewMessage1Macro(AnalysisStopped, bool);
614 * mitkNewMessage1Macro(LawDiscovered, const Law&);
615 *
616 * public:
617 *
618 * void StartAnalysis()
619 * {
620 * // send the "started" signal
621 * m_AnalysisStartedMessage();
622 *
623 * // we found a new law of nature by creating one :-)
624 * Law massLaw("F=ma");
625 * m_LawDiscoveredMessage(massLaw);
626 * }
627 *
628 * void StopAnalysis()
629 * {
630 * // send the "stop" message with false, indicating
631 * // that no error occurred
632 * m_AnalysisStoppedMessage(false);
633 * }
634 * };
635 *
636 * class Observer
637 * {
638 * private:
639 *
640 * NewtonMachine* m_Machine;
641 *
642 * public:
643 *
644 * Observer(NewtonMachine* machine) : m_Machine(machine)
645 * {
646 * // Add "observers", i.e. function pointers to the machine
647 * m_Machine->AddAnalysisStartedListener(
648 * ::mitk::MessageDelegate<Observer>(this, &Observer::MachineStarted));
649 * m_Machine->AddAnalysisStoppedListener(
650 * ::mitk::MessageDelegate1<Observer, bool>(this, &Observer::MachineStopped));
651 * m_Machine->AddLawDiscoveredListener(
652 * ::mitk::MessageDelegate1<Observer, const Law&>(this, &Observer::LawDiscovered));
653 * }
654 *
655 * ~Observer()
656 * {
657 * // Always remove your observers when finished
658 * m_Machine->RemoveAnalysisStartedListener(
659 * ::mitk::MessagDelegate<Observer>(this, &Observer::MachineStarted));
660 * m_Machine->RemoveAnalysisStoppedListener(
661 * ::mitk::MessageDelegate1<Observer, bool>(this, &Observer::MachineStopped));
662 * m_Machine->RemoveLawDiscoveredListener(
663 * ::mitk::MessageDelegate1<Observer, const Law&>(this, &Observer::LawDiscovered));
664 * }
665 *
666 * void MachineStarted()
667 * {
668 * std::cout << "Observed machine has started" << std::endl;
669 * }
670 *
671 * void MachineStopped(bool error)
672 * {
673 * std::cout << "Observed machine stopped " << (error ? "with an error" : "") << std::endl;
674 * }
675 *
676 * void LawDiscovered(const Law& law)
677 * {
678 * std::cout << "New law of nature discovered: " << law.GetDescription() << std::endl;
679 * }
680 * };
681 *
682 * NewtonMachine newtonMachine;
683 * Observer observer(&newtonMachine);
684 *
685 * // This will send two events to registered observers
686 * newtonMachine.StartAnalysis();
687 * // This will send one event to registered observers
688 * newtonMachine.StopAnalysis();
689 *
690 * Another example of how to use these message classes can be
691 * found in the directory Testing, file mitkMessageTest.cpp
692 *
693 */
694 
695 } // namespace
696 
697 #endif
mitk::MessageDelegate::Clone
MessageAbstractDelegate< A > * Clone() const override
Definition: mitkMessage.h:171
mitk::MessageDelegate4
Definition: mitkMessage.h:304
mitk::MessageDelegate3::Clone
MessageAbstractDelegate3< T, U, V, A > * Clone() const override
Definition: mitkMessage.h:293
mitk::MessageBase::operator=
MessageBase & operator=(const MessageBase &o)
Definition: mitkMessage.h:367
mitk::swap
void swap(CustomMimeType &l, CustomMimeType &r)
mitk::MessageBase
Definition: mitkMessage.h:345
mitk::MessageBase::m_Listeners
ListenerList m_Listeners
List of listeners.
Definition: mitkMessage.h:423
mitk::Message::ListenerList
Super::ListenerList ListenerList
Definition: mitkMessage.h:456
mitk::MessageAbstractDelegate1::Clone
virtual MessageAbstractDelegate1 * Clone() const =0
mitk::Message2::operator()
void operator()(T t, U u) const
Definition: mitkMessage.h:531
mitk::MessageBase::m_Mutex
std::mutex m_Mutex
Definition: mitkMessage.h:424
mitk::MessageAbstractDelegate::Execute
virtual A Execute() const =0
mitk::Message2::Send
void Send(T t, U u) const
Definition: mitkMessage.h:514
mitk::Message1
Definition: mitkMessage.h:480
mitk::Message3::ListenerList
Super::ListenerList ListenerList
Definition: mitkMessage.h:540
mitk::MessageAbstractDelegate3::Clone
virtual MessageAbstractDelegate3 * Clone() const =0
mitk::Message2::ListenerList
Super::ListenerList ListenerList
Definition: mitkMessage.h:512
mitk::Message4
Definition: mitkMessage.h:564
mitk::MessageDelegate4::Execute
virtual A Execute(T t, U u, V v, W w) const
Definition: mitkMessage.h:316
mitk::MessageBase::RemoveListener
void RemoveListener(const AbstractDelegate &delegate) const
Definition: mitkMessage.h:393
mitk::MessageAbstractDelegate3::~MessageAbstractDelegate3
virtual ~MessageAbstractDelegate3()
Definition: mitkMessage.h:116
mitk::MessageAbstractDelegate4::Execute
virtual A Execute(T t, U u, V v, W w) const =0
mitk::MessageDelegate3
Definition: mitkMessage.h:263
mitk::Message2::Super
MessageBase< MessageAbstractDelegate2< T, U, A > > Super
Definition: mitkMessage.h:511
mitk::MessageDelegate::operator==
bool operator==(const MessageAbstractDelegate< A > *c) const override
Definition: mitkMessage.h:158
mitk::MessageDelegate3::MessageDelegate3
MessageDelegate3(R *object, A(R::*memberFunctionPointer)(T, U, V))
Definition: mitkMessage.h:268
mitk::MessageAbstractDelegate1::operator==
virtual bool operator==(const MessageAbstractDelegate1 *cmd) const =0
mitk::MessageAbstractDelegate2::operator==
virtual bool operator==(const MessageAbstractDelegate2 *cmd) const =0
mitk::MessageDelegate1::MessageDelegate1
MessageDelegate1(R *object, A(R::*memberFunctionPointer)(T))
Definition: mitkMessage.h:194
mitk::MessageBase::operator+=
void operator+=(const AbstractDelegate &delegate) const
Definition: mitkMessage.h:392
mitk::Message4::Send
void Send(T t, U u, V v, W w) const
Definition: mitkMessage.h:570
mitk::MessageAbstractDelegate2::~MessageAbstractDelegate2
virtual ~MessageAbstractDelegate2()
Definition: mitkMessage.h:106
mitk::Message1::ListenerList
Super::ListenerList ListenerList
Definition: mitkMessage.h:484
mitk::Message::Super
MessageBase< MessageAbstractDelegate< A > > Super
Definition: mitkMessage.h:455
mitk::Message1::Send
void Send(T t) const
Definition: mitkMessage.h:486
mitk::MessageAbstractDelegate::~MessageAbstractDelegate
virtual ~MessageAbstractDelegate()
Definition: mitkMessage.h:86
mitk::MessageDelegate::Execute
A Execute() const override
Definition: mitkMessage.h:153
mitk::Message3::Send
void Send(T t, U u, V v) const
Definition: mitkMessage.h:542
mitk::Message4::operator()
void operator()(T t, U u, V v, W w) const
Definition: mitkMessage.h:587
mitk::MessageDelegate4::~MessageDelegate4
virtual ~MessageDelegate4()
Definition: mitkMessage.h:314
mitk::Message2
Definition: mitkMessage.h:508
mitk::MessageBase::AddListener
void AddListener(const AbstractDelegate &delegate) const
Definition: mitkMessage.h:374
mitk::MessageDelegate1::operator==
bool operator==(const MessageAbstractDelegate1< T, A > *c) const override
Definition: mitkMessage.h:206
mitk::MessageAbstractDelegate4::Clone
virtual MessageAbstractDelegate4 * Clone() const =0
mitk::MessageDelegate4::operator==
bool operator==(const MessageAbstractDelegate4< T, U, V, W, A > *c) const
Definition: mitkMessage.h:321
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::MessageAbstractDelegate4::operator==
virtual bool operator==(const MessageAbstractDelegate4 *cmd) const =0
mitk::MessageAbstractDelegate1::Execute
virtual A Execute(T t) const =0
mitk::MessageBase::IsEmpty
bool IsEmpty() const
Definition: mitkMessage.h:412
mitk::MessageAbstractDelegate1::~MessageAbstractDelegate1
virtual ~MessageAbstractDelegate1()
Definition: mitkMessage.h:96
mitk::Message3::Super
MessageBase< MessageAbstractDelegate3< T, U, V, A > > Super
Definition: mitkMessage.h:539
mitk::Message1::operator()
void operator()(T t) const
Definition: mitkMessage.h:503
mitk::MessageAbstractDelegate::Clone
virtual MessageAbstractDelegate * Clone() const =0
mitk::MessageDelegate2::MessageDelegate2
MessageDelegate2(R *object, A(R::*memberFunctionPointer)(T, U))
Definition: mitkMessage.h:231
mitk::MessageAbstractDelegate2::Clone
virtual MessageAbstractDelegate2 * Clone() const =0
mitk::MessageDelegate1::Clone
MessageAbstractDelegate1< T, A > * Clone() const override
Definition: mitkMessage.h:219
mitk::Message::Send
void Send() const
Definition: mitkMessage.h:458
mitk::MessageBase::~MessageBase
virtual ~MessageBase()
Definition: mitkMessage.h:350
mitk::MessageAbstractDelegate3::operator==
virtual bool operator==(const MessageAbstractDelegate3 *cmd) const =0
mitk::MessageAbstractDelegate3
Definition: mitkMessage.h:113
mitk::MessageAbstractDelegate4::~MessageAbstractDelegate4
virtual ~MessageAbstractDelegate4()
Definition: mitkMessage.h:126
mitk::MessageAbstractDelegate1
Definition: mitkMessage.h:93
mitk::MessageDelegate2::~MessageDelegate2
~MessageDelegate2() override
Definition: mitkMessage.h:236
mitk::MessageDelegate
Definition: mitkMessage.h:141
mitk::MessageDelegate3::operator==
bool operator==(const MessageAbstractDelegate3< T, U, V, A > *c) const override
Definition: mitkMessage.h:280
mitk::MessageDelegate2::Clone
MessageAbstractDelegate2< T, U, A > * Clone() const override
Definition: mitkMessage.h:256
mitk::MessageBase::HasListeners
bool HasListeners() const
Definition: mitkMessage.h:411
mitk::MessageBase::ListenerList
std::vector< AbstractDelegate * > ListenerList
Definition: mitkMessage.h:348
mitk::MessageAbstractDelegate2::Execute
virtual A Execute(T t, U u) const =0
mitk::MessageBase::MessageBase
MessageBase(const MessageBase &o)
Definition: mitkMessage.h:359
mitk::MessageDelegate2
Definition: mitkMessage.h:226
mitk::MessageDelegate3::~MessageDelegate3
~MessageDelegate3() override
Definition: mitkMessage.h:273
mitk::Message3::operator()
void operator()(T t, U u, V v) const
Definition: mitkMessage.h:559
mitk::MessageAbstractDelegate4
Definition: mitkMessage.h:123
mitk::MessageDelegate::~MessageDelegate
~MessageDelegate() override
Definition: mitkMessage.h:151
mitk::MessageAbstractDelegate3::Execute
virtual A Execute(T t, U u, V v) const =0
mitk::MessageAbstractDelegate2
Definition: mitkMessage.h:103
mitk::Message::operator()
void operator()() const
Definition: mitkMessage.h:475
mitk::MessageDelegate2::operator==
bool operator==(const MessageAbstractDelegate2< T, U, A > *c) const override
Definition: mitkMessage.h:243
mitk::Message4::Super
MessageBase< MessageAbstractDelegate4< T, U, V, W, A > > Super
Definition: mitkMessage.h:567
mitk::MessageBase::GetListeners
const ListenerList & GetListeners() const
Definition: mitkMessage.h:410
mitk::MessageDelegate1::Execute
A Execute(T t) const override
Definition: mitkMessage.h:201
mitk::Message4::ListenerList
Super::ListenerList ListenerList
Definition: mitkMessage.h:568
mitk::MessageDelegate2::Execute
A Execute(T t, U u) const override
Definition: mitkMessage.h:238
mitk::MessageAbstractDelegate::operator==
virtual bool operator==(const MessageAbstractDelegate *cmd) const =0
mitk::MessageDelegate3::Execute
A Execute(T t, U u, V v) const override
Definition: mitkMessage.h:275
mitk::MessageDelegate4::MessageDelegate4
MessageDelegate4(R *object, A(R::*memberFunctionPointer)(T, U, V, W))
Definition: mitkMessage.h:309
mitk::MessageAbstractDelegate
Definition: mitkMessage.h:83
mitk::MessageDelegate1
Definition: mitkMessage.h:189
mitk::MessageDelegate::MessageDelegate
MessageDelegate(R *object, A(R::*memberFunctionPointer)())
Definition: mitkMessage.h:146
mitk::MessageBase::operator-=
void operator-=(const AbstractDelegate &delegate) const
Definition: mitkMessage.h:409
mitk::MessageBase::MessageBase
MessageBase()
Definition: mitkMessage.h:358
mitk::Message3
Definition: mitkMessage.h:536
mitk::MessageDelegate4::Clone
MessageAbstractDelegate4< T, U, V, W, A > * Clone() const
Definition: mitkMessage.h:334
mitk::Message
Event/message/notification class.
Definition: mitkMessage.h:452
mitk::MessageDelegate1::~MessageDelegate1
~MessageDelegate1() override
Definition: mitkMessage.h:199
mitk::Message1::Super
MessageBase< MessageAbstractDelegate1< T, A > > Super
Definition: mitkMessage.h:483