OpenWalnut
1.4.0
|
Class offering an instantiate-able data connection between modules. More...
#include <WModuleOutputData.h>
Public Types | |
typedef boost::shared_ptr < WModuleOutputData< T > > | PtrType |
Pointer to this. | |
typedef boost::shared_ptr < WModuleOutputData< T > > | SPtr |
Pointer to this. | |
typedef boost::shared_ptr < const WModuleOutputData< T > > | ConstSPtr |
Pointer to this. | |
typedef WModuleOutputData< T > & | RefType |
Reference to this type. | |
typedef WModuleOutputData< T > | Type |
Type of the connector. | |
typedef T | TransferType |
Typedef to the contained transferable. | |
Public Member Functions | |
WModuleOutputData (boost::shared_ptr< WModule > module, std::string name="", std::string description="") | |
Constructor. | |
virtual | ~WModuleOutputData () |
Destructor. | |
virtual void | updateData (boost::shared_ptr< T > data) |
Update the data associated. | |
virtual void | reset () |
Resets the data on this output. | |
virtual void | triggerUpdate () |
This method simply propagates an update but does not actually change the data. | |
virtual const boost::shared_ptr < WTransferable > | getRawData () const |
Gives back the currently set data as WTransferable. | |
const boost::shared_ptr< T > | getData () const |
Gives back the currently set data. | |
virtual bool | connectable (boost::shared_ptr< WModuleConnector > con) |
Checks whether the specified connector is an input connector and compatible with T. | |
virtual boost::shared_ptr < WPrototyped > | getTransferPrototype () |
Returns the prototype of the Type T used in this 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 out 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 out data connector with proper type and add it to the list of connectors of the specified module. | |
Private Attributes | |
boost::shared_ptr< T > | m_data |
The data associated with this connector. |
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 47 of file WModuleOutputData.h.
typedef boost::shared_ptr< const WModuleOutputData< T > > WModuleOutputData< T >::ConstSPtr |
Pointer to this.
For convenience.
Reimplemented from WModuleConnector.
Reimplemented in WModuleOutputForwardData< T >.
Definition at line 63 of file WModuleOutputData.h.
typedef boost::shared_ptr< WModuleOutputData< T > > WModuleOutputData< T >::PtrType |
Pointer to this.
For convenience.
Reimplemented in WModuleOutputForwardData< T >.
Definition at line 53 of file WModuleOutputData.h.
typedef WModuleOutputData< T >& WModuleOutputData< T >::RefType |
Reference to this type.
Reimplemented in WModuleOutputForwardData< T >.
Definition at line 68 of file WModuleOutputData.h.
typedef boost::shared_ptr< WModuleOutputData< T > > WModuleOutputData< T >::SPtr |
Pointer to this.
For convenience.
Reimplemented from WModuleConnector.
Reimplemented in WModuleOutputForwardData< T >.
Definition at line 58 of file WModuleOutputData.h.
typedef T WModuleOutputData< T >::TransferType |
Typedef to the contained transferable.
Reimplemented in WModuleOutputForwardData< T >.
Definition at line 78 of file WModuleOutputData.h.
typedef WModuleOutputData< T > WModuleOutputData< T >::Type |
Type of the connector.
Reimplemented in WModuleOutputForwardData< T >.
Definition at line 73 of file WModuleOutputData.h.
WModuleOutputData< T >::WModuleOutputData | ( | boost::shared_ptr< WModule > | module, |
std::string | name = "" , |
||
std::string | description = "" |
||
) | [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 110 of file WModuleOutputData.h.
References WModuleOutputData< T >::m_data.
virtual WModuleOutputData< T >::~WModuleOutputData | ( | ) | [inline, virtual] |
Destructor.
Definition at line 119 of file WModuleOutputData.h.
virtual bool WModuleOutputData< T >::connectable | ( | boost::shared_ptr< WModuleConnector > | con | ) | [inline, virtual] |
Checks whether the specified connector is an input connector and compatible with T.
con | the connector to check against. |
Reimplemented from WModuleOutputConnector.
Definition at line 180 of file WModuleOutputData.h.
WModuleOutputData< T >::PtrType WModuleOutputData< T >::create | ( | boost::shared_ptr< WModule > | module, |
std::string | name = "" , |
||
std::string | description = "" |
||
) | [static] |
Convenience method to create a new instance of this out 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 WModuleOutputForwardData< T >.
Definition at line 206 of file WModuleOutputData.h.
WModuleOutputData< T >::PtrType WModuleOutputData< T >::createAndAdd | ( | boost::shared_ptr< WModule > | module, |
std::string | name = "" , |
||
std::string | description = "" |
||
) | [static] |
Convenience method to create a new instance of this out 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 WModuleOutputForwardData< T >.
Definition at line 215 of file WModuleOutputData.h.
const boost::shared_ptr< T > WModuleOutputData< T >::getData | ( | ) | const [inline] |
Gives back the currently set data.
Definition at line 168 of file WModuleOutputData.h.
References WModuleOutputData< T >::m_data.
Referenced by WModuleImpl::notifyDataChange().
virtual const boost::shared_ptr< WTransferable > WModuleOutputData< T >::getRawData | ( | ) | const [inline, virtual] |
Gives back the currently set data as WTransferable.
Implements WModuleOutputConnector.
Definition at line 158 of file WModuleOutputData.h.
References WModuleOutputData< T >::m_data.
virtual boost::shared_ptr< WPrototyped > WModuleOutputData< T >::getTransferPrototype | ( | ) | [inline, virtual] |
Returns the prototype of the Type T used in this connector.
Implements WModuleOutputConnector.
Definition at line 191 of file WModuleOutputData.h.
References WModuleOutputData< T >::m_data.
virtual void WModuleOutputData< T >::reset | ( | ) | [inline, virtual] |
Resets the data on this output.
It actually sets NULL and triggers an update.
Definition at line 139 of file WModuleOutputData.h.
References WModuleOutputData< T >::updateData().
virtual void WModuleOutputData< T >::triggerUpdate | ( | ) | [inline, virtual] |
This method simply propagates an update but does not actually change the data.
Definition at line 147 of file WModuleOutputData.h.
References WModuleOutputConnector::propagateDataChange().
Referenced by WModuleOutputData< T >::updateData().
virtual void WModuleOutputData< T >::updateData | ( | boost::shared_ptr< T > | data | ) | [inline, virtual] |
Update the data associated.
data | the data do send |
Definition at line 128 of file WModuleOutputData.h.
References WModuleOutputData< T >::m_data, and WModuleOutputData< T >::triggerUpdate().
Referenced by WModuleOutputForwardData< T >::inputNotifyDataChange(), and WModuleOutputData< T >::reset().
boost::shared_ptr< T > WModuleOutputData< T >::m_data [private] |
The data associated with this connector.
Definition at line 195 of file WModuleOutputData.h.
Referenced by WModuleOutputData< T >::getData(), WModuleOutputData< T >::getRawData(), WModuleOutputData< T >::getTransferPrototype(), WModuleOutputData< T >::updateData(), and WModuleOutputData< T >::WModuleOutputData().