OpenWalnut  1.2.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
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 Types inherited from WModuleInputData< T >

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.
- Public Member Functions inherited from WModuleInputData< T >
 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.
- Public Member Functions inherited from WModuleInputConnector
 WModuleInputConnector (boost::shared_ptr< WModule > module, std::string name="", std::string description="")
 Constructor.
virtual ~WModuleInputConnector ()
 Destructor.
boost::shared_ptr< WConditiongetDataChangedCondition ()
 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.
- Public Member Functions inherited from WModuleConnector
 WModuleConnector (boost::shared_ptr< WModule > module, std::string name="", std::string description="")
 Constructor.
virtual ~WModuleConnector ()
 Destructor.
boost::shared_ptr< WModulegetModule () 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 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 ( )
inlinevirtual

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 = "" 
)
inlinestatic

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

template<typename T >
WModuleInputForwardData< T >::PtrType WModuleInputForwardData< T >::createAndAdd ( boost::shared_ptr< WModule module,
std::string  name = "",
std::string  description = "" 
)
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.

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

template<typename T>
virtual void WModuleInputForwardData< T >::forward ( boost::shared_ptr< WModuleConnector to)
inlinevirtual

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 
)
inlineprotectedvirtual

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 158 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 
)
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.

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

Reimplemented from WModuleInputConnector.

Definition at line 144 of file WModuleInputForwardData.h.

References WModuleInputForwardData< T >::m_out.

template<typename T>
virtual void WModuleInputForwardData< T >::unforward ( boost::shared_ptr< WModuleConnector to)
inlinevirtual

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 135 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: