fw4spl
fwCom::util::WeakCall< T, R > Struct Template Reference

Weak functor class. Store a zero-arg-function and a weak pointer on an object. The WeakCall is callable only once. A bad_weak_ptr exception is thrown if the weak_ptr is expired when operator() is called A fwCom::exception::WorkerChanged exception is thrown if the target slot worker changed since weakcall request. More...

#include <WeakCall.hpp>

+ Collaboration diagram for fwCom::util::WeakCall< T, R >:

Public Member Functions

 WeakCall (const std::shared_ptr< T const > &ptr, std::function< R() > f)
 
 WeakCall (const std::shared_ptr< T const > &ptr, std::function< R() > f, const std::shared_ptr< ::fwThread::Worker > &m)
 
operator() () const
 

Protected Attributes

std::weak_ptr< T const > m_weakPtr
 
std::function< R() > m_func
 
std::weak_ptr< ::fwThread::Workerm_worker
 

Detailed Description

template<typename T, typename R>
struct fwCom::util::WeakCall< T, R >

Weak functor class. Store a zero-arg-function and a weak pointer on an object. The WeakCall is callable only once. A bad_weak_ptr exception is thrown if the weak_ptr is expired when operator() is called A fwCom::exception::WorkerChanged exception is thrown if the target slot worker changed since weakcall request.

Template Parameters
TStored object type.
RStored function return type.

Definition at line 32 of file SlotBase.hpp.


The documentation for this struct was generated from the following files: