Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
berryMessage.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 BERRYMESSAGE_H_
14 #define BERRYMESSAGE_H_
15 
16 #include <vector>
17 #include <Poco/Mutex.h>
18 
23 #define berryNewMessageMacro(msgHandleObject) \
24  private: Message<> m_ ## msgHandleObject ## Message; \
25  public: \
26  inline void Add ## msgHandleObject ## Listener(const MessageAbstractDelegate<>& delegate) \
27  { m_ ## msgHandleObject ## Message += delegate; } \
28  inline void Remove ## msgHandleObject ## Listener(const MessageAbstractDelegate<>& delegate) \
29  { m_ ## msgHandleObject ## Message -= delegate; } \
30 
31 
32 #define berryNewMessageWithReturnMacro(msgHandleObject, returnType) \
33  private: Message<returnType> m_ ## msgHandleObject ## Message; \
34  public: \
35  inline void Add ## msgHandleObject ## Listener(const MessageAbstractDelegate<returnType>& delegate) \
36  { m_ ## msgHandleObject ## Message += delegate; } \
37  inline void Remove ## msgHandleObject ## Listener(const MessageAbstractDelegate<returnType>& delegate) \
38  { m_ ## msgHandleObject ## Message -= delegate; } \
39 
40 
41 #define berryNewMessage1Macro(msgHandleObject, type1) \
42  private: Message1< type1 > m_msgHandleObject ## Message; \
43  public: \
44  void Add ## msgHandleObject ## Listener(const MessageAbstractDelegate1< type1 >& delegate) \
45  { m_ ## msgHandleObject ## Message += delegate; } \
46  void Remove ## msgHandleObject ## Listener(const MessageAbstractDelegate1< type1 >& delegate) \
47  { m_ ## msgHandleObject ## Message -= delegate; } \
48 
49 
50 namespace berry
51 {
52 
53 template<typename A = void>
55 {
56 public:
57 
59  {
60  }
61 
62  virtual A Execute() = 0;
63  virtual bool operator==(const MessageAbstractDelegate* cmd) = 0;
64  virtual MessageAbstractDelegate* Clone() const = 0;
65 };
66 
67 template<typename T, typename A = void>
69 {
70 public:
71 
73  {
74  }
75 
76  virtual A Execute(T t) = 0;
77  virtual bool operator==(const MessageAbstractDelegate1* cmd) = 0;
78  virtual MessageAbstractDelegate1* Clone() const = 0;
79 };
80 
81 template<typename T, typename U, typename A = void>
83 {
84 public:
85 
87  {
88  }
89 
90  virtual A Execute(T t, U u) const = 0;
91  virtual bool operator==(const MessageAbstractDelegate2* cmd) = 0;
92  virtual MessageAbstractDelegate2* Clone() const = 0;
93 };
94 
95 template<typename T, typename U, typename V, typename A = void>
97 {
98 public:
99 
101  {
102  }
103 
104  virtual A Execute(T t, U u, V v) const = 0;
105  virtual bool operator==(const MessageAbstractDelegate3* cmd) = 0;
106  virtual MessageAbstractDelegate3* Clone() const = 0;
107 };
108 
109 template<typename T, typename U, typename V, typename W, typename A = void>
111 {
112 public:
113 
115  {
116  }
117 
118  virtual A Execute(T t, U u, V v, W w) const = 0;
119  virtual bool operator==(const MessageAbstractDelegate4* cmd) = 0;
120  virtual MessageAbstractDelegate4* Clone() const = 0;
121 };
122 
123 template<class R, typename A = void>
125 {
126 public:
127 
128  // constructor - takes pointer to an object and pointer to a member and stores
129  // them in two private variables
130  MessageDelegate(R* object, A(R::*memberFunctionPointer)()) :
131  m_Object(object), m_MemberFunctionPointer(memberFunctionPointer)
132  {
133  }
134 
135  ~MessageDelegate() override
136  {
137  }
138 
139  // override function "Call"
140  A Execute() override
141  {
142  return (m_Object->*m_MemberFunctionPointer)(); // execute member function
143  }
144 
145  bool operator==(const MessageAbstractDelegate<A>* c) override
146  {
147  const MessageDelegate<R, A>* cmd =
148  dynamic_cast<const MessageDelegate<R, A>*> (c);
149  if (!cmd)
150  return false;
151 
152  if ((void*) this->m_Object != (void*) cmd->m_Object)
153  return false;
154  if (this->m_MemberFunctionPointer != cmd->m_MemberFunctionPointer)
155  return false;
156  return true;
157  }
158 
160  {
161  return new MessageDelegate(m_Object, m_MemberFunctionPointer);
162  }
163 
164 private:
165  R* m_Object; // pointer to object
166  A (R::*m_MemberFunctionPointer)(); // pointer to member function
167 };
168 
169 template<class R, typename T, typename A = void>
171 {
172 public:
173 
174  // constructor - takes pointer to an object and pointer to a member and stores
175  // them in two private variables
176  MessageDelegate1(R* object, A(R::*memberFunctionPointer)(T)) :
177  m_Object(object), m_MemberFunctionPointer(memberFunctionPointer)
178  {
179  }
180 
181  ~MessageDelegate1() override
182  {
183  }
184 
185  // override function "Call"
186  A Execute(T t) override
187  {
188  return (m_Object->*m_MemberFunctionPointer)(t); // execute member function
189  }
190 
192  {
193  const MessageDelegate1<R, T, A>* cmd = dynamic_cast<const MessageDelegate1<
194  R, T, A>*> (c);
195  if (!cmd)
196  return false;
197 
198  if ((void*) this->m_Object != (void*) cmd->m_Object)
199  return false;
200  if (this->m_MemberFunctionPointer != cmd->m_MemberFunctionPointer)
201  return false;
202  return true;
203  }
204 
206  {
207  return new MessageDelegate1(m_Object, m_MemberFunctionPointer);
208  }
209 
210 private:
211  R* m_Object; // pointer to object
212  A (R::*m_MemberFunctionPointer)(T); // pointer to member function
213 };
214 
215 template<class R, typename T, typename U, typename A = void>
217 {
218 public:
219 
220  // constructor - takes pointer to an object and pointer to a member and stores
221  // them in two private variables
222  MessageDelegate2(R* object, A(R::*memberFunctionPointer)(T, U)) :
223  m_Object(object), m_MemberFunctionPointer(memberFunctionPointer)
224  {
225  }
226 
227  ~MessageDelegate2() override
228  {
229  }
230 
231  // override function "Call"
232  A Execute(T t, U u) const override
233  {
234  return (m_Object->*m_MemberFunctionPointer)(t, u); // execute member function
235  }
236 
238  {
239  const MessageDelegate2<R, T, U, A>* cmd =
240  dynamic_cast<const MessageDelegate2<R, T, U, A>*> (c);
241  if (!cmd)
242  return false;
243 
244  if ((void*) this->m_Object != (void*) cmd->m_Object)
245  return false;
246  if (this->m_MemberFunctionPointer != cmd->m_MemberFunctionPointer)
247  return false;
248  return true;
249  }
250 
252  {
253  return new MessageDelegate2(m_Object, m_MemberFunctionPointer);
254  }
255 
256 private:
257  R* m_Object; // pointer to object
258  A (R::*m_MemberFunctionPointer)(T, U); // pointer to member function
259 };
260 
261 template<class R, typename T, typename U, typename V, typename A = void>
263 {
264 public:
265 
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  {
275  }
276 
277  // override function "Call"
278  A Execute(T t, U u, V v) const override
279  {
280  return (m_Object->*m_MemberFunctionPointer)(t, u, v); // execute member function
281  }
282 
284  {
286  dynamic_cast<const MessageDelegate3<R, T, U, V, A>*> (c);
287  if (!cmd)
288  return false;
289 
290  if ((void*) this->m_Object != (void*) cmd->m_Object)
291  return false;
292  if (this->m_MemberFunctionPointer != cmd->m_MemberFunctionPointer)
293  return false;
294  return true;
295  }
296 
298  {
299  return new MessageDelegate3(m_Object, m_MemberFunctionPointer);
300  }
301 
302 private:
303  R* m_Object; // pointer to object
304  A (R::*m_MemberFunctionPointer)(T, U, V); // pointer to member function
305 };
306 
307 template<class R, typename T, typename U, typename V, typename W,
308  typename A = void>
309 class MessageDelegate4: public MessageAbstractDelegate4<T, U, V, W, A>
310 {
311 public:
312 
313  // constructor - takes pointer to an object and pointer to a member and stores
314  // them in two private variables
315  MessageDelegate4(R* object, A(R::*memberFunctionPointer)(T, U, V, W)) :
316  m_Object(object), m_MemberFunctionPointer(memberFunctionPointer)
317  {
318  }
319 
320  ~MessageDelegate4() override
321  {
322  }
323 
324  // override function "Call"
325  A Execute(T t, U u, V v, W w) const override
326  {
327  return (m_Object->*m_MemberFunctionPointer)(t, u, v, w); // execute member function
328  }
329 
331  {
333  dynamic_cast<const MessageDelegate4<R, T, U, V, W, A>*> (c);
334  if (!cmd)
335  return false;
336 
337  if ((void*) this->m_Object != (void*) cmd->m_Object)
338  return false;
339  if (this->m_MemberFunctionPointer != cmd->m_MemberFunctionPointer)
340  return false;
341  return true;
342  }
343 
345  {
346  return new MessageDelegate4(m_Object, m_MemberFunctionPointer);
347  }
348 
349 private:
350  R* m_Object; // pointer to object
351  A (R::*m_MemberFunctionPointer)(T, U, V, W); // pointer to member function
352 };
353 
355 {
356  virtual void HandleException(const std::exception& exc) = 0;
357  virtual AbstractExceptionHandler* Clone() const = 0;
358 
360  {
361  }
362 };
363 
364 template<typename R>
366 {
367  typedef void (R::*HandleExceptionCallback)(const std::exception&);
368 
370  m_Object(r), m_ExceptionCallback(c)
371  {
372  }
373 
374  void HandleException(const std::exception& exc) override
375  {
376  (m_Object->*m_ExceptionCallback)(exc);
377  }
378 
379  AbstractExceptionHandler* Clone() const override
380  {
381  if (!m_Object) return nullptr;
382  return new MessageExceptionHandler(m_Object, m_ExceptionCallback);
383  }
384 
385 private:
386 
387  R* m_Object;
388  HandleExceptionCallback m_ExceptionCallback;
389 };
390 
391 template<typename D>
393 {
394 
395 public:
396 
397  typedef D Delegate;
398  typedef std::vector<Delegate*> ListType;
399 
401  m_ExcHandler(nullptr)
402  {
403 
404  }
405 
407  {
408  for (auto iter = m_Delegates.begin(); iter
409  != m_Delegates.end(); ++iter)
410  {
411  delete *iter;
412  }
413 
414  delete m_ExcHandler;
415  }
416 
417  void Add(const Delegate& d) const
418  {
419  Delegate* copy = d.Clone();
420 
421  Poco::FastMutex::ScopedLock lock(m_Mutex);
422  for (auto iter = m_Delegates.begin(); iter
423  != m_Delegates.end(); ++iter)
424  {
425  if ((*iter)->operator==(copy))
426  {
427  delete copy;
428  return;
429  }
430  }
431  m_Delegates.push_back(copy);
432  }
433 
434  void Remove(const Delegate& d) const
435  {
436  Poco::FastMutex::ScopedLock lock(m_Mutex);
437  for (auto iter = m_Delegates.begin(); iter
438  != m_Delegates.end(); ++iter)
439  {
440  if ((*iter)->operator==(&d))
441  {
442  delete *iter;
443  m_Delegates.erase(iter);
444  return;
445  }
446  }
447  }
448 
449  bool IsEmpty() const
450  {
451  return m_Delegates.empty();
452  }
453 
454  template<typename Dummy>
455  void Send0(Dummy) const
456  {
457  ListType delegates;
458 
459  {
460  Poco::FastMutex::ScopedLock lock(m_Mutex);
461  delegates.assign(m_Delegates.begin(), m_Delegates.end());
462  }
463 
464  for (auto iter = delegates.begin(); iter
465  != delegates.end(); ++iter)
466  {
467  try
468  {
469  // notify each listener
470  (*iter)->Execute();
471  }
472  catch (const std::exception& e)
473  {
474  if (m_ExcHandler)
475  {
476  m_ExcHandler->HandleException(e);
477  }
478  else
479  {
480  throw e;
481  }
482  }
483  catch (...)
484  {
485  if (m_ExcHandler)
486  {
487  m_ExcHandler->HandleException(std::exception());
488  }
489  else
490  throw ;
491  }
492  }
493  }
494 
495  template<typename T>
496  void Send1(T t) const
497  {
498  ListType delegates;
499 
500  {
501  Poco::FastMutex::ScopedLock lock(m_Mutex);
502  delegates.assign(m_Delegates.begin(), m_Delegates.end());
503  }
504 
505  for (auto iter = delegates.begin(); iter
506  != delegates.end(); ++iter)
507  {
508  try
509  {
510  // notify each listener
511  (*iter)->Execute(t);
512  }
513  catch (const std::exception& e)
514  {
515  if (m_ExcHandler)
516  {
517  m_ExcHandler->HandleException(e);
518  }
519  else
520  {
521  throw e;
522  }
523  }
524  catch (...)
525  {
526  if (m_ExcHandler)
527  {
528  m_ExcHandler->HandleException(std::exception());
529  }
530  else throw;
531  }
532  }
533  }
534 
535  template<typename T, typename U>
536  void Send2(T t, U u) const
537  {
538  ListType delegates;
539 
540  {
541  Poco::FastMutex::ScopedLock lock(m_Mutex);
542  delegates.assign(m_Delegates.begin(), m_Delegates.end());
543  }
544 
545  for (auto iter = delegates.begin(); iter
546  != delegates.end(); ++iter)
547  {
548  try
549  {
550  // notify each listener
551  (*iter)->Execute(t, u);
552  }
553  catch (const std::exception& e)
554  {
555  if (m_ExcHandler)
556  {
557  m_ExcHandler->HandleException(e);
558  }
559  else
560  {
561  throw e;
562  }
563  }
564  catch (...)
565  {
566  if (m_ExcHandler)
567  {
568  m_ExcHandler->HandleException(std::exception());
569  }
570  else throw;
571  }
572  }
573  }
574 
575  template<typename T, typename U, typename V>
576  void Send3(T t, U u, V v) const
577  {
578  ListType delegates;
579 
580  {
581  Poco::FastMutex::ScopedLock lock(m_Mutex);
582  delegates.assign(m_Delegates.begin(), m_Delegates.end());
583  }
584 
585  for (auto iter = delegates.begin(); iter
586  != delegates.end(); ++iter)
587  {
588  try
589  {
590  // notify each listener
591  (*iter)->Execute(t, u, v);
592  }
593  catch (const std::exception& e)
594  {
595  if (m_ExcHandler)
596  {
597  m_ExcHandler->HandleException(e);
598  }
599  else
600  {
601  throw e;
602  }
603  }
604  catch (...)
605  {
606  if (m_ExcHandler)
607  {
608  m_ExcHandler->HandleException(std::exception());
609  }
610  else throw;
611  }
612  }
613  }
614 
615  template<typename T, typename U, typename V, typename W>
616  void Send4(T t, U u, V v, W w) const
617  {
618  ListType delegates;
619 
620  {
621  Poco::FastMutex::ScopedLock lock(m_Mutex);
622  delegates.assign(m_Delegates.begin(), m_Delegates.end());
623  }
624 
625  for (auto iter = delegates.begin(); iter
626  != delegates.end(); ++iter)
627  {
628  try
629  {
630  // notify each listener
631  (*iter)->Execute(t, u, v, w);
632  }
633  catch (const std::exception& e)
634  {
635  if (m_ExcHandler)
636  {
637  m_ExcHandler->HandleException(e);
638  }
639  else
640  {
641  throw e;
642  }
643  }
644  catch (...)
645  {
646  if (m_ExcHandler)
647  {
648  m_ExcHandler->HandleException(std::exception());
649  }
650  else throw;
651  }
652  }
653  }
654 
656  {
657  Poco::FastMutex::ScopedLock lock(m_Mutex);
658  delete m_ExcHandler;
659  m_ExcHandler = handler.Clone();
660  }
661 
663  {
664  Poco::FastMutex::ScopedLock lock(m_Mutex);
665  if (m_ExcHandler) return m_ExcHandler->Clone();
666  return nullptr;
667  }
668 
670  {
671  Poco::FastMutex::ScopedLock lock(m_Mutex);
672  return m_Delegates;
673  }
674 
675  private:
676 
694  mutable std::vector<Delegate*> m_Delegates;
695 
696  mutable AbstractExceptionHandler* m_ExcHandler;
697  mutable Poco::FastMutex m_Mutex;
698  };
699 
714  // message without parameters (pure signals)
715  template<typename A = void>
716  class Message
717  {
718  public:
719 
720  typedef Message Self;
723 
724  void AddListener(const AbstractDelegate& delegate) const
725  {
726  delegates.Add(delegate);
727  }
728 
729  void operator +=(const AbstractDelegate& delegate) const
730  {
731  this->AddListener(delegate);
732  }
733 
734  void RemoveListener(const AbstractDelegate& delegate) const
735  {
736  delegates.Remove(delegate);
737  }
738 
739  void operator -=(const AbstractDelegate& delegate) const
740  {
741  this->RemoveListener(delegate);
742  }
743 
744  void Send() const
745  {
746  delegates.Send0(0);
747  }
748 
749  void operator()() const
750  {
751  this->Send();
752  }
753 
755  {
756  delegates.SetExceptionHandler(handler);
757  }
758 
760  {
761  return delegates.GetExceptionHandler();
762  }
763 
765  {
766  return delegates.GetDelegates();
767  }
768 
769  bool HasListeners() const
770  {
771  return !delegates.IsEmpty();
772  }
773 
774  bool IsEmpty() const
775  {
776  return delegates.IsEmpty();
777  }
778 
779  protected:
780 
782 
783  };
784 
785  // message with 1 parameter and return type
786  template<typename T, typename A = void>
787  class Message1
788  {
789  public:
790 
791  typedef Message1 Self;
794 
795  void AddListener(const AbstractDelegate& delegate) const
796  {
797  delegates.Add(delegate);
798  }
799 
800  void operator +=(const AbstractDelegate& delegate) const
801  {
802  this->AddListener(delegate);
803  }
804 
805  void RemoveListener(const AbstractDelegate& delegate) const
806  {
807  delegates.Remove(delegate);
808  }
809 
810  void operator -=(const AbstractDelegate& delegate) const
811  {
812  this->RemoveListener(delegate);
813  }
814 
815  void Send(T t) const
816  {
817  delegates.Send1(t);
818  }
819 
820  void operator()(T t) const
821  {
822  this->Send(t);
823  }
824 
826  {
827  delegates.SetExceptionHandler(handler);
828  }
829 
831  {
832  return delegates.GetExceptionHandler();
833  }
834 
836  {
837  return delegates.GetDelegates();
838  }
839 
840  bool HasListeners() const
841  {
842  return !delegates.IsEmpty();
843  }
844 
845  bool IsEmpty() const
846  {
847  return delegates.IsEmpty();
848  }
849 
850  protected:
851 
853 
854  };
855 
856  // message with 2 parameters and return type
857  template<typename T, typename U, typename A = void>
858  class Message2
859  {
860  public:
861 
862  typedef Message2 Self;
865 
866  void AddListener(const AbstractDelegate& delegate) const
867  {
868  delegates.Add(delegate);
869  }
870 
871  void operator +=(const AbstractDelegate& delegate) const
872  {
873  this->AddListener(delegate);
874  }
875 
876  void RemoveListener(const AbstractDelegate& delegate) const
877  {
878  delegates.Remove(delegate);
879  }
880 
881  void operator -=(const AbstractDelegate& delegate) const
882  {
883  this->RemoveListener(delegate);
884  }
885 
886  void Send(T t, U u) const
887  {
888  delegates.Send2(t, u);
889  }
890 
891  void operator()(T t, U u) const
892  {
893  this->Send(t, u);
894  }
895 
897  {
898  delegates.SetExceptionHandler(handler);
899  }
900 
902  {
903  return delegates.GetExceptionHandler();
904  }
905 
907  {
908  return delegates.GetDelegates();
909  }
910 
911  bool HasListeners() const
912  {
913  return !delegates.IsEmpty();
914  }
915 
916  bool IsEmpty() const
917  {
918  return delegates.IsEmpty();
919  }
920 
921  protected:
922 
924 
925  };
926 
927  // message with 3 parameters and return type
928  template<typename T, typename U, typename V, typename A = void>
929  class Message3
930  {
931  public:
932 
933  typedef Message3 Self;
936 
937  void AddListener(const AbstractDelegate& delegate) const
938  {
939  delegates.Add(delegate);
940  }
941 
942  void operator +=(const AbstractDelegate& delegate) const
943  {
944  this->AddListener(delegate);
945  }
946 
947  void RemoveListener(const AbstractDelegate& delegate) const
948  {
949  delegates.Remove(delegate);
950  }
951 
952  void operator -=(const AbstractDelegate& delegate) const
953  {
954  this->RemoveListener(delegate);
955  }
956 
957  void Send(T t, U u, V v) const
958  {
959  delegates.Send3(t, u, v);
960  }
961 
962  void operator()(T t, U u, V v) const
963  {
964  this->Send(t, u, v);
965  }
966 
968  {
969  delegates.SetExceptionHandler(handler);
970  }
971 
973  {
974  return delegates.GetExceptionHandler();
975  }
976 
978  {
979  return delegates.GetDelegates();
980  }
981 
982  bool HasListeners() const
983  {
984  return !delegates.IsEmpty();
985  }
986 
987  bool IsEmpty() const
988  {
989  return delegates.IsEmpty();
990  }
991 
992  protected:
993 
995 
996  };
997 
998  // message with 4 parameters and return type
999  template<typename T, typename U, typename V, typename W, typename A = void>
1000  class Message4
1001  {
1002  public:
1003 
1004  typedef Message4 Self;
1007 
1008  void AddListener(const AbstractDelegate& delegate) const
1009  {
1010  delegates.Add(delegate);
1011  }
1012 
1013  void operator +=(const AbstractDelegate& delegate) const
1014  {
1015  this->AddListener(delegate);
1016  }
1017 
1018  void RemoveListener(const AbstractDelegate& delegate) const
1019  {
1020  delegates.Remove(delegate);
1021  }
1022 
1023  void operator -=(const AbstractDelegate& delegate) const
1024  {
1025  this->RemoveListener(delegate);
1026  }
1027 
1028  void Send(T t, U u, V v, W w) const
1029  {
1030  delegates.Send4(t, u, v, w);
1031  }
1032 
1033  void operator()(T t, U u, V v, W w) const
1034  {
1035  this->Send(t, u , v, w);
1036  }
1037 
1039  {
1040  delegates.SetExceptionHandler(handler);
1041  }
1042 
1044  {
1045  return delegates.GetExceptionHandler();
1046  }
1047 
1049  {
1050  return delegates.GetDelegates();
1051  }
1052 
1053  bool HasListeners() const
1054  {
1055  return !delegates.IsEmpty();
1056  }
1057 
1058  bool IsEmpty() const
1059  {
1060  return delegates.IsEmpty();
1061  }
1062 
1063  protected:
1064 
1066 
1067  };
1068 
1069 } // namespace berry
1070 
1071 #endif /*BERRYMESSAGE_H_*/
berry::DelegateList::Remove
void Remove(const Delegate &d) const
Definition: berryMessage.h:434
berry::MessageDelegate3::MessageDelegate3
MessageDelegate3(R *object, A(R::*memberFunctionPointer)(T, U, V))
Definition: berryMessage.h:268
berry::MessageExceptionHandler
Definition: berryMessage.h:365
berry::Message2::GetListeners
ListenerList GetListeners() const
Definition: berryMessage.h:906
berry::Message3::ListenerList
DelegateList< AbstractDelegate >::ListType ListenerList
Definition: berryMessage.h:935
berry::MessageAbstractDelegate1
Definition: berryMessage.h:68
berry::MessageDelegate1::Clone
MessageAbstractDelegate1< T, A > * Clone() const override
Definition: berryMessage.h:205
berry::MessageAbstractDelegate3
Definition: berryMessage.h:96
berry::Message::GetExceptionHandler
AbstractExceptionHandler * GetExceptionHandler() const
Definition: berryMessage.h:759
berry::Message::operator()
void operator()() const
Definition: berryMessage.h:749
berry::Message1::GetListeners
ListenerList GetListeners() const
Definition: berryMessage.h:835
berry::Message::SetExceptionHandler
void SetExceptionHandler(const AbstractExceptionHandler &handler)
Definition: berryMessage.h:754
berry::MessageExceptionHandler::HandleExceptionCallback
void(R::* HandleExceptionCallback)(const std::exception &)
Definition: berryMessage.h:367
berry::DelegateList::ListType
std::vector< Delegate * > ListType
Definition: berryMessage.h:398
berry::Message1::SetExceptionHandler
void SetExceptionHandler(const AbstractExceptionHandler &handler)
Definition: berryMessage.h:825
berry::DelegateList::GetExceptionHandler
AbstractExceptionHandler * GetExceptionHandler() const
Definition: berryMessage.h:662
berry::MessageDelegate4::MessageDelegate4
MessageDelegate4(R *object, A(R::*memberFunctionPointer)(T, U, V, W))
Definition: berryMessage.h:315
berry::MessageAbstractDelegate2::operator==
virtual bool operator==(const MessageAbstractDelegate2 *cmd)=0
berry::Message1::operator+=
void operator+=(const AbstractDelegate &delegate) const
Definition: berryMessage.h:800
berry::MessageAbstractDelegate1::~MessageAbstractDelegate1
virtual ~MessageAbstractDelegate1()
Definition: berryMessage.h:72
berry::Message::AbstractDelegate
MessageAbstractDelegate< A > AbstractDelegate
Definition: berryMessage.h:721
berry::MessageAbstractDelegate::operator==
virtual bool operator==(const MessageAbstractDelegate *cmd)=0
berry::AbstractExceptionHandler::~AbstractExceptionHandler
virtual ~AbstractExceptionHandler()
Definition: berryMessage.h:359
berry::MessageDelegate4::Clone
MessageAbstractDelegate4< T, U, V, W, A > * Clone() const override
Definition: berryMessage.h:344
berry::MessageExceptionHandler::MessageExceptionHandler
MessageExceptionHandler(R *r, HandleExceptionCallback c)
Definition: berryMessage.h:369
berry::DelegateList::Delegate
D Delegate
Definition: berryMessage.h:397
berry::Message1::Self
Message1 Self
Definition: berryMessage.h:791
berry::Message::Send
void Send() const
Definition: berryMessage.h:744
berry::Message3::operator-=
void operator-=(const AbstractDelegate &delegate) const
Definition: berryMessage.h:952
berry::Message4::operator()
void operator()(T t, U u, V v, W w) const
Definition: berryMessage.h:1033
berry::Message3::AbstractDelegate
MessageAbstractDelegate3< T, U, V, A > AbstractDelegate
Definition: berryMessage.h:934
berry::MessageDelegate3::operator==
bool operator==(const MessageAbstractDelegate3< T, U, V, A > *c) override
Definition: berryMessage.h:283
berry::Message3::GetExceptionHandler
AbstractExceptionHandler * GetExceptionHandler() const
Definition: berryMessage.h:972
berry::Message::operator+=
void operator+=(const AbstractDelegate &delegate) const
Definition: berryMessage.h:729
berry::MessageAbstractDelegate1::Execute
virtual A Execute(T t)=0
berry::MessageDelegate4
Definition: berryMessage.h:309
berry::Message1::GetExceptionHandler
AbstractExceptionHandler * GetExceptionHandler() const
Definition: berryMessage.h:830
berry::Message2::IsEmpty
bool IsEmpty() const
Definition: berryMessage.h:916
berry::Message2::delegates
DelegateList< AbstractDelegate > delegates
Definition: berryMessage.h:923
berry::Message2::RemoveListener
void RemoveListener(const AbstractDelegate &delegate) const
Definition: berryMessage.h:876
berry::MessageAbstractDelegate4::~MessageAbstractDelegate4
virtual ~MessageAbstractDelegate4()
Definition: berryMessage.h:114
berry::DelegateList::IsEmpty
bool IsEmpty() const
Definition: berryMessage.h:449
berry::MessageAbstractDelegate
Definition: berryMessage.h:54
berry::MessageDelegate4::Execute
A Execute(T t, U u, V v, W w) const override
Definition: berryMessage.h:325
berry::MessageDelegate::operator==
bool operator==(const MessageAbstractDelegate< A > *c) override
Definition: berryMessage.h:145
berry::Message::delegates
DelegateList< AbstractDelegate > delegates
Definition: berryMessage.h:781
berry::Message3::AddListener
void AddListener(const AbstractDelegate &delegate) const
Definition: berryMessage.h:937
berry::Message1::delegates
DelegateList< AbstractDelegate > delegates
Definition: berryMessage.h:852
berry::MessageAbstractDelegate3::~MessageAbstractDelegate3
virtual ~MessageAbstractDelegate3()
Definition: berryMessage.h:100
berry::Message3::operator()
void operator()(T t, U u, V v) const
Definition: berryMessage.h:962
berry::AbstractExceptionHandler
Definition: berryMessage.h:354
berry::MessageAbstractDelegate::Execute
virtual A Execute()=0
berry::Message
Event/message/notification class.
Definition: berryMessage.h:716
berry::MessageDelegate4::operator==
bool operator==(const MessageAbstractDelegate4< T, U, V, W, A > *c) override
Definition: berryMessage.h:330
berry::Message4::SetExceptionHandler
void SetExceptionHandler(const AbstractExceptionHandler &handler)
Definition: berryMessage.h:1038
berry::DelegateList::DelegateList
DelegateList()
Definition: berryMessage.h:400
berry::Message1
Definition: berryMessage.h:787
berry::MessageDelegate1::MessageDelegate1
MessageDelegate1(R *object, A(R::*memberFunctionPointer)(T))
Definition: berryMessage.h:176
berry::MessageDelegate1::Execute
A Execute(T t) override
Definition: berryMessage.h:186
berry::Message3
Definition: berryMessage.h:929
berry::Message1::RemoveListener
void RemoveListener(const AbstractDelegate &delegate) const
Definition: berryMessage.h:805
berry::Message::operator-=
void operator-=(const AbstractDelegate &delegate) const
Definition: berryMessage.h:739
berry::Message2::operator-=
void operator-=(const AbstractDelegate &delegate) const
Definition: berryMessage.h:881
berry::Message2::Self
Message2 Self
Definition: berryMessage.h:862
berry::MessageDelegate::Execute
A Execute() override
Definition: berryMessage.h:140
berry::Message4::Send
void Send(T t, U u, V v, W w) const
Definition: berryMessage.h:1028
berry::Message2::ListenerList
DelegateList< AbstractDelegate >::ListType ListenerList
Definition: berryMessage.h:864
berry::MessageAbstractDelegate3::Execute
virtual A Execute(T t, U u, V v) const =0
berry::Message::HasListeners
bool HasListeners() const
Definition: berryMessage.h:769
berry::Message3::IsEmpty
bool IsEmpty() const
Definition: berryMessage.h:987
berry::MessageDelegate
Definition: berryMessage.h:124
berry::MessageDelegate3::~MessageDelegate3
~MessageDelegate3() override
Definition: berryMessage.h:273
berry::MessageDelegate1
Definition: berryMessage.h:170
berry::Message2::SetExceptionHandler
void SetExceptionHandler(const AbstractExceptionHandler &handler)
Definition: berryMessage.h:896
berry::MessageAbstractDelegate4::operator==
virtual bool operator==(const MessageAbstractDelegate4 *cmd)=0
berry::MessageExceptionHandler::Clone
AbstractExceptionHandler * Clone() const override
Definition: berryMessage.h:379
berry::Message3::SetExceptionHandler
void SetExceptionHandler(const AbstractExceptionHandler &handler)
Definition: berryMessage.h:967
berry::DelegateList::SetExceptionHandler
void SetExceptionHandler(const AbstractExceptionHandler &handler)
Definition: berryMessage.h:655
berry::MessageDelegate1::operator==
bool operator==(const MessageAbstractDelegate1< T, A > *c) override
Definition: berryMessage.h:191
berry::Message2::AbstractDelegate
MessageAbstractDelegate2< T, U, A > AbstractDelegate
Definition: berryMessage.h:863
berry::MessageDelegate3::Clone
MessageAbstractDelegate3< T, U, V, A > * Clone() const override
Definition: berryMessage.h:297
berry::DelegateList::~DelegateList
~DelegateList()
Definition: berryMessage.h:406
berry::Message1::operator-=
void operator-=(const AbstractDelegate &delegate) const
Definition: berryMessage.h:810
berry::MessageAbstractDelegate2::Clone
virtual MessageAbstractDelegate2 * Clone() const =0
berry::Message2
Definition: berryMessage.h:858
berry::MessageAbstractDelegate1::Clone
virtual MessageAbstractDelegate1 * Clone() const =0
berry::Message3::HasListeners
bool HasListeners() const
Definition: berryMessage.h:982
berry::Message4
Definition: berryMessage.h:1000
berry::Message::GetListeners
ListenerList GetListeners() const
Definition: berryMessage.h:764
berry::DelegateList::Send1
void Send1(T t) const
Definition: berryMessage.h:496
berry::Message2::operator+=
void operator+=(const AbstractDelegate &delegate) const
Definition: berryMessage.h:871
berry::Message2::GetExceptionHandler
AbstractExceptionHandler * GetExceptionHandler() const
Definition: berryMessage.h:901
berry::Message4::GetExceptionHandler
AbstractExceptionHandler * GetExceptionHandler() const
Definition: berryMessage.h:1043
berry::Message4::AbstractDelegate
MessageAbstractDelegate4< T, U, V, W, A > AbstractDelegate
Definition: berryMessage.h:1005
berry::MessageDelegate::Clone
MessageAbstractDelegate< A > * Clone() const override
Definition: berryMessage.h:159
berry::Message2::operator()
void operator()(T t, U u) const
Definition: berryMessage.h:891
berry::Message3::operator+=
void operator+=(const AbstractDelegate &delegate) const
Definition: berryMessage.h:942
berry::DelegateList::Add
void Add(const Delegate &d) const
Definition: berryMessage.h:417
berry::Message4::delegates
DelegateList< AbstractDelegate > delegates
Definition: berryMessage.h:1065
berry::MessageDelegate2::operator==
bool operator==(const MessageAbstractDelegate2< T, U, A > *c) override
Definition: berryMessage.h:237
berry::Message::IsEmpty
bool IsEmpty() const
Definition: berryMessage.h:774
berry::MessageAbstractDelegate3::Clone
virtual MessageAbstractDelegate3 * Clone() const =0
berry::Message3::GetListeners
ListenerList GetListeners() const
Definition: berryMessage.h:977
berry::DelegateList::Send4
void Send4(T t, U u, V v, W w) const
Definition: berryMessage.h:616
berry::MessageAbstractDelegate3::operator==
virtual bool operator==(const MessageAbstractDelegate3 *cmd)=0
berry::MessageDelegate2
Definition: berryMessage.h:216
berry::MessageAbstractDelegate1::operator==
virtual bool operator==(const MessageAbstractDelegate1 *cmd)=0
berry::AbstractExceptionHandler::HandleException
virtual void HandleException(const std::exception &exc)=0
berry::MessageDelegate2::Execute
A Execute(T t, U u) const override
Definition: berryMessage.h:232
berry::Message2::Send
void Send(T t, U u) const
Definition: berryMessage.h:886
berry::Message4::HasListeners
bool HasListeners() const
Definition: berryMessage.h:1053
berry::MessageDelegate::~MessageDelegate
~MessageDelegate() override
Definition: berryMessage.h:135
berry::MessageDelegate2::MessageDelegate2
MessageDelegate2(R *object, A(R::*memberFunctionPointer)(T, U))
Definition: berryMessage.h:222
berry::Message1::AbstractDelegate
MessageAbstractDelegate1< T, A > AbstractDelegate
Definition: berryMessage.h:792
berry::Message4::GetListeners
ListenerList GetListeners() const
Definition: berryMessage.h:1048
berry::Message1::IsEmpty
bool IsEmpty() const
Definition: berryMessage.h:845
berry::Message::Self
Message Self
Definition: berryMessage.h:720
berry::Message3::delegates
DelegateList< AbstractDelegate > delegates
Definition: berryMessage.h:994
berry::Message2::AddListener
void AddListener(const AbstractDelegate &delegate) const
Definition: berryMessage.h:866
berry::DelegateList
Definition: berryMessage.h:392
berry::Message4::IsEmpty
bool IsEmpty() const
Definition: berryMessage.h:1058
berry::MessageDelegate::MessageDelegate
MessageDelegate(R *object, A(R::*memberFunctionPointer)())
Definition: berryMessage.h:130
berry::Message4::RemoveListener
void RemoveListener(const AbstractDelegate &delegate) const
Definition: berryMessage.h:1018
berry::DelegateList::GetDelegates
ListType GetDelegates() const
Definition: berryMessage.h:669
berry::Message3::Self
Message3 Self
Definition: berryMessage.h:933
berry::MessageAbstractDelegate::~MessageAbstractDelegate
virtual ~MessageAbstractDelegate()
Definition: berryMessage.h:58
berry::MessageAbstractDelegate2
Definition: berryMessage.h:82
berry::MessageDelegate4::~MessageDelegate4
~MessageDelegate4() override
Definition: berryMessage.h:320
berry::Message4::operator+=
void operator+=(const AbstractDelegate &delegate) const
Definition: berryMessage.h:1013
berry::DelegateList::Send2
void Send2(T t, U u) const
Definition: berryMessage.h:536
berry::MessageAbstractDelegate4
Definition: berryMessage.h:110
berry::DelegateList::Send3
void Send3(T t, U u, V v) const
Definition: berryMessage.h:576
berry::Message4::Self
Message4 Self
Definition: berryMessage.h:1004
berry::Message1::Send
void Send(T t) const
Definition: berryMessage.h:815
berry::MessageAbstractDelegate4::Clone
virtual MessageAbstractDelegate4 * Clone() const =0
berry::MessageDelegate3::Execute
A Execute(T t, U u, V v) const override
Definition: berryMessage.h:278
berry::Message1::operator()
void operator()(T t) const
Definition: berryMessage.h:820
berry::MessageAbstractDelegate::Clone
virtual MessageAbstractDelegate * Clone() const =0
berry::Message4::operator-=
void operator-=(const AbstractDelegate &delegate) const
Definition: berryMessage.h:1023
berry::Message3::Send
void Send(T t, U u, V v) const
Definition: berryMessage.h:957
berry::Message::ListenerList
DelegateList< AbstractDelegate >::ListType ListenerList
Definition: berryMessage.h:722
berry::Message2::HasListeners
bool HasListeners() const
Definition: berryMessage.h:911
berry::Message::RemoveListener
void RemoveListener(const AbstractDelegate &delegate) const
Definition: berryMessage.h:734
berry::MessageDelegate2::~MessageDelegate2
~MessageDelegate2() override
Definition: berryMessage.h:227
berry::MessageExceptionHandler::HandleException
void HandleException(const std::exception &exc) override
Definition: berryMessage.h:374
berry::Message1::ListenerList
DelegateList< AbstractDelegate >::ListType ListenerList
Definition: berryMessage.h:793
berry::Message4::AddListener
void AddListener(const AbstractDelegate &delegate) const
Definition: berryMessage.h:1008
berry::MessageAbstractDelegate2::~MessageAbstractDelegate2
virtual ~MessageAbstractDelegate2()
Definition: berryMessage.h:86
berry::Message1::AddListener
void AddListener(const AbstractDelegate &delegate) const
Definition: berryMessage.h:795
berry::Message3::RemoveListener
void RemoveListener(const AbstractDelegate &delegate) const
Definition: berryMessage.h:947
berry::AbstractExceptionHandler::Clone
virtual AbstractExceptionHandler * Clone() const =0
berry::MessageDelegate2::Clone
MessageAbstractDelegate2< T, U, A > * Clone() const override
Definition: berryMessage.h:251
berry
Definition: QmitkPropertyItemModel.h:24
berry::Message::AddListener
void AddListener(const AbstractDelegate &delegate) const
Definition: berryMessage.h:724
berry::Message1::HasListeners
bool HasListeners() const
Definition: berryMessage.h:840
berry::Message4::ListenerList
DelegateList< AbstractDelegate >::ListType ListenerList
Definition: berryMessage.h:1006
berry::MessageDelegate3
Definition: berryMessage.h:262
berry::MessageAbstractDelegate4::Execute
virtual A Execute(T t, U u, V v, W w) const =0
berry::MessageDelegate1::~MessageDelegate1
~MessageDelegate1() override
Definition: berryMessage.h:181
berry::DelegateList::Send0
void Send0(Dummy) const
Definition: berryMessage.h:455
berry::MessageAbstractDelegate2::Execute
virtual A Execute(T t, U u) const =0