25 #ifndef WMODULECONNECTOR_H
26 #define WMODULECONNECTOR_H
31 #include <boost/shared_ptr.hpp>
32 #include <boost/thread.hpp>
33 #include <boost/signals2/signal.hpp>
34 #include <boost/signals2/connection.hpp>
35 #include <boost/bind.hpp>
38 #include "WModuleCombinerTypes.h"
39 #include "WModuleConnectorSignals.h"
59 typedef boost::shared_ptr< WModuleConnector >
SPtr;
64 typedef boost::shared_ptr< const WModuleConnector >
ConstSPtr;
73 WModuleConnector( boost::shared_ptr< WModule > module, std::string name=
"", std::string description=
"" );
85 boost::shared_ptr< WModule >
getModule()
const;
93 virtual void disconnect( boost::shared_ptr<WModuleConnector> con,
bool removeFromOwnList =
true );
110 virtual void connect( boost::shared_ptr<WModuleConnector> con );
122 bool isConnectedTo( boost::shared_ptr<WModuleConnector> con );
141 virtual boost::signals2::connection
subscribeSignal( MODULE_CONNECTOR_SIGNAL signal, t_GenericSignalHandlerType notifier );
162 const std::string
getName()
const;
177 void setName( std::string name );
186 virtual bool connectable( boost::shared_ptr<WModuleConnector> con ) = 0;
242 virtual void connectSignals( boost::shared_ptr<WModuleConnector> con );
260 virtual const t_GenericSignalHandlerType
getSignalHandler( MODULE_CONNECTOR_SIGNAL signal );
286 virtual void notifyConnectionClosed( boost::shared_ptr<WModuleConnector> here, boost::shared_ptr<WModuleConnector> there );
310 #endif // WMODULECONNECTOR_H
t_GenericSignalType signal_ConnectionEstablished
Signal emitted whenever connection has been established.
virtual void disconnectAll()
Disconnects ALL connected connectors.
boost::shared_ptr< const WModuleConnector > ConstSPtr
Const shared pointer to this class.
virtual bool isInputConnector() const =0
Returns true if this instance is an WModuleInputConnector.
const std::string getName() const
Gives name of connection.
boost::weak_ptr< WModule > m_module
The Module this connector belongs to.
WModuleConnector(boost::shared_ptr< WModule > module, std::string name="", std::string description="")
Constructor.
std::string m_name
The connections name.
t_GenericSignalType signal_ConnectionClosed
Signal emitted whenever connection has been closed.
virtual void disconnect(boost::shared_ptr< WModuleConnector > con, bool removeFromOwnList=true)
Disconnects this connector if connected.
boost::shared_ptr< WModuleInputConnector > toInputConnector()
Tries to convert this instance to an input connector.
virtual void connect(boost::shared_ptr< WModuleConnector > con)
Connects this Module Connector with another one.
virtual bool connectable(boost::shared_ptr< WModuleConnector > con)=0
Checks whether the specified connector is connectable to this one.
unsigned int isConnected()
Gets the count of connections currently established.
std::string m_moduleName
The name of the module owning this connector.
This class is able to parse project files and create the appropriate module graph inside a specified ...
void setDescription(std::string desc)
Sets the connector's description.
const std::string getDescription() const
Gives information about this connection.
void setName(std::string name)
Sets the connector's name.
virtual ~WModuleConnector()
Destructor.
Tests the WModuleConnector class.
virtual void disconnectSignals(boost::shared_ptr< WModuleConnector > con)
Disconnect all signals subscribed by this connector from "con".
virtual const t_GenericSignalHandlerType getSignalHandler(MODULE_CONNECTOR_SIGNAL signal)
Gives the signal handler function responsible for a given signal.
const std::string getCanonicalName() const
Gives canonical name of connection.
boost::shared_ptr< WModuleConnector > SPtr
Shared pointer to this class.
virtual void notifyConnectionClosed(boost::shared_ptr< WModuleConnector > here, boost::shared_ptr< WModuleConnector > there)
Gets called whenever a connection between a remote and local connector gets closed.
Class implementing output connection functionality between modules.
boost::shared_mutex m_connectionListLock
Lock for avoiding concurrent write to m_Connected (multiple reader, single writer lock)...
WCombinerTypes::WOneToOneCombiners getPossibleDisconnections()
Returns a list of possible disconnections for this connector.
virtual void notifyConnectionEstablished(boost::shared_ptr< WModuleConnector > here, boost::shared_ptr< WModuleConnector > there)
Gets called whenever a connector gets connected to the specified input.
virtual void connectSignals(boost::shared_ptr< WModuleConnector > con)
Connect additional signals.
bool isConnectedTo(boost::shared_ptr< WModuleConnector > con)
Checks whether this connector is connected to the given one.
boost::shared_ptr< WModuleOutputConnector > toOutputConnector()
Tries to convert this instance to an output connector.
std::set< boost::shared_ptr< WModuleConnector > > m_connected
List of connectors connected to this connector.
std::string m_description
The connections description.
Base class for modelling connections between kernel modules.
virtual boost::signals2::connection subscribeSignal(MODULE_CONNECTOR_SIGNAL signal, t_GenericSignalHandlerType notifier)
Connects a specified notify function with a signal this module instance is offering.
virtual bool isOutputConnector() const =0
Returns true if this instance is an WModuleOutputConnector.
boost::shared_ptr< WModule > getModule() const
Returns the module which owns this connector.