OpenWalnut
1.2.5
|
Class implementing output connection functionality between modules. More...
#include <WModuleOutputConnector.h>
Public Member Functions | |
WModuleOutputConnector (boost::shared_ptr< WModule > module, std::string name="", std::string description="") | |
Constructor. | |
virtual | ~WModuleOutputConnector () |
Destructor. | |
boost::signals2::connection | subscribeSignal (MODULE_CONNECTOR_SIGNAL signal, t_GenericSignalHandlerType notifier) |
Connects (subscribes) a specified notify function with a signal this module instance is offering. | |
virtual bool | connectable (boost::shared_ptr< WModuleConnector > con) |
Checks whether the specified connector is an input connector. | |
virtual boost::shared_ptr < WPrototyped > | getTransferPrototype ()=0 |
Returns the prototype of the WTransferable used in this connector. | |
virtual const boost::shared_ptr < WTransferable > | getRawData () const =0 |
Gives back the currently set data as WTransferable. | |
virtual bool | isInputConnector () const |
Returns true if this instance is an WModuleInputConnector. | |
virtual bool | isOutputConnector () const |
Returns true if this instance is an WModuleOutputConnector. | |
![]() | |
WModuleConnector (boost::shared_ptr< WModule > module, std::string name="", std::string description="") | |
Constructor. | |
virtual | ~WModuleConnector () |
Destructor. | |
boost::shared_ptr< WModule > | getModule () const |
Returns the module which owns this connector. | |
virtual void | disconnect (boost::shared_ptr< WModuleConnector > con, bool removeFromOwnList=true) |
Disconnects this connector if connected. | |
virtual void | disconnectAll () |
Disconnects ALL connected connectors. | |
virtual void | connect (boost::shared_ptr< WModuleConnector > con) |
Connects this Module Connector with another one. | |
bool | isConnectedTo (boost::shared_ptr< WModuleConnector > con) |
Checks whether this connector is connected to the given one. | |
unsigned int | isConnected () |
Gets the count of connections currently established. | |
const std::string | getDescription () const |
Gives information about this connection. | |
void | setDescription (std::string desc) |
Sets the connector's description. | |
const std::string | getName () const |
Gives name of connection. | |
const std::string | getCanonicalName () const |
Gives canonical name of connection. | |
void | setName (std::string name) |
Sets the connector's name. | |
WCombinerTypes::WOneToOneCombiners | getPossibleDisconnections () |
Returns a list of possible disconnections for this connector. | |
boost::shared_ptr < WModuleInputConnector > | toInputConnector () |
Tries to convert this instance to an input connector. | |
boost::shared_ptr < WModuleOutputConnector > | toOutputConnector () |
Tries to convert this instance to an output connector. |
Protected Member Functions | |
virtual void | propagateDataChange () |
Propagates the signal "DATA_CHANGED" to all connected items. | |
![]() | |
virtual void | connectSignals (boost::shared_ptr< WModuleConnector > con) |
Connect additional signals. | |
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. | |
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 | notifyConnectionClosed (boost::shared_ptr< WModuleConnector > here, boost::shared_ptr< WModuleConnector > there) |
Gets called whenever a connection between a remote and local connector gets closed. |
Private Attributes | |
t_GenericSignalType | signal_DataChanged |
Signal fired whenever new data should be propagated. |
Additional Inherited Members | |
![]() | |
typedef boost::shared_ptr < WModuleConnector > | SPtr |
Shared pointer to this class. | |
typedef boost::shared_ptr < const WModuleConnector > | ConstSPtr |
Const shared pointer to this class. | |
![]() | |
std::set< boost::shared_ptr < WModuleConnector > > | m_connected |
List of connectors connected to this connector. | |
boost::shared_mutex | m_connectionListLock |
Lock for avoiding concurrent write to m_Connected (multiple reader, single writer lock). | |
boost::weak_ptr< WModule > | m_module |
The Module this connector belongs to. | |
std::string | m_moduleName |
The name of the module owning this connector. | |
t_GenericSignalType | signal_ConnectionEstablished |
Signal emitted whenever connection has been established. | |
t_GenericSignalType | signal_ConnectionClosed |
Signal emitted whenever connection has been closed. |
Class implementing output connection functionality between modules.
Definition at line 44 of file WModuleOutputConnector.h.
WModuleOutputConnector::WModuleOutputConnector | ( | boost::shared_ptr< WModule > | module, |
std::string | name = "" , |
||
std::string | description = "" |
||
) |
Constructor.
module | the module which is owner of this connector. |
name | The name of this connector. |
description | Short description of this connector. |
Definition at line 37 of file WModuleOutputConnector.cpp.
|
virtual |
Destructor.
Definition at line 43 of file WModuleOutputConnector.cpp.
|
virtual |
Checks whether the specified connector is an input connector.
con | the connector to check against. |
Implements WModuleConnector.
Reimplemented in WModuleOutputData< T >.
Definition at line 48 of file WModuleOutputConnector.cpp.
|
pure virtual |
Gives back the currently set data as WTransferable.
Implemented in WModuleOutputData< T >.
|
pure virtual |
Returns the prototype of the WTransferable used in this connector.
Implemented in WModuleOutputData< T >.
|
virtual |
Returns true if this instance is an WModuleInputConnector.
Implements WModuleConnector.
Definition at line 77 of file WModuleOutputConnector.cpp.
|
virtual |
Returns true if this instance is an WModuleOutputConnector.
Implements WModuleConnector.
Definition at line 82 of file WModuleOutputConnector.cpp.
|
protectedvirtual |
Propagates the signal "DATA_CHANGED" to all connected items.
Definition at line 72 of file WModuleOutputConnector.cpp.
References signal_DataChanged.
Referenced by WModuleOutputData< T >::triggerUpdate().
|
virtual |
Connects (subscribes) a specified notify function with a signal this module instance is offering.
WModuleSignalSubscriptionFailed | thrown if the signal can't be connected. |
signal | the signal to connect to. |
notifier | the notifier function to bind. |
Reimplemented from WModuleConnector.
Definition at line 59 of file WModuleOutputConnector.cpp.
References signal_DataChanged.
|
private |
Signal fired whenever new data should be propagated.
Represented by DATA_CHANGED enum- element.
Definition at line 131 of file WModuleOutputConnector.h.
Referenced by propagateDataChange(), and subscribeSignal().