6 #ifndef __FWCOM_SLOTBASE_HXX__ 7 #define __FWCOM_SLOTBASE_HXX__ 9 #ifndef __FWCOM_SLOTBASE_HPP__ 10 #error fwCom/SlotBase.hpp not included 13 #include "fwCom/exception/BadCall.hpp" 14 #include "fwCom/Slot.hpp" 15 #include "fwCom/Slot.hxx" 16 #include "fwCom/SlotRun.hpp" 17 #include "fwCom/SlotRun.hxx" 19 #include "fwCore/exceptionmacros.hpp" 21 #include <boost/function_types/function_arity.hpp> 30 template<
typename A1,
typename A2,
typename A3 >
31 void SlotBase::run(A1 a1, A2 a2, A3 a3)
const 33 typedef SlotRun< void (A1, A2, A3) > SlotFuncType;
34 const SlotFuncType* fun =
dynamic_cast< const SlotFuncType*
>(
this);
48 template<
typename A1,
typename A2 >
49 void SlotBase::run(A1 a1, A2 a2)
const 51 typedef SlotRun< void (A1, A2) > SlotFuncType;
52 const SlotFuncType* fun =
dynamic_cast< const SlotFuncType*
>(
this);
66 template<
typename A1 >
67 void SlotBase::run(A1 a1)
const 69 typedef SlotRun< void (A1) > SlotFuncType;
70 const SlotFuncType* fun =
dynamic_cast< const SlotFuncType*
>(
this);
84 template<
typename R,
typename A1,
typename A2,
typename A3 >
85 R SlotBase::call(A1 a1, A2 a2, A3 a3)
const 87 typedef Slot< R(A1, A2, A3) > SlotFuncType;
88 const SlotFuncType* fun =
dynamic_cast< const SlotFuncType*
>(
this);
91 return fun->call(a1, a2, a3);
96 return this->call<R>(a1, a2);
102 template<
typename R,
typename A1,
typename A2 >
103 R SlotBase::call(A1 a1, A2 a2)
const 105 typedef Slot< R(A1, A2) > SlotFuncType;
106 const SlotFuncType* fun =
dynamic_cast< const SlotFuncType*
>(
this);
109 return fun->call(a1, a2);
114 return this->call<R>(a1);
120 template<
typename R,
typename A1 >
121 R SlotBase::call(A1 a1)
const 123 typedef Slot< R(A1) > SlotFuncType;
124 const SlotFuncType* fun =
dynamic_cast< const SlotFuncType*
>(
this);
127 return fun->call(a1);
132 return this->call<R>();
138 template<
typename R >
139 R SlotBase::call()
const 141 typedef Slot< R() > SlotFuncType;
142 const SlotFuncType* fun =
dynamic_cast< const SlotFuncType*
>(
this);
153 template<
typename A1,
typename A2,
typename A3 >
156 typedef SlotRun< void (A1, A2, A3) > SlotFuncType;
157 const SlotFuncType* fun =
dynamic_cast< const SlotFuncType*
>(
this);
160 return fun->asyncRun(a1, a2, a3);
166 return this->asyncRun(a1, a2);
172 template<
typename A1,
typename A2 >
175 typedef SlotRun< void (A1, A2) > SlotFuncType;
176 const SlotFuncType* fun =
dynamic_cast< const SlotFuncType*
>(
this);
179 return fun->asyncRun(a1, a2);
184 return this->asyncRun(a1);
190 template<
typename A1 >
193 typedef SlotRun< void (A1) > SlotFuncType;
194 const SlotFuncType* fun =
dynamic_cast< const SlotFuncType*
>(
this);
197 return fun->asyncRun(a1);
202 return this->asyncRun();
208 template<
typename R,
typename A1,
typename A2,
typename A3 >
209 std::shared_future< R > SlotBase::asyncCall(A1 a1, A2 a2, A3 a3)
const 211 typedef Slot< R(A1, A2, A3) > SlotFuncType;
212 const SlotFuncType* fun =
dynamic_cast< const SlotFuncType*
>(
this);
215 return fun->asyncCall(a1, a2, a3);
220 return this->asyncCall<R>(a1, a2);
226 template<
typename R,
typename A1,
typename A2 >
227 std::shared_future< R > SlotBase::asyncCall(A1 a1, A2 a2)
const 229 typedef Slot< R(A1, A2) > SlotFuncType;
230 const SlotFuncType* fun =
dynamic_cast< const SlotFuncType*
>(
this);
233 return fun->asyncCall(a1, a2);
238 return this->asyncCall<R>(a1);
244 template<
typename R,
typename A1 >
245 std::shared_future< R > SlotBase::asyncCall(A1 a1)
const 247 typedef Slot< R(A1) > SlotFuncType;
248 const SlotFuncType* fun =
dynamic_cast< const SlotFuncType*
>(
this);
251 return fun->asyncCall(a1);
256 return this->asyncCall<R>();
262 template<
typename R >
263 std::shared_future< R > SlotBase::asyncCall()
const 265 typedef Slot< R() > SlotFuncType;
266 const SlotFuncType* fun =
dynamic_cast< const SlotFuncType*
>(
this);
269 return fun->asyncCall();
Namespace containing fw4spl communication tools.
std::string getTypeName() const
Returns F typeid name.
#define OSLM_ERROR(message)
std::shared_future< void > VoidSharedFutureType
SlotBase::asyncRun return type.
std::string m_signature
Slot's signature based on typeid.