OpenWalnut  1.4.0
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
WModuleInputData< T > Class Template Reference

Class offering an instantiate-able data connection between modules. More...

#include <WModuleInputData.h>

+ Inheritance diagram for WModuleInputData< T >:

List of all members.

Public Types

typedef boost::shared_ptr
< WModuleInputData< T > > 
PtrType
 Pointer to this.
typedef boost::shared_ptr
< WModuleInputData< T > > 
SPtr
 Pointer to this.
typedef boost::shared_ptr
< const WModuleInputData< T > > 
ConstSPtr
 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.

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.

Detailed Description

template<typename T>
class WModuleInputData< T >

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 48 of file WModuleInputData.h.


Member Typedef Documentation

template<typename T>
typedef boost::shared_ptr< const WModuleInputData< T > > WModuleInputData< T >::ConstSPtr

Pointer to this.

For convenience.

Reimplemented from WModuleConnector.

Definition at line 64 of file WModuleInputData.h.

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

Pointer to this.

For convenience.

Reimplemented in WModuleInputForwardData< T >.

Definition at line 54 of file WModuleInputData.h.

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

Reference to this type.

Reimplemented in WModuleInputForwardData< T >.

Definition at line 69 of file WModuleInputData.h.

template<typename T>
typedef boost::shared_ptr< WModuleInputData< T > > WModuleInputData< T >::SPtr

Pointer to this.

For convenience.

Reimplemented from WModuleConnector.

Definition at line 59 of file WModuleInputData.h.

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

Typedef to the contained transferable.

Reimplemented in WModuleInputForwardData< T >.

Definition at line 79 of file WModuleInputData.h.

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

Type of the connector.

Reimplemented in WModuleInputForwardData< T >.

Definition at line 74 of file WModuleInputData.h.


Constructor & Destructor Documentation

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

Constructor.

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

Definition at line 111 of file WModuleInputData.h.

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

Destructor.

Definition at line 120 of file WModuleInputData.h.


Member Function Documentation

template<typename T>
virtual bool WModuleInputData< T >::connectable ( boost::shared_ptr< WModuleConnector con) [inline, virtual]

Checks whether the specified connector is an input connector and compatible with T.

Parameters:
conthe connector to check against.
Returns:
true if compatible.

Reimplemented from WModuleInputConnector.

Definition at line 175 of file WModuleInputData.h.

References WModuleInputConnector::connectable().

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

Convenience method to create a new instance of this in 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 connector.

Reimplemented in WModuleInputForwardData< T >.

Definition at line 211 of file WModuleInputData.h.

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

Parameters:
modulethe module owning this instance
namethe name of this connector.
descriptionthe description of this connector.
Returns:
the pointer to the created connector.

Reimplemented in WModuleInputForwardData< T >.

Definition at line 220 of file WModuleInputData.h.

template<typename T >
void WModuleInputData< T >::disconnect ( boost::shared_ptr< WModuleConnector con,
bool  removeFromOwnList = true 
) [virtual]

Disconnects this connector if connected.

If it is not connected: nothing happens.

Parameters:
conthe connector to disconnect.
removeFromOwnListif true the specified connection is also removed from the own connection list. If false it won't.

Reimplemented from WModuleConnector.

Definition at line 203 of file WModuleInputData.h.

References WModuleConnector::disconnect().

template<typename T>
const boost::shared_ptr< T > WModuleInputData< T >::getData ( bool  reset = true) [inline]

Gives the currently set data and resets the update flag.

Parameters:
resetreset the flag of updated() if true (default).
Returns:
the data currently set. NULL if no data has been sent yet or the connector is unconnected.

Definition at line 139 of file WModuleInputData.h.

References WModuleInputConnector::handledUpdate(), WModuleConnector::m_connected, WModuleConnector::m_connectionListLock, and WModuleInputData< T >::m_disconnecting.


Member Data Documentation

template<typename T>
bool 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 192 of file WModuleInputData.h.

Referenced by WModuleInputData< T >::getData().


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