fw4spl
fwCom::Slots Class Reference

This class proposes a mapping between a SlotKeyType and a SlotBase. More...

#include <Slots.hpp>

+ Collaboration diagram for fwCom::Slots:

Public Types

typedef std::string SlotKeyType
 
typedef std::map< SlotKeyType, std::shared_ptr< SlotBase > > SlotMapType
 
typedef std::vector< SlotKeyType > SlotKeyContainerType
 

Public Member Functions

FWCOM_API Slots ()
 Constructor, does nothing.
 
virtual FWCOM_API ~Slots ()
 Constructor, check if all slots are disconnected.
 
FWCOM_API Slotsoperator() (const SlotKeyType &key, const std::shared_ptr< SlotBase > &slot)
 Registers SlotBase in m_slots.
 
template<typename R , typename... A>
Slotsoperator() (const SlotKeyType &key, std::shared_ptr< Slot< R(A...) > >slot)
 Registers Slot in m_slots (defined here to avoid compiler error C2244)
 
template<typename F , typename... A>
Slotsoperator() (const SlotKeyType &key, F f, A...a)
 Creates in intern a new slot from function and registers it in m_slots.
 
FWCOM_API std::shared_ptr< SlotBaseoperator[] (const SlotKeyType &key) const
 Returns the SlotBase associated to the key, if key does not exist, the ptr is null.
 
FWCOM_API void setWorker (const std::shared_ptr< ::fwThread::Worker > &worker)
 Assigns the worker to all slots stored in m_slots.
 
FWCOM_API SlotKeyContainerType getSlotKeys () const
 Returns all SlotKeyType registered in m_slots.
 

Protected Member Functions

 Slots (const Slots &)
 Copy constructor forbidden.
 
Slotsoperator= (const Slots &)
 Copy constructor forbidden.
 

Protected Attributes

SlotMapType m_slots
 Association < key , SPTR( SlotBase ) >
 

Detailed Description

This class proposes a mapping between a SlotKeyType and a SlotBase.

Definition at line 33 of file Slots.hpp.


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