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

DDD_DataDirector. Main interface to DataDirector core that encapsulates all Assets, Connections and core logic. More...

#include <DDD_DataDirector.h>

Inheritance diagram for DDD_DataDirector:
XMLConfigTarget DDD_AssetObserver DDD_AssetContainer DDD_LogFacade

Public Member Functions

 DDD_DataDirector ()
 
 ~DDD_DataDirector ()
 
bool LoadXML (const std::string &filename)
 
bool SaveXML (const std::string &filename)
 
DDD_AssetBaseAddAsset (const std::string &instanceName, const std::string &className, const std::string &libName, const DDD_AttributeList &params)
 
virtual void AddConnection (DDD_Connection *connection)
 
virtual DDD_ConnectionListGetConnectionList ()
 
void RemoveAsset (DDD_AssetBase *asset)
 
bool ChangeAssetInstanceName (const std::string &oldAssetName, const std::string &newAssetName)
 
void RemoveConnection (DDD_Connection *connection)
 
void RegisterAssetCreateCallback (std::string className, AssetCreateCallback assetCreatorCb, void *data)
 
void Process ()
 
void Process (double time)
 
void ClearAll ()
 
void StartAllAssets ()
 
void StopAllAssets ()
 
void ResumeAllAssets ()
 
void PauseAllAssets ()
 
bool Empty ()
 
bool MoveConnectionUp (DDD_Connection *connection)
 
bool MoveConnectionDown (DDD_Connection *connection)
 
bool MoveAssetUp (DDD_AssetBase *asset)
 
bool MoveAssetDown (DDD_AssetBase *asset)
 
void ForceProcessConnections ()
 
virtual DDD_AssetListGetAssetList ()
 
void AddEventSubscriber (DDD_ObjectEventSubscriber *subscriber)
 
void RemoveEventSubscriber (DDD_ObjectEventSubscriber *subscriber)
 
void PostEvent (DDD_ObjectEvent *event)
 
DDD_AssetBaseFindAsset (const std::string &assetName)
 
DDD_AttributeBaseFindAttribute (const std::string &name)
 

Static Public Member Functions

static const char * Version ()
 
- Static Public Member Functions inherited from DDD_LogFacade
static void LogDebug (const char *format,...)
 
static void LogInfo (const char *format,...)
 
static void LogWarning (const char *format,...)
 
static void LogError (const char *format,...)
 

Detailed Description

DDD_DataDirector. Main interface to DataDirector core that encapsulates all Assets, Connections and core logic.

Constructor & Destructor Documentation

Constructor

Destructor

Member Function Documentation

DDD_AssetBase* AddAsset ( const std::string &  instanceName,
const std::string &  className,
const std::string &  libName,
const DDD_AttributeList params 
)
virtual

Instantiate an asset and add it to the asset list

Parameters
instanceNameThe intance name of the new asset
classNameThe class name of the new asset
libNameThe library file name of the new asset
paramsA list of initialization parameters for the asset
Returns
A pointer to the newly added asset or NULL on failure

Implements XMLConfigTarget.

virtual void AddConnection ( DDD_Connection connection)
virtual

Add a Connection to the connection list

Parameters
connectionA connection to add to the connection list

Implements XMLConfigTarget.

void AddEventSubscriber ( DDD_ObjectEventSubscriber subscriber)
virtual

Add a new event subscriber to subscriber list

Parameters
subscriberThe event subscriber to add

Implements DDD_AssetContainer.

bool ChangeAssetInstanceName ( const std::string &  oldAssetName,
const std::string &  newAssetName 
)

Changes asset instance name and also checks connections to make sure any connections that referenced the asset are updated

Parameters
oldAssetNameThe old instance name of the asset
newAssetNameThe new instance name of the asset
Returns
true If an asset with the old name was found and if the new name is legal
void ClearAll ( )

Clears all Assets and Connections- revert to empty configuration

