OpenWalnut
1.5.0dev
|
This is a simple class which forwards input data to input data connectors. More...
#include <WModuleInputForwardData.h>
Public Types | |
typedef std::shared_ptr< WModuleInputForwardData< T > > | SPtr |
Pointer to this. More... | |
typedef std::shared_ptr< const WModuleInputForwardData< T > > | ConstSPtr |
Pointer to this. More... | |
typedef SPtr | PtrType |
Pointer to this. More... | |
typedef WModuleInputForwardData< T > & | RefType |
Reference to this type. More... | |
typedef WModuleInputForwardData< T > | Type |
Type of the connector. More... | |
typedef T | TransferType |
Typedef to the contained transferable. More... | |
Public Types inherited from WModuleInputData< T > | |
typedef std::shared_ptr< WModuleInputData< T > > | PtrType |
Pointer to this. More... | |
typedef std::shared_ptr< WModuleInputData< T > > | SPtr |
Pointer to this. More... | |
typedef std::shared_ptr< const WModuleInputData< T > > | ConstSPtr |
Pointer to this. More... | |
typedef WModuleInputData< T > & | RefType |
Reference to this type. More... | |
typedef WModuleInputData< T > | Type |
Type of the connector. More... | |
typedef T | TransferType |
Typedef to the contained transferable. More... | |
Public Types inherited from WModuleConnector | |
typedef std::shared_ptr< WModuleConnector > | SPtr |
Shared pointer to this class. More... | |
typedef std::shared_ptr< const WModuleConnector > | ConstSPtr |
Const shared pointer to this class. More... | |
Public Member Functions | |
WModuleInputForwardData (std::shared_ptr< WModule > module, std::string name="", std::string description="") | |
Constructor. More... | |
virtual | ~WModuleInputForwardData () |
Destructor. More... | |
virtual void | forward (std::shared_ptr< WModuleConnector > to) |
Forward the input to the specified input. More... | |
virtual void | unforward (std::shared_ptr< WModuleConnector > to) |
Remove the specified connector from the forwarding list. More... | |
Public Member Functions inherited from WModuleInputData< T > | |
WModuleInputData (std::shared_ptr< WModule > module, std::string name="", std::string description="") | |
Constructor. More... | |
virtual | ~WModuleInputData () |
Destructor. More... | |
virtual void | disconnect (std::shared_ptr< WModuleConnector > con, bool removeFromOwnList=true) |
Disconnects this connector if connected. More... | |
const std::shared_ptr< T > | getData (bool reset=true) |
Gives the currently set data and resets the update flag. More... | |
virtual bool | connectable (std::shared_ptr< WModuleConnector > con) |
Checks whether the specified connector is an input connector and compatible with T. More... | |
Public Member Functions inherited from WModuleInputConnector | |
WModuleInputConnector (std::shared_ptr< WModule > module, std::string name="", std::string description="") | |
Constructor. More... | |
virtual | ~WModuleInputConnector () |
Destructor. More... | |
virtual bool | lazyConnectable (std::shared_ptr< WModuleConnector > con) |
Checks whether the specified connector is connectable to this one, but ignores compatibility the type to be transferred. More... | |
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. More... | |
virtual bool | isInputConnector () const |
Returns true if this instance is an WModuleInputConnector. More... | |
virtual bool | isOutputConnector () const |
Returns true if this instance is an WModuleOutputConnector. More... | |
virtual bool | updated () |
Denotes whether the connected output was updated. More... | |
virtual bool | handledUpdate () |
Resets the updated-flag. More... | |
Public Member Functions inherited from WModuleConnector | |
WModuleConnector (std::shared_ptr< WModule > module, std::string name="", std::string description="") | |
Constructor. More... | |
virtual | ~WModuleConnector () |
Destructor. More... | |
std::shared_ptr< WModule > | getModule () const |
Returns the module which owns this connector. More... | |
virtual void | disconnectAll () |
Disconnects ALL connected connectors. More... | |
virtual void | connect (std::shared_ptr< WModuleConnector > con, bool force=false) |
Connects this Module Connector with another one. More... | |
bool | isConnectedTo (std::shared_ptr< WModuleConnector > con) |
Checks whether this connector is connected to the given one. More... | |
unsigned int | isConnected () |
Gets the count of connections currently established. More... | |
const std::string | getDescription () const |
Gives information about this connection. More... | |
void | setDescription (std::string desc) |
Sets the connector's description. More... | |
const std::string | getName () const |
Gives name of connection. More... | |
const std::string | getCanonicalName () const |
Gives canonical name of connection. More... | |
void | setName (std::string name) |
Sets the connector's name. More... | |
WCombinerTypes::WOneToOneCombiners | getPossibleDisconnections () |
Returns a list of possible disconnections for this connector. More... | |
std::shared_ptr< WModuleInputConnector > | toInputConnector () |
Tries to convert this instance to an input connector. More... | |
std::shared_ptr< WModuleOutputConnector > | toOutputConnector () |
Tries to convert this instance to an output connector. More... | |
std::shared_ptr< WCondition > | getDataChangedCondition () |
Gets the condition variable that gets fired whenever new data has been sent. More... | |
Static Public Member Functions | |
static PtrType | create (std::shared_ptr< WModule > module, std::string name="", std::string description="") |
Convenience method to create a new instance of this in forward data connector with proper type. More... | |
static PtrType | createAndAdd (std::shared_ptr< WModule > module, std::string name="", std::string description="") |
Convenience method to create a new instance of this in forward data connector with proper type and add it to the list of connectors of the specified module. More... | |
Static Public Member Functions inherited from WModuleInputData< T > | |
static PtrType | create (std::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. More... | |
static PtrType | createAndAdd (std::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. More... | |
Protected Member Functions | |
virtual void | notifyDataChange (std::shared_ptr< WModuleConnector > input, std::shared_ptr< WModuleConnector > output) |
Gets called whenever a connected output updates its data. More... | |
virtual void | notifyConnectionClosed (std::shared_ptr< WModuleConnector > here, std::shared_ptr< WModuleConnector > there) |
Gets called whenever a connection between a remote and local connector gets closed. More... | |
Protected Member Functions inherited from WModuleInputConnector | |
virtual void | connectSignals (std::shared_ptr< WModuleConnector > con) |
Connect additional signals. More... | |
virtual void | disconnectSignals (std::shared_ptr< WModuleConnector > con) |
Disconnect all signals subscribed by this connector from "con". More... | |
virtual void | notifyConnectionEstablished (std::shared_ptr< WModuleConnector > here, std::shared_ptr< WModuleConnector > there) |
Gets called whenever a connector gets connected to the specified input. More... | |
virtual void | setUpdated () |
Sets the update flag (use updated() to query it)to true. More... | |
Protected Member Functions inherited from WModuleConnector | |
virtual const t_GenericSignalHandlerType | getSignalHandler (MODULE_CONNECTOR_SIGNAL signal) |
Gives the signal handler function responsible for a given signal. More... | |
Protected Attributes | |
std::shared_ptr< WModuleOutputData< T > > | m_out |
The output connector which collects data and distributes it to all connectors connected using the forwardTo() method. More... | |
Protected Attributes inherited from WModuleConnector | |
std::set< std::shared_ptr< WModuleConnector > > | m_connected |
List of connectors connected to this connector. More... | |
std::shared_mutex | m_connectionListLock |
Lock for avoiding concurrent write to m_Connected (multiple reader, single writer lock). More... | |
std::weak_ptr< WModule > | m_module |
The Module this connector belongs to. More... | |
std::string | m_moduleName |
The name of the module owning this connector. More... | |
t_GenericSignalType | signal_ConnectionEstablished |
Signal emitted whenever connection has been established. More... | |
t_GenericSignalType | signal_ConnectionClosed |
Signal emitted whenever connection has been closed. More... | |
std::shared_ptr< WCondition > | m_dataChangedCondition |
Condition fired whenever data changes. More... | |
This is a simple class which forwards input data to input data connectors.
It itself is a input data connector and can be used as one, but also provides the possibility to forward data changes to other input data connectors, using a separate output data connector (which is not visible to the outside world).
Definition at line 42 of file WModuleInputForwardData.h.
typedef std::shared_ptr< const WModuleInputForwardData< T > > WModuleInputForwardData< T >::ConstSPtr |
typedef SPtr WModuleInputForwardData< T >::PtrType |
typedef WModuleInputForwardData< T >& WModuleInputForwardData< T >::RefType |
Reference to this type.
Definition at line 63 of file WModuleInputForwardData.h.
typedef std::shared_ptr< WModuleInputForwardData< T > > WModuleInputForwardData< T >::SPtr |
typedef T WModuleInputForwardData< T >::TransferType |
Typedef to the contained transferable.
Definition at line 73 of file WModuleInputForwardData.h.
typedef WModuleInputForwardData< T > WModuleInputForwardData< T >::Type |
Type of the connector.
Definition at line 68 of file WModuleInputForwardData.h.
|
inline |
Constructor.
This creates a new input data connector which is able to forward data changes TO other input data connectors.
module | the module which is owner of this connector. |
name | The name of this connector. |
description | Short description of this connector. |
Definition at line 82 of file WModuleInputForwardData.h.
References WModuleInputForwardData< T >::m_out.
|
inlinevirtual |
Destructor.
Definition at line 92 of file WModuleInputForwardData.h.
|
inlinestatic |
Convenience method to create a new instance of this in forward data connector with proper type.
module | The module owning this instance |
name | The name of this connector. |
description | The description of this connector. |
Definition at line 178 of file WModuleInputForwardData.h.
|
inlinestatic |
Convenience method to create a new instance of this in forward 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. |
Definition at line 186 of file WModuleInputForwardData.h.
Referenced by WMDiffTensorScalars::connectors(), and WMTemplateContainers::connectors().
|
inlinevirtual |
Forward the input to the specified input.
The specified input must be compatible with the template parameter of this input.
to | the input connector to forward data to. |
Definition at line 101 of file WModuleInputForwardData.h.
References WModuleInputForwardData< T >::m_out.
Referenced by WMTemplateContainers::moduleMain().
|
inlineprotectedvirtual |
Gets called whenever a connection between a remote and local connector gets closed.
This is used here to forward the NULL data.
here | the connector of THIS module getting disconnected. |
there | the connector of the other module getting disconnected. |
Reimplemented from WModuleConnector.
Definition at line 166 of file WModuleInputForwardData.h.
References WModuleInputForwardData< T >::m_out, and WModuleConnector::notifyConnectionClosed().
|
inlineprotectedvirtual |
Gets called whenever a connected output updates its data.
This method uses this callback to update the m_out connector to inform all inputs to which the data should be forwarded.
input | the input connector receiving the change |
output | the output connector sending the change |
Reimplemented from WModuleInputConnector.
Definition at line 152 of file WModuleInputForwardData.h.
References WModuleInputForwardData< T >::m_out, and WModuleInputConnector::notifyDataChange().
|
inlinevirtual |
Remove the specified connector from the forwarding list.
to | the input connector to be removed from forwarding list. |
Definition at line 111 of file WModuleInputForwardData.h.
References WModuleInputForwardData< T >::m_out.
|
protected |
The output connector which collects data and distributes it to all connectors connected using the forwardTo() method.
Definition at line 143 of file WModuleInputForwardData.h.
Referenced by WModuleInputForwardData< T >::forward(), WModuleInputForwardData< T >::notifyConnectionClosed(), WModuleInputForwardData< T >::notifyDataChange(), WModuleInputForwardData< T >::unforward(), and WModuleInputForwardData< T >::WModuleInputForwardData().