fw4spl
fwServices::registry::Proxy Class Reference

This class defines a proxy for signal/slot connections. More...

#include <Proxy.hpp>

+ Inheritance diagram for fwServices::registry::Proxy:
+ Collaboration diagram for fwServices::registry::Proxy:

Classes

struct  SigSlots
 Structure to regsiter signal and slot informations Contains a signal container, a slot container and a mutex to protect access. More...
 

Public Types

typedef std::string ChannelKeyType
 
typedef std::map< ChannelKeyType, std::shared_ptr< SigSlots > > ChannelMapType
 

Public Member Functions

virtual bool isA (const std::string &type) const override
 
FWSERVICES_API Proxy ()
 Constructor, does nothing.
 
virtual FWSERVICES_API ~Proxy ()
 Destructor, does nothing.
 
FWSERVICES_API void connect (ChannelKeyType channel,::fwCom::SignalBase::sptr signal)
 Registers a signal in the channel. It will be connected to all slots in the channel.
 
FWSERVICES_API void connect (ChannelKeyType channel,::fwCom::SlotBase::sptr slot)
 Registers a slot in the channel. It will be connected to all signals in the channel.
 
FWSERVICES_API void disconnect (ChannelKeyType channel,::fwCom::SignalBase::sptr signal)
 Unregisters the signal. Disconnects it from the slots in channel.
 
FWSERVICES_API void disconnect (ChannelKeyType channel,::fwCom::SlotBase::sptr slot)
 Unregisters the slot. Disconnects it from the signals in channel.
 
- Public Member Functions inherited from fwCore::BaseObject

Static Public Member Functions

static bool isTypeOf (const std::string &type)
 
static FWSERVICES_API Proxy::sptr getDefault ()
 Returns an instance of Proxy.
 
- 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
 

Protected Attributes

ChannelMapType m_channels
 Association channels, SigSlot.
 
mutable::fwCore::mt::ReadWriteMutex m_channelMutex
 Used to protect the m_channels access.
 

Static Protected Attributes

static Proxy::sptr s_currentProxy = Proxy::New()
 The global instance of the proxy.
 

Friends

template<class , class , class >
class ::fwTools::ClassFactory
 
class ::fwTools::Factory
 

Demangling methods

virtual const std::string & getLeafClassname () const override
 return object's classname without its namespace, i.e. BaseObject
 
virtual const std::string & getClassname () const override
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 
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

This class defines a proxy for signal/slot connections.

Note
All the signals registered in a Proxy's channel are connected to all slots registered in the same channel.

Definition at line 31 of file Proxy.hpp.


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