DataDirector API
Public Member Functions | Static Public Member Functions | List of all members
DDD_Connection Class Reference

The DDD_Connection class. Base class for connections between assets. More...

#include <DDD_Connection.h>

Inheritance diagram for DDD_Connection:
DDD_AttributeObserver

Public Member Functions

 DDD_Connection ()
 
 ~DDD_Connection ()
 
bool AddInput (DDD_AttributeBase *input)
 
bool ReplaceInput (DDD_AttributeBase *input, unsigned int index)
 
bool AddOutput (DDD_AttributeBase *output)
 
bool ReplaceOutput (DDD_AttributeBase *output, unsigned int index)
 
bool IsOutputAlreadyUsed (DDD_AttributeBase *output)
 
int DisconnectAsset (DDD_AssetBase *asset)
 
void RevalidateEndpoints (DDD_AssetBase *asset)
 
void RemoveInput (unsigned int index)
 
void RemoveOutput (unsigned int index)
 
bool UseConvertFunction (const std::string &className, const std::string &params)
 
bool UseConvertFunction (const std::string &className)
 
bool InitConverter (const std::string &params)
 
bool AllEndpointsValid ()
 
DDD_EndpointListGetInputs ()
 
DDD_EndpointListGetOutputs ()
 
DDD_ConvertBaseGetConverter ()
 
void NotifyAssetNameChange (const std::string &oldname, const std::string &newname)
 
virtual void OnAttributeChanged (DDD_AttributeBase *attribute)
 
void DisplayNumber (int num)
 
int DisplayNumber () const
 
void AllowForcePump (bool allowForcePump)
 
void ForceProcess ()
 

Static Public Member Functions

static void ProcessPending ()
 
static void ClearPendingList ()
 

Detailed Description

The DDD_Connection class. Base class for connections between assets.

Constructor & Destructor Documentation

constructor

destructor

Member Function Documentation

bool AddInput ( DDD_AttributeBase input)

Add an input to the connection at the end of the list

Parameters
inputThe input to add
bool AddOutput ( DDD_AttributeBase output)

Add an output to the connection at the end of the list

Parameters
outputThe input to add
bool AllEndpointsValid ( )
Returns
Returns true if all the endpoints for this connection are valid This is used by the GUI to indicate if a connection has invalid endpoints
void AllowForcePump ( bool  allowForcePump)

Allows whether connection can be forced to update when ForceProcess() is called

Parameters
allowForcePumpIf true, this connection will be processed when ForceProcess() is called. If false, it will ignore the request.
static void ClearPendingList ( )
static

This method removes all connections from the the pending list.

int DisconnectAsset ( DDD_AssetBase asset)

Iterates through the inputs and outputs of this connection and disconnects any endpoints that come from the specified asset

Parameters
assetThe asset to disconnect
Returns
The number of endpoints that were disconnected
void DisplayNumber ( int  num)
inline

Set the "DisplayNumber", which is used by the DataDirector GUI for sorting connections

Parameters
numThe DisplayNumber to set
int DisplayNumber ( ) const
inline
Returns
Gets the "DisplayNumber", which is used by the DataDirector GUI for sorting connections
void ForceProcess ( )

Adds connection to pending connections list, as long as force pumps are allowed

DDD_ConvertBase* GetConverter ( )
Returns
Gets a pointer to the converter for this connection or NULL if no converter has been set.
DDD_EndpointList& GetInputs ( )
inline
Returns
Gets the list of input endpoints for this connection
DDD_EndpointList& GetOutputs ( )
inline
Returns
Gets the list of output endpoints for this connection
bool InitConverter ( const std::string &  params)

Initializes the converter with the parameters specified as a string The string must contain the parameters in the form param1=value1;param2=value2 etc. The initialization string may contain the initial parameter values for the converter.

Parameters
paramsThe parameters to the converter
Returns
True if the parameters were accepted by the converter
bool IsOutputAlreadyUsed ( DDD_AttributeBase output)

Returns whether or not the specified output is already used as an output by this connection

Parameters
outputThe output to check
Returns
True if the output is already used
void NotifyAssetNameChange ( const std::string &  oldname,
const std::string &  newname 
)

Handles the case when the instance name of a connected asset is changed. Iterates through all connected endpoints and reconfigures them to use the new asset name.

Parameters
oldnameThe old name of the asset
newnameThe new name of the asset
virtual void OnAttributeChanged ( DDD_AttributeBase attribute)
virtual

A callback method that will be called when the attribute being observed changes if this observer has registered to be notified on attribute change

Parameters
attributeA pointer to the attribute that changed

Implements DDD_AttributeObserver.

static void ProcessPending ( )
static

process pending connections that have inputs with updated values

void RemoveInput ( unsigned int  index)

Remove the specified input endpoint from the connection

Parameters
indexIndex of the input endpoint to remove
void RemoveOutput ( unsigned int  index)

Remove the specified output endpoint from the connection

Parameters
endpointIndex of the output endpoint to remove
bool ReplaceInput ( DDD_AttributeBase input,
unsigned int  index 
)

Replace the input to the connection at specified index.

Parameters
inputThe input to add
indexThe index to add at
bool ReplaceOutput ( DDD_AttributeBase output,
unsigned int  index 
)

Replace the output to the connection at specified index.

Parameters
outputThe output to add
indexThe index to add at
void RevalidateEndpoints ( DDD_AssetBase asset)

Iterates through the inputs and outputs of this connection and for each endpoint that has the same asset name as the specified asset that connection endpoint is reestablished. The purpose of this is to handle reconnection of endpoints in the case where the user deletes an asset in the editor and then loads a new asset

Parameters
assetPointer to the asset to revalidate
bool UseConvertFunction ( const std::string &  className,
const std::string &  params 
)

Chooses the converter function to use for this connection.

Parameters
classNameThe class name of the converter. This will be used by the converter factory to dynamically load the converter.
paramsThe initialization parameters for the converter. The string must contain the parameters in the form param1=value1;param2=value2 etc.
Returns
True if the converter was successfully loaded
bool UseConvertFunction ( const std::string &  className)

Chooses the converter function to use for this connection.

Parameters
classNameThe class name of the converter. This will be used by the converter factory to dynamically load the converter.
Returns
True if the converter was successfully loaded

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