OpenWalnut
1.5.0dev
|
Class offering an instantiate-able data connection between modules. More...
#include <WModuleInputData.h>
Public Types | |
typedef std::shared_ptr< WModuleInputData< T > > | PtrType |
Pointer to this. More... | |
typedef std::shared_ptr< WModuleInputData< T > > | SPtr |
Pointer to this. More... | |
typedef std::shared_ptr< const WModuleInputData< T > > | ConstSPtr |
Pointer to this. More... | |
typedef WModuleInputData< T > & | RefType |
Reference to this type. More... | |
typedef WModuleInputData< 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< WModuleConnector > | SPtr |
Shared pointer to this class. More... | |
typedef std::shared_ptr< const WModuleConnector > | ConstSPtr |
Const shared pointer to this class. More... | |
Public Member Functions | |
WModuleInputData (std::shared_ptr< WModule > module, std::string name="", std::string description="") | |
Constructor. More... | |
virtual | ~WModuleInputData () |
Destructor. More... | |
virtual void | disconnect (std::shared_ptr< WModuleConnector > con, bool removeFromOwnList=true) |
Disconnects this connector if connected. More... | |
const std::shared_ptr< T > | getData (bool reset=true) |
Gives the currently set data and resets the update flag. More... | |
virtual bool | connectable (std::shared_ptr< WModuleConnector > con) |
Checks whether the specified connector is an input connector and compatible with T. More... | |
Public Member Functions inherited from WModuleInputConnector | |
WModuleInputConnector (std::shared_ptr< WModule > module, std::string name="", std::string description="") | |
Constructor. More... | |
virtual | ~WModuleInputConnector () |
Destructor. 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... | |
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 | isInputConnector () const |
Returns true if this instance is an WModuleInputConnector. More... | |
virtual bool | isOutputConnector () const |
Returns true if this instance is an WModuleOutputConnector. More... | |
virtual bool | updated () |
Denotes whether the connected output was updated. More... | |
virtual bool | handledUpdate () |
Resets the updated-flag. 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< WModule > | getModule () const |
Returns the module which owns this connector. 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< WModuleInputConnector > | toInputConnector () |
Tries to convert this instance to an input connector. More... | |
std::shared_ptr< WModuleOutputConnector > | toOutputConnector () |
Tries to convert this instance to an output connector. More... | |
std::shared_ptr< WCondition > | getDataChangedCondition () |
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 in 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 in data connector with proper type and add it to the list of connectors of the specified module. More... | |
Private Attributes | |
bool | m_disconnecting |
If true, the returned data will be NULL. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from WModuleInputConnector | |
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 void | notifyDataChange (std::shared_ptr< WModuleConnector > input, std::shared_ptr< WModuleConnector > output) |
Gets called when the data on this input connector changed. 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 | setUpdated () |
Sets the update flag (use updated() to query it)to true. More... | |
Protected Member Functions inherited from WModuleConnector | |
virtual const t_GenericSignalHandlerType | getSignalHandler (MODULE_CONNECTOR_SIGNAL signal) |
Gives the signal handler function responsible for a given signal. 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... | |
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< WModule > | m_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< WCondition > | m_dataChangedCondition |
Condition fired whenever data changes. More... | |
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 46 of file WModuleInputData.h.
typedef std::shared_ptr< const WModuleInputData< T > > WModuleInputData< T >::ConstSPtr |
typedef std::shared_ptr< WModuleInputData< T > > WModuleInputData< T >::PtrType |
typedef WModuleInputData< T >& WModuleInputData< T >::RefType |
Reference to this type.
Definition at line 67 of file WModuleInputData.h.
typedef std::shared_ptr< WModuleInputData< T > > WModuleInputData< T >::SPtr |
typedef T WModuleInputData< T >::TransferType |
Typedef to the contained transferable.
Definition at line 77 of file WModuleInputData.h.
typedef WModuleInputData< T > WModuleInputData< T >::Type |
Type of the connector.
Definition at line 72 of file WModuleInputData.h.
|
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 109 of file WModuleInputData.h.
|
inlinevirtual |
Destructor.
Definition at line 118 of file WModuleInputData.h.
|
inlinevirtual |
Checks whether the specified connector is an input connector and compatible with T.
con | the connector to check against. |
Reimplemented from WModuleInputConnector.
Definition at line 173 of file WModuleInputData.h.
References WModuleInputConnector::connectable().
|
static |
Convenience method to create a new instance of this in data connector with proper type.
module | the module owning this instance |
name | the name of this connector. |
description | the description of this connector. |
Definition at line 209 of file WModuleInputData.h.
|
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.
module | the module owning this instance |
name | the name of this connector. |
description | the description of this connector. |
Definition at line 218 of file WModuleInputData.h.
Referenced by WMButterfly::connectors(), WMColormapper::connectors(), WMWriteNIfTI::connectors(), WMDiffTensorScalars::connectors(), WMDirectVolumeRendering::connectors(), WMEigenSystem::connectors(), WMFiberFilterIndex::connectors(), WMFiberFilterROI::connectors(), WMFiberResampling::connectors(), WMFilterProtonData::connectors(), WMPartition2Mesh::connectors(), WMImageSpaceLIC::connectors(), WMImageSpaceTensorLIC::connectors(), WMIsosurfaceRaytracer::connectors(), WMMergeComponentsToVector::connectors(), WMMergePoints::connectors(), WMPickingDVR::connectors(), WMPickingDVREvaluation::connectors(), WMPointConnector::connectors(), WMPointRenderer::connectors(), WMProjectionsAsContext::connectors(), WMScalarOperator::connectors(), WMSpatialDerivative::connectors(), WMSurfaceIllustrator::connectors(), WMTemplate::connectors(), WMTransferFunctionColorBar::connectors(), WMTriangleMeshRenderer::connectors(), WMVectorAlign::connectors(), WMVectorNormalize::connectors(), WMVectorOperator::connectors(), WMVectorScale::connectors(), WMVoxelizer::connectors(), WMWriteAmiraMesh::connectors(), WMWriteDendrogram::connectors(), WMWriteCSV::connectors(), and WMWriteTracts::connectors().
|
virtual |
Disconnects this connector if connected.
If it is not connected: nothing happens.
con | the connector to disconnect. |
removeFromOwnList | if true the specified connection is also removed from the own connection list. If false it won't. |
Reimplemented from WModuleConnector.
Definition at line 201 of file WModuleInputData.h.
References WModuleConnector::disconnect().
|
inline |
Gives the currently set data and resets the update flag.
reset | reset the flag of updated() if true (default). |
Definition at line 137 of file WModuleInputData.h.
References WModuleInputConnector::handledUpdate(), WModuleConnector::m_connected, WModuleConnector::m_connectionListLock, and WModuleInputData< T >::m_disconnecting.
Referenced by WMTransferFunction1D::moduleMain(), and WMWriteTransferFunction::moduleMain().
|
private |
If true, the returned data will be NULL.
Needed because disconnection process is based on multiple steps.
Definition at line 197 of file WModuleInputData.h.
Referenced by WModuleInputData< T >::getData().