7 #ifndef __FWCOM_SIGNAL_HPP__ 8 #define __FWCOM_SIGNAL_HPP__ 10 #include "fwCom/SignalBase.hpp" 11 #include <fwCom/SlotConnection.hpp> 13 #include <fwCore/mt/types.hpp> 17 #include <type_traits> 23 struct SlotConnectionBase;
26 template <
typename F >
29 template <
typename F >
36 template <
typename R,
typename ... A >
42 typedef R SignatureType (A ...);
46 typedef SPTR ( SelfType ) sptr;
47 typedef WPTR ( SelfType ) wptr;
50 typedef SPTR ( SlotRunType ) SlotSptr;
52 typedef std::pair< bool, SlotRunType* > PairType;
53 typedef std::list< PairType* > SlotContainerType;
56 std::owner_less< WPTR( SlotBase ) > > ConnectionMapType;
65 this->disconnectAll();
87 void emit( A ...
a )
const;
90 void asyncEmit( A ... a )
const;
96 return m_slots.size();
107 template <
typename F >
118 template<
typename FROM_F >
127 mutable ::fwCore::mt::ReadWriteMutex m_connectionsMutex;
130 BOOST_STATIC_ASSERT( (std::is_same<void, R>::value) );
Namespace containing fw4spl communication tools.
SlotContainerType m_slots
Connected slots.
Class managing Signal-Slot connections.
Base class for Slot connection implementation. This class is for internal use purpose.
size_t getNumberOfConnections() const
Returns number of connected slots.
ConnectionMapType m_connections
Container of current connections.
::boost::shared_lock< ReadWriteMutex > ReadLock
Defines a lock of read type for read/write mutex.
~Signal()
Destructor : disconnects all remaining connections.
Base class for Slot implementations.