OpenWalnut  1.5.0dev
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
WModuleOutputData< T > Class Template Reference

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

#include <WModuleOutputData.h>

+ Inheritance diagram for WModuleOutputData< T >:
+ Collaboration diagram for WModuleOutputData< T >:

Public Types

typedef std::shared_ptr< WModuleOutputData< T > > PtrType
 Pointer to this. More...
 
typedef std::shared_ptr< WModuleOutputData< T > > SPtr
 Pointer to this. More...
 
typedef std::shared_ptr< const WModuleOutputData< T > > ConstSPtr
 Pointer to this. More...
 
typedef WModuleOutputData< T > & RefType
 Reference to this type. More...
 
typedef WModuleOutputData< 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< WModuleConnectorSPtr
 Shared pointer to this class. More...
 
typedef std::shared_ptr< const WModuleConnectorConstSPtr
 Const shared pointer to this class. More...
 

Public Member Functions

 WModuleOutputData (std::shared_ptr< WModule > module, std::string name="", std::string description="")
 Constructor. More...
 
virtual ~WModuleOutputData ()
 Destructor. More...
 
virtual void updateData (std::shared_ptr< T > data)
 Update the data associated. More...
 
virtual void reset ()
 Resets the data on this output. More...
 
virtual void triggerUpdate ()
 This method simply propagates an update but does not actually change the data. More...
 
virtual const std::shared_ptr< WTransferablegetRawData () const
 Gives back the currently set data as WTransferable. More...
 
const std::shared_ptr< T > getData () const
 Gives back the currently set data. More...
 
virtual bool connectable (std::shared_ptr< WModuleConnector > con)
 Checks whether the specified connector is an input connector and compatible with T. More...
 
virtual std::shared_ptr< WPrototypedgetTransferPrototype ()
 Returns the prototype of the Type T used in this connector. More...
 
- Public Member Functions inherited from WModuleOutputConnector
 WModuleOutputConnector (std::shared_ptr< WModule > module, std::string name="", std::string description="")
 Constructor. More...
 
virtual ~WModuleOutputConnector ()
 Destructor. 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 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...
 
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...
 
- 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< WModulegetModule () const
 Returns the module which owns this connector. More...
 
virtual void disconnect (std::shared_ptr< WModuleConnector > con, bool removeFromOwnList=true)
 Disconnects this connector if connected. 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< WModuleInputConnectortoInputConnector ()
 Tries to convert this instance to an input connector. More...
 
std::shared_ptr< WModuleOutputConnectortoOutputConnector ()
 Tries to convert this instance to an output connector. More...
 
std::shared_ptr< WConditiongetDataChangedCondition ()
 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 out 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 out data connector with proper type and add it to the list of connectors of the specified module. More...
 

Protected Attributes

std::shared_ptr< T > m_data
 The data associated with this connector. 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< WModulem_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< WConditionm_dataChangedCondition
 Condition fired whenever data changes. More...
 

Additional Inherited Members

- Protected Member Functions inherited from WModuleOutputConnector
virtual void propagateDataChange ()
 Propagates the signal "DATA_CHANGED" to all connected items. More...
 
- Protected Member Functions inherited from WModuleConnector
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 const t_GenericSignalHandlerType getSignalHandler (MODULE_CONNECTOR_SIGNAL signal)
 Gives the signal handler function responsible for a given signal. 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 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...
 

Detailed Description

template<typename T>
class WModuleOutputData< 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 43 of file WModuleOutputData.h.

Member Typedef Documentation

◆ ConstSPtr

template<typename T >
typedef std::shared_ptr< const WModuleOutputData< T > > WModuleOutputData< T >::ConstSPtr

Pointer to this.

For convenience.

Definition at line 59 of file WModuleOutputData.h.

◆ PtrType

template<typename T >
typedef std::shared_ptr< WModuleOutputData< T > > WModuleOutputData< T >::PtrType

Pointer to this.

For convenience.

Definition at line 49 of file WModuleOutputData.h.

◆ RefType

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

Reference to this type.

Definition at line 64 of file WModuleOutputData.h.

◆ SPtr

template<typename T >
typedef std::shared_ptr< WModuleOutputData< T > > WModuleOutputData< T >::SPtr

Pointer to this.

For convenience.

Definition at line 54 of file WModuleOutputData.h.

◆ TransferType

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

Typedef to the contained transferable.

Definition at line 74 of file WModuleOutputData.h.

◆ Type

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

Type of the connector.

Definition at line 69 of file WModuleOutputData.h.

Constructor & Destructor Documentation

◆ WModuleOutputData()

