OpenWalnut  1.4.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
WModuleInputForwardData< T > Class Template Reference

This is a simple class which forwards input data to input data connectors. More...

#include <WModuleInputForwardData.h>

+ Inheritance diagram for WModuleInputForwardData< T >:

List of all members.

Public Types

typedef boost::shared_ptr
< WModuleInputForwardData< T > > 
PtrType
 Pointer to this.
typedef
WModuleInputForwardData< T > & 
RefType
 Reference to this type.
typedef
WModuleInputForwardData< T > 
Type
 Type of the connector.
typedef T TransferType
 Typedef to the contained transferable.

Public Member Functions

 WModuleInputForwardData (boost::shared_ptr< WModule > module, std::string name="", std::string description="")
 Constructor.
virtual ~WModuleInputForwardData ()
 Destructor.
virtual void forward (boost::shared_ptr< WModuleConnector > to)
 Forward the input to the specified input.
virtual void unforward (boost::shared_ptr< WModuleConnector > to)
 Remove the specified connector from the forwarding list.

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 forward 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 forward data connector with proper type and add it to the list of connectors of the specified module.

Protected Member Functions

virtual void notifyDataChange (boost::shared_ptr< WModuleConnector > input, boost::shared_ptr< WModuleConnector > output)
 Gets called whenever a connected output updates its data.
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.

Protected Attributes

boost::shared_ptr
< WModuleOutputData< T > > 
m_out
 The output connector which collects data and distributes it to all connectors connected using the forwardTo() method.

Detailed Description

template<typename T>
class WModuleInputForwardData< T >

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 43 of file WModuleInputForwardData.h.


Member Typedef Documentation

template<typename T>
typedef boost::shared_ptr< WModuleInputForwardData< T > > WModuleInputForwardData< T >::PtrType

Pointer to this.

For convenience.

Reimplemented from WModuleInputData< T >.

Definition at line 49 of file WModuleInputForwardData.h.

template<typename T>
typedef WModuleInputForwardData< T >& WModuleInputForwardData< T >::RefType

Reference to this type.

Reimplemented from WModuleInputData< T >.

Definition at line 54 of file WModuleInputForwardData.h.

template<typename T>
typedef T WModuleInputForwardData< T >::TransferType

Typedef to the contained transferable.

Reimplemented from WModuleInputData< T >.

Definition at line 64 of file WModuleInputForwardData.h.

template<typename T>
typedef WModuleInputForwardData< T > WModuleInputForwardData< T >::Type

Type of the connector.

Reimplemented from WModuleInputData< T >.

Definition at line 59 of file WModuleInputForwardData.h.


Constructor & Destructor Documentation

template<typename T>
WModuleInputForwardData< T >::WModuleInputForwardData ( boost::shared_ptr< WModule module,
std::string  name = "",
std::string  description = "" 
) [inline]

Constructor.

This creates a new input data connector which is able to forward data changes TO other input data connectors.

Parameters:
modulethe module which is owner of this connector.
nameThe name of this connector.
descriptionShort description of this connector.

Definition at line 73 of file WModuleInputForwardData.h.

References WModuleInputForwardData< T >::m_out.

template<typename T>
virtual WModuleInputForwardData< T >::~WModuleInputForwardData ( ) [inline, virtual]

Destructor.

Definition at line 83 of file WModuleInputForwardData.h.


Member Function Documentation

template<typename T >
WModuleInputForwardData< T >::PtrType WModuleInputForwardData< T >::create ( boost::shared_ptr< WModule module,
std::string  name = "",
std::string  description = "" 
) [inline, static]

Convenience method to create a new instance of this in forward data connector with proper type.

Parameters:
moduleThe module owning this instance
nameThe name of this connector.
descriptionThe description of this connector.
Returns:
The pointer to the created forward connector.

Reimplemented from WModuleInputData< T >.

Definition at line 169 of file WModuleInputForwardData.h.

template<typename T >
WModuleInputForwardData< T >::PtrType WModuleInputForwardData< T >::createAndAdd ( boost::shared_ptr< WModule module,
std::string  name = "",
std::string  description = "" 
) [inline, static]

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.

Parameters:
moduleThe module owning this instance
nameThe name of this connector.
descriptionThe description of this connector.
Returns:
The pointer to the created forward connector.

Reimplemented from WModuleInputData< T >.

Definition at line 177 of file WModuleInputForwardData.h.

template<typename T>
virtual void WModuleInputForwardData< T >::forward ( boost::shared_ptr< WModuleConnector to) [inline, virtual]

Forward the input to the specified input.

The specified input must be compatible with the template parameter of this input.

Parameters:
tothe input connector to forward data to.

Definition at line 92 of file WModuleInputForwardData.h.

References WModuleInputForwardData< T >::m_out.

template<typename T>
virtual void WModuleInputForwardData< T >::notifyConnectionClosed ( boost::shared_ptr< WModuleConnector here,
boost::shared_ptr< WModuleConnector there 
) [inline, protected, virtual]

Gets called whenever a connection between a remote and local connector gets closed.

This is used here to forward the NULL data.

Parameters:
herethe connector of THIS module getting disconnected.
therethe connector of the other module getting disconnected.

Reimplemented from WModuleConnector.

Definition at line 157 of file WModuleInputForwardData.h.

References WModuleInputForwardData< T >::m_out.

template<typename T>
virtual void WModuleInputForwardData< T >::notifyDataChange ( boost::shared_ptr< WModuleConnector input,
boost::shared_ptr< WModuleConnector output 
) [inline, protected, virtual]

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.

Parameters:
inputthe input connector receiving the change
outputthe output connector sending the change

Reimplemented from WModuleInputConnector.

Definition at line 143 of file WModuleInputForwardData.h.

References WModuleInputForwardData< T >::m_out.

template<typename T>
virtual void WModuleInputForwardData< T >::unforward ( boost::shared_ptr< WModuleConnector to) [inline, virtual]

Remove the specified connector from the forwarding list.

Parameters:
tothe input connector to be removed from forwarding list.

Definition at line 102 of file WModuleInputForwardData.h.

References WModuleInputForwardData< T >::m_out.


Member Data Documentation

template<typename T>
boost::shared_ptr< WModuleOutputData< T > > 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 134 of file WModuleInputForwardData.h.

Referenced by WModuleInputForwardData< T >::forward(), WModuleInputForwardData< T >::notifyConnectionClosed(), WModuleInputForwardData< T >::notifyDataChange(), WModuleInputForwardData< T >::unforward(), and WModuleInputForwardData< T >::WModuleInputForwardData().


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