6 #ifndef __FWCOM_SLOTCALL_HXX__ 7 #define __FWCOM_SLOTCALL_HXX__ 9 #ifndef __FWCOM_SLOTCALL_HPP__ 10 #error fwCom/SlotCall.hpp not included 13 #include "fwCom/exception/NoWorker.hpp" 14 #include "fwCom/SlotRun.hxx" 15 #include "fwCom/util/WeakCall.hpp" 17 #include <fwCore/mt/types.hpp> 19 #include <fwThread/TaskHandler.hpp> 20 #include <fwThread/Worker.hpp> 29 template<
typename R,
typename ... A >
30 std::function< R() >
SlotCall< R(A ...) >::bindCall( A ... args )
const 32 return std::bind( ( R(
SlotCall< R(A ...) >::*)( A ... )
const ) &
SlotCall< R(A ...) >::call,
this,
38 template<
typename R,
typename ... A >
39 typename SlotCall< R(A ...) >::SharedFutureType
SlotCall< R(A ...) >::asyncCall(
40 const ::fwThread::Worker::sptr& worker, A ... args )
const 50 std::dynamic_pointer_cast< const SlotBase >(this->shared_from_this()),
51 this->bindCall( args ... )
58 template<
typename R,
typename ... A >
59 typename SlotCall< R(A ...) >::SharedFutureType
SlotCall< R(A ...) >::asyncCall(A ... args)
const 71 std::dynamic_pointer_cast< const SlotBase >(this->shared_from_this()),
72 this->bindCall( args ... ),
80 template<
typename R,
typename ... A >
81 template<
typename WEAKCALL >
82 std::shared_future< R >
SlotCall< R(A ...) >::postWeakCall( const ::fwThread::Worker::sptr& worker, WEAKCALL f )
84 std::packaged_task< R() > task( f );
85 std::future< R > ufuture = task.get_future();
87 std::function< void() > ftask = ::fwThread::moveTaskIntoFunction(task);
91 return std::move(ufuture);
Namespace containing fw4spl communication tools.
WeakCall< T, R > weakcall(const std::shared_ptr< T const > &ptr, std::function< R() > f)
Returns weak call from given object and function.
::boost::shared_lock< ReadWriteMutex > ReadLock
Defines a lock of read type for read/write mutex.