7 #include "fwCom/Slot.hpp" 8 #include "fwCom/Slot.hxx" 10 #include "fwCom/Slots.hpp" 12 #include <fwThread/Worker.hpp> 26 for( SlotMapType::value_type elem :
m_slots )
28 SLM_ASSERT(
"Slot '"<< elem.first <<
"' has connected signals", elem.second->getNumberOfConnections() == 0 );
37 for( SlotMapType::value_type elem :
m_slots )
39 elem.second->setWorker(worker);
47 m_slots.insert( SlotMapType::value_type(key, slot) );
55 SlotMapType::const_iterator it =
m_slots.find(key);
62 return SlotBase::sptr();
69 Slots::SlotKeyContainerType slotKeys;
70 for( SlotMapType::value_type elem :
m_slots )
72 slotKeys.push_back(elem.first);
Slots & operator=(const Slots &)
Copy constructor forbidden.
Namespace containing fw4spl communication tools.
SlotMapType m_slots
Association < key , SPTR( SlotBase ) >
virtual FWCOM_API ~Slots()
Constructor, check if all slots are disconnected.
This class proposes a mapping between a SlotKeyType and a SlotBase.
FWCOM_API SlotKeyContainerType getSlotKeys() const
Returns all SlotKeyType registered in m_slots.
#define SLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
FWCOM_API std::shared_ptr< SlotBase > operator[](const SlotKeyType &key) const
Returns the SlotBase associated to the key, if key does not exist, the ptr is null.
FWCOM_API Slots()
Constructor, does nothing.
FWCOM_API Slots & operator()(const SlotKeyType &key, const std::shared_ptr< SlotBase > &slot)
Registers SlotBase in m_slots.
FWCOM_API void setWorker(const std::shared_ptr< ::fwThread::Worker > &worker)
Assigns the worker to all slots stored in m_slots.