MeVisLab Toolbox Reference
mlMessagingBackgroundTask.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2009, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 #ifndef ML_MESSAGING_BACKGROUND_TASK_H
14 #define ML_MESSAGING_BACKGROUND_TASK_H
15 
16 // Local includes
18 
19 #include "mlBackgroundTask.h"
20 #include "mlDistantObject.h"
22 
23 ML_START_NAMESPACE
24 
25 //-----------------------------------------------------------------------
26 
31 {
33 
34 public:
35  MessagingBackgroundTask(void* ownerArg):BackgroundTask(ownerArg) {};
36 
37  //------------------------------------------------------
39 
75  //------------------------------------------------------
76 
77  template <typename Object, typename Method>
78  void callMethodOnGUI(const DistantObject<Object>& target, Method method)
79  {
81  }
82 
83  template <typename Object, typename Method, typename Arg1>
84  void callMethodOnGUI(const DistantObject<Object>& target, Method method, const Arg1& arg1)
85  {
87  }
88 
89  template <typename Object, typename Method, typename Arg1, typename Arg2>
90  void callMethodOnGUI(const DistantObject<Object>& target, Method method, const Arg1& arg1, const Arg2& arg2)
91  {
93  }
94 
95  template <typename Object, typename Method, typename Arg1, typename Arg2, typename Arg3>
96  void callMethodOnGUI(const DistantObject<Object>& target, Method method, const Arg1& arg1, const Arg2& arg2, const Arg3& arg3)
97  {
99  }
100 
101  template <typename Object, typename Method, typename Arg1, typename Arg2, typename Arg3, typename Arg4>
102  void callMethodOnGUI(const DistantObject<Object>& target, Method method, const Arg1& arg1, const Arg2& arg2, const Arg3& arg3, const Arg4& arg4)
103  {
105  }
106 
107  template <typename Object, typename Method, typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5>
108  void callMethodOnGUI(const DistantObject<Object>& target, Method method, const Arg1& arg1, const Arg2& arg2, const Arg3& arg3, const Arg4& arg4, const Arg5& arg5)
109  {
110  sendMessageToGUI(NewBackgroundTaskMethodCall(DistantObjectAccessor::get(target), method, arg1, arg2, arg3, arg4, arg5));
111  }
112 };
113 
114 
115 ML_END_NAMESPACE
116 
117 #endif
118 
119 
#define MLBACKGROUNDTASKS_EXPORT
Project global and OS specific declarations.
Base class for a task that is started in an extra thread.
void sendMessageToGUI(BackgroundTaskMessage *message)
send the message to the GUI (ownership of message is passed to the method) and it sets the sender of ...
A DistantObject stores the pointer to an object of type T and forbids direct access to the stored poi...
MessagingBackgroundTask extends the BackgroundTask with the functionality to call methods on DistantO...
void callMethodOnGUI(const DistantObject< Object > &target, Method method)
void callMethodOnGUI(const DistantObject< Object > &target, Method method, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
void callMethodOnGUI(const DistantObject< Object > &target, Method method, const Arg1 &arg1, const Arg2 &arg2)
void callMethodOnGUI(const DistantObject< Object > &target, Method method, const Arg1 &arg1)
void callMethodOnGUI(const DistantObject< Object > &target, Method method, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
void callMethodOnGUI(const DistantObject< Object > &target, Method method, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5)
#define ML_DISALLOW_COPY_AND_ASSIGN(className)
Defines basic macros.
Definition: mlMacros.h:23
ml_vertex_id_map get(vertex_index_t, ml_graph_ptr g)
get() function for vertex id property map vertex_index_t just necessary for overloading
boost::graph_traits< ml_graph_ptr >::vertex_descriptor target(graph_traits< ml_graph_ptr >::edge_descriptor e, const ml_graph_ptr)
Returns the vertex descriptor for v of the edge (u,v) represented by e.
BackgroundTaskMessage * NewBackgroundTaskMethodCall(Object *object, Method method)
create new method call with 0 arguments