bool Empty ( )
Returns
Returns true if there are no assets or connections in the director
DDD_AssetBase* FindAsset ( const std::string &  assetName)
virtual

Searches the asset list for an asset with the specified instance name

Parameters
assetNameThe instance name of the asset to find
Returns
Returns a pointer to the asset or NULL if not found

Implements DDD_AssetContainer.

DDD_AttributeBase* FindAttribute ( const std::string &  name)
virtual

Searches all instantiated assets for the attribute

Parameters
nameThe fully qualified name of the attribute to find (e.g. assetName.attribName)
Returns
Returns a pointer to the attribute or NULL if not found

Implements DDD_AssetContainer.

void ForceProcessConnections ( )

This method will force every connection to be added to pending connections to be processed regardless whether they had any changed attributes.

virtual DDD_AssetList& GetAssetList ( )
virtual
Returns
Returns the asset list

Implements XMLConfigTarget.

virtual DDD_ConnectionList& GetConnectionList ( )
virtual
Returns
Returns the connections list

Implements XMLConfigTarget.

bool LoadXML ( const std::string &  filename)

Load the Data Director state from an XML configuration file

Parameters
filenameThe name of the configuration file to load
Returns
Returns True if the configuration was successfully loaded
bool MoveAssetDown ( DDD_AssetBase asset)

Moves a asset "DOWN" in the list, which means it gets moved towards the beginning of the list.

Parameters
assetThe asset to reorder
Returns
True if if the asset was moved, false otherwise
bool MoveAssetUp ( DDD_AssetBase asset)

Moves a asset "UP" in the list, which means it gets moved further towards the end of the list.

Parameters
assetThe asset to reorder
Returns
True if if the asset was moved, false otherwise
bool MoveConnectionDown ( DDD_Connection connection)

Moves a connection "DOWN" in the list, which means it gets moved towards the beginning of the list.

Parameters
connectionThe connection to reorder
Returns
True if if the connection was moved, false otherwise
bool MoveConnectionUp ( DDD_Connection connection)

Moves a connection "UP" in the list, which means it gets moved further towards the end of the list.

Parameters
connectionThe connection to reorder
Returns
True if if the connection was moved, false otherwise
void PauseAllAssets ( )

Pauses all assets

void PostEvent ( DDD_ObjectEvent event)
virtual

Post a new event that will be received by all event subscribers

Parameters
eventThe object event to post

Implements DDD_AssetContainer.

void Process ( )

Runs the Data Director engine–iterates the assets and pumps connections

void Process ( double  time)

Runs the Data Director engine–iterates the assets and pumps connections

Parameters
timeElapsed time since last call (for when calling process inside of calculate)
void RegisterAssetCreateCallback ( std::string  className,
AssetCreateCallback  assetCreatorCb,
void *  data 
)

Registers an asset creation callback for "special" assets (i.e.- RSOs) This callback will be called whenever a new asset is instantiated by the director

Parameters
assetCreatorCbFunction pointer to the callback
dataData to pass to callback
void RemoveAsset ( DDD_AssetBase asset)

Remove asset from asset list and also check each connection and invalidates ones that referenced that Asset

Parameters
assetA pointer to the asset to remove
void RemoveConnection ( DDD_Connection connection)

Removes a connection from the Director

Parameters
connectionThe connection to remove
void RemoveEventSubscriber ( DDD_ObjectEventSubscriber subscriber)
virtual

Remove an event subscriber from the subscriber list

Parameters
subscriberThe event subscriber to remove

Implements DDD_AssetContainer.

void ResumeAllAssets ( )

Resumes all assets

bool SaveXML ( const std::string &  filename)

Save the Data Director state to an XML configuration file

Parameters
filenameThe name of the configuration file to save to
Returns
Returns True if the configuration was successfully saved
void StartAllAssets ( )

Starts all assets

void StopAllAssets ( )

stops all assets

static const char* Version ( )
static
Returns
Returns version string for compatibility checking of plugins

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