fw4spl
fwCom::SlotBase Struct Reference

Base class for Slot implementations. More...

#include <SlotBase.hpp>

+ Inheritance diagram for fwCom::SlotBase:
+ Collaboration diagram for fwCom::SlotBase:

Public Types

typedef std::shared_future< void > VoidSharedFutureType
 SlotBase::asyncRun return type.
 
typedef std::set< std::shared_ptr< const SlotConnectionBase > > ConnectionSetType
 Connections container type.
 
typedefs

Slot pointer types.

typedef std::shared_ptr< SlotBasesptr
 
typedef std::weak_ptr< SlotBasewptr
 
typedef std::shared_ptr< SlotBase const > csptr
 
typedef std::weak_ptr< SlotBase const > cwptr
 
typedef std::string IDType
 

Public Member Functions

unsigned int arity () const
 Returns Slot's arity. The arity defines the number of parameters in Slot signature.
 
void setWorker (const std::shared_ptr< ::fwThread::Worker > &worker)
 Sets Slot's Worker.
 
std::shared_ptr< ::fwThread::WorkergetWorker () const
 Returns Slot's Worker.
 
size_t getNumberOfConnections () const
 Returns number of connections.
 
Run helpers

Run the Slot.

Exceptions
BadRunif given arguments do not match the slot implementation
template<typename A1 , typename A2 , typename A3 >
void run (A1 a1, A2 a2, A3 a3) const
 
template<typename A1 , typename A2 >
void run (A1 a1, A2 a2) const
 
template<typename A1 >
void run (A1 a1) const
 
FWCOM_API void run () const
 
Call helpers

Call the Slot (with return value).

Exceptions
BadCallif given arguments do not match the slot implementation
template<typename R , typename A1 , typename A2 , typename A3 >
call (A1 a1, A2 a2, A3 a3) const
 
template<typename R , typename A1 , typename A2 >
call (A1 a1, A2 a2) const
 
template<typename R , typename A1 >
call (A1 a1) const
 
template<typename R >
call () const
 
Asynchronous run helpers

Run the Slot asynchronously.

Exceptions
BadRunif given arguments do not match the slot implementation
NoWorkerif given worker is not valid.
template<typename A1 , typename A2 , typename A3 >
VoidSharedFutureType asyncRun (A1 a1, A2 a2, A3 a3) const
 
template<typename A1 , typename A2 >
VoidSharedFutureType asyncRun (A1 a1, A2 a2) const
 
template<typename A1 >
VoidSharedFutureType asyncRun (A1 a1) const
 
FWCOM_API VoidSharedFutureType asyncRun () const
 
Asynchronous call helpers

Call the Slot asynchronously (with return value).

Exceptions
BadCallif given arguments do not match the slot implementation
NoWorkerif given worker is not valid.
template<typename R , typename A1 , typename A2 , typename A3 >
std::shared_future< R > asyncCall (A1 a1, A2 a2, A3 a3) const
 
template<typename R , typename A1 , typename A2 >
std::shared_future< R > asyncCall (A1 a1, A2 a2) const
 
template<typename R , typename A1 >
std::shared_future< R > asyncCall (A1 a1) const
 
template<typename R >
std::shared_future< R > asyncCall () const
 
- Public Member Functions inherited from fwCore::BaseObject
virtual bool isA (const std::string &type) const
 
virtual const std::string & getLeafClassname () const
 return object's classname without its namespace, i.e. BaseObject
 
virtual const std::string & getClassname () const
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 

Protected Member Functions

 SlotBase (const SlotBase &)
 Copy constructor forbidden.
 
SlotBaseoperator= (const SlotBase &)
 Copy operator forbidden.
 
template<typename F >
std::string getTypeName () const
 Returns F typeid name.
 
 SlotBase (unsigned int arity)
 

Protected Attributes

std::string m_signature
 Slot's signature based on typeid.
 
const unsigned int m_arity
 Slot's arity.
 
std::shared_ptr< ::fwThread::Workerm_worker
 Slot's Worker.
 
ConnectionSetType m_connections
 Container of current connections.
 
mutable::fwCore::mt::ReadWriteMutex m_connectionsMutex
 
mutable::fwCore::mt::ReadWriteMutex m_workerMutex
 

Friends

SlotBase's friends
template<typename F >
struct SlotConnection
 
template<typename F >
struct Signal
 
template<typename T , typename R >
struct util::WeakCall
 

Additional Inherited Members

- Static Public Member Functions inherited from fwCore::BaseObject
static bool isTypeOf (const std::string &type)
 
static const std::string & leafClassname ()
 return object's classname without its namespace, i.e. BaseObject
 
static const std::string & classname ()
 return object's classname without its namespace, i.e. BaseObject
 

Detailed Description

Base class for Slot implementations.

Definition at line 46 of file SlotBase.hpp.


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