OpenWalnut
1.2.5
|
Class offering an instantiate-able data connection between modules. More...
#include <WModuleInputData.h>
Public Types | |
typedef boost::shared_ptr < WModuleInputData< T > > | PtrType |
Pointer to this. | |
typedef WModuleInputData< T > & | RefType |
Reference to this type. | |
typedef WModuleInputData< T > | Type |
Type of the connector. | |
typedef T | TransferType |
Typedef to the contained transferable. |
Public Member Functions | |
WModuleInputData (boost::shared_ptr< WModule > module, std::string name="", std::string description="") | |
Constructor. | |
virtual | ~WModuleInputData () |
Destructor. | |
virtual void | disconnect (boost::shared_ptr< WModuleConnector > con, bool removeFromOwnList=true) |
Disconnects this connector if connected. | |
const boost::shared_ptr< T > | getData (bool reset=true) |
Gives the currently set data and resets the update flag. | |
virtual bool | connectable (boost::shared_ptr< WModuleConnector > con) |
Checks whether the specified connector is an input connector and compatible with T. | |
![]() | |
WModuleInputConnector (boost::shared_ptr< WModule > module, std::string name="", std::string description="") | |
Constructor. | |
virtual | ~WModuleInputConnector () |
Destructor. | |
boost::shared_ptr< WCondition > | getDataChangedCondition () |
Gets the condition variable that gets fired whenever new data has been sent. | |
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 | isInputConnector () const |
Returns true if this instance is an WModuleInputConnector. | |
virtual bool | isOutputConnector () const |
Returns true if this instance is an WModuleOutputConnector. | |
virtual bool | updated () |
Denotes whether the connected output was updated. | |
virtual bool | handledUpdate () |
Resets the updated-flag. | |
![]() | |
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 | 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. |
Static Public Member Functions | |
static PtrType | create (boost::shared_ptr< WModule > module, std::string name="", std::string description="") |
Convenience method to create a new instance of this in data connector with proper type. | |
static PtrType | createAndAdd (boost::shared_ptr< WModule > module, std::string name="", std::string description="") |
Convenience method to create a new instance of this in data connector with proper type and add it to the list of connectors of the specified module. |
Private Attributes | |
bool | m_disconnecting |
If true, the returned data will be NULL. |
Additional Inherited Members | |
![]() | |
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 void | notifyDataChange (boost::shared_ptr< WModuleConnector > input, boost::shared_ptr< WModuleConnector > output) |
Gets called when the data on this input connector changed. | |
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 | setUpdated () |
Sets the update flag (use updated() to query it)to true. | |
![]() | |
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 offering an instantiate-able data connection between modules.
Due to is template style it is possible to bind nearly arbitrary data.
Definition at line 49 of file WModuleInputData.h.
typedef boost::shared_ptr< WModuleInputData< T > > WModuleInputData< T >::PtrType |
typedef WModuleInputData< T >& WModuleInputData< T >::RefType |
Reference to this type.
Definition at line 60 of file WModuleInputData.h.
typedef T WModuleInputData< T >::TransferType |
Typedef to the contained transferable.
Definition at line 70 of file WModuleInputData.h.
typedef WModuleInputData< T > WModuleInputData< T >::Type |
Type of the connector.
Definition at line 65 of file WModuleInputData.h.
|
inline |
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 102 of file WModuleInputData.h.
|
inlinevirtual |
Destructor.
Definition at line 111 of file WModuleInputData.h.
|
inlinevirtual |
Checks whether the specified connector is an input connector and compatible with T.
con | the connector to check against. |
Reimplemented from WModuleInputConnector.
Definition at line 166 of file WModuleInputData.h.
References WModuleInputConnector::connectable().
|
static |
Convenience method to create a new instance of this in data connector with proper type.
module | the module owning this instance |
name | the name of this connector. |
description | the description of this connector. |
Reimplemented in WModuleInputForwardData< T >.
Definition at line 204 of file WModuleInputData.h.
|
static |
Convenience method to create a new instance of this in data connector with proper type and add it to the list of connectors of the specified module.
module | the module owning this instance |
name | the name of this connector. |
description | the description of this connector. |
Reimplemented in WModuleInputForwardData< T >.
Definition at line 213 of file WModuleInputData.h.
|
virtual |
Disconnects this connector if connected.
If it is not connected: nothing happens.
con | the connector to disconnect. |
removeFromOwnList | if true the specified connection is also removed from the own connection list. If false it won't. |
Reimplemented from WModuleConnector.
Definition at line 196 of file WModuleInputData.h.
References WModuleConnector::disconnect().
|
inline |
Gives the currently set data and resets the update flag.
reset | reset the flag of updated() if true (default). |
Definition at line 130 of file WModuleInputData.h.
References WModuleInputConnector::handledUpdate(), WModuleConnector::m_connected, WModuleConnector::m_connectionListLock, and WModuleInputData< T >::m_disconnecting.
|
private |
If true, the returned data will be NULL.
Needed because disconnection process is based on multiple steps.
Definition at line 183 of file WModuleInputData.h.
Referenced by WModuleInputData< T >::getData().