template<typename T >
WModuleOutputData< T >::WModuleOutputData ( std::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 106 of file WModuleOutputData.h.

References WModuleOutputData< T >::m_data.

◆ ~WModuleOutputData()

template<typename T >
virtual WModuleOutputData< T >::~WModuleOutputData ( )
inlinevirtual

Destructor.

Definition at line 115 of file WModuleOutputData.h.

Member Function Documentation

◆ connectable()

template<typename T >
virtual bool WModuleOutputData< T >::connectable ( std::shared_ptr< WModuleConnector con)
inlinevirtual

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 WModuleOutputConnector.

Definition at line 176 of file WModuleOutputData.h.

References WModuleOutputConnector::connectable().

+ Here is the call graph for this function:

◆ create()

template<typename T >
WModuleOutputData< T >::PtrType WModuleOutputData< T >::create ( std::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.

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

Definition at line 204 of file WModuleOutputData.h.

Referenced by WMFilterProtonData::connectors(), and WMPointConnector::connectors().

+ Here is the caller graph for this function:

◆ createAndAdd()

template<typename T >
WModuleOutputData< T >::PtrType WModuleOutputData< T >::createAndAdd ( std::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.

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

Definition at line 213 of file WModuleOutputData.h.

Referenced by WMDataCreatorFibers::connectors(), WMDataCreatorPoints::connectors(), WMDataCreatorScalar::connectors(), WMDataCreatorVector::connectors(), WMDiffTensorScalars::connectors(), WMFiberResampling::connectors(), WMFilterProtonData::connectors(), WMPartition2Mesh::connectors(), WMMergeComponentsToVector::connectors(), WMMergePoints::connectors(), WMPointConnector::connectors(), WMReadVCL::connectors(), WMScalarOperator::connectors(), WMSpatialDerivative::connectors(), WMVectorAlign::connectors(), WMVectorNormalize::connectors(), WMVectorOperator::connectors(), WMVectorScale::connectors(), and WMVoxelizer::connectors().

+ Here is the caller graph for this function:

◆ getData()

template<typename T >
const std::shared_ptr< T > WModuleOutputData< T >::getData ( ) const
inline

Gives back the currently set data.

Returns
the data. If no data has been set: a NULL pointer is returned.

Definition at line 164 of file WModuleOutputData.h.

References WModuleOutputData< T >::m_data.

◆ getRawData()

template<typename T >
virtual const std::shared_ptr< WTransferable > WModuleOutputData< T >::getRawData ( ) const
inlinevirtual

Gives back the currently set data as WTransferable.

Returns
the data. If no data has been set: a NULL pointer is returned.

Implements WModuleOutputConnector.

Definition at line 154 of file WModuleOutputData.h.

References WModuleOutputData< T >::m_data.

◆ getTransferPrototype()

template<typename T >
virtual std::shared_ptr< WPrototyped > WModuleOutputData< T >::getTransferPrototype ( )
inlinevirtual

Returns the prototype of the Type T used in this connector.

Returns
the prototype of the transfered type.

Implements WModuleOutputConnector.

Definition at line 187 of file WModuleOutputData.h.

References WModuleOutputData< T >::m_data.

◆ reset()

template<typename T >
virtual void WModuleOutputData< T >::reset ( )
inlinevirtual

Resets the data on this output.

It actually sets NULL and triggers an update.

Definition at line 135 of file WModuleOutputData.h.

References WModuleOutputData< T >::updateData().

+ Here is the call graph for this function:

◆ triggerUpdate()

template<typename T >
virtual void WModuleOutputData< T >::triggerUpdate ( )
inlinevirtual

This method simply propagates an update but does not actually change the data.

Definition at line 143 of file WModuleOutputData.h.

References WModuleOutputConnector::propagateDataChange().

Referenced by WModuleOutputData< T >::updateData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateData()

template<typename T >
virtual void WModuleOutputData< T >::updateData ( std::shared_ptr< T >  data)
inlinevirtual

Update the data associated.

Parameters
datathe data do send

Definition at line 124 of file WModuleOutputData.h.

References WModuleOutputData< T >::m_data, and WModuleOutputData< T >::triggerUpdate().

Referenced by WModuleOutputForwardData< T >::inputNotifyDataChange(), and WModuleOutputData< T >::reset().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_data

template<typename T >
std::shared_ptr< T > WModuleOutputData< T >::m_data
protected

The data associated with this connector.

Note
If you modify this or its contents, consider triggering an update. See updateData() for details.

Definition at line 199 of file WModuleOutputData.h.

Referenced by WModuleOutputData< T >::getData(), WModuleOutputData< T >::getRawData(), WModuleOutputData< T >::getTransferPrototype(), WModuleOutputData< T >::updateData(), and WModuleOutputData< T >::WModuleOutputData().


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