DataDirector API
|
A virtual interface class for all DataDirector assets. More...
#include <DDD_AssetBase.h>
Public Member Functions | |
DDD_AssetBase (DDD_AssetContainer *container) | |
virtual | ~DDD_AssetBase () |
const char * | DataDirectorVersion () |
DDD_AttributeBase * | GetAttribute (const char *attributeName) |
DDD_AttributeBase * | GetAttribute (int index) |
const char * | GetAttributeNames () |
DDD_AssetContainer * | GetContainer () |
int | NumberOfConnections () |
int | NumberOfAttributes () |
virtual void | AddDynamicAttribute (DDD_AttributeBase *attrib) |
virtual void | RefreshAttributesList () |
bool | AddAssetObserver (DDD_AssetObserver *observer) |
bool | RemoveAssetObserver (DDD_AssetObserver *observer) |
virtual const char * | Description ()=0 |
virtual bool | Live ()=0 |
virtual const char * | ClassName ()=0 |
virtual void | Start () |
virtual void | Stop () |
virtual void | Pause () |
virtual void | Resume () |
virtual void | Calculate (double time)=0 |
void | RevertAttributes () |
virtual DDD_AttributeBase * | FindAttributeLocalScope (const std::string &name, void *userData) |
virtual void | ExecuteLuaScript (const char *script, void *userData) |
virtual bool | EvaluateLuaScript (const char *script, void *userData) |
Public Member Functions inherited from DDD_Base | |
DDD_Base () | |
virtual | ~DDD_Base () |
const char * | GetInstanceName () const |
virtual void | SetInstanceName (const char *name) |
virtual void | SetParams (const DDD_AttributeList ¶ms) |
virtual DDD_AttributeList & | GetParams () |
Static Public Member Functions | |
static bool | IsAssetNameLegal (const std::string &assetName) |
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,...) |
Protected Member Functions | |
void | NotifyAttributeListAdded () |
void | NotifyAttributeListDeleted () |
void | CreateLua () |
void | DestroyLua () |
virtual void | PopulateAttributeList ()=0 |
virtual DDD_AttributeBase * | GetDictionaryAttribute (const char *attributeName)=0 |
virtual void | GenerateInstanceName (const DDD_AssetList &assetList) |
Protected Attributes | |
DDD_AttributeList | _attributes |
bool | _refreshAttributeList |
DDD_AssetContainer * | _container |
void * | _luaState |
AssetObserverList | _assetObserverList |
Protected Attributes inherited from DDD_Base | |
std::string | _instanceName |
DDD_AttributeList | _params |
A virtual interface class for all DataDirector assets.
DDD_AssetBase | ( | DDD_AssetContainer * | container | ) |
Constructor
|
virtual |
Destructor
bool AddAssetObserver | ( | DDD_AssetObserver * | observer | ) |
Adds an observer to this asset that will be notified whenever this asset changes
observer | The observer to add. The observer to add must not already be observing this asset. |
|
virtual |
Adds a dynamic attribute to the asset's _attributes structure. This is called by the framework.
|
pure virtual |
calculate to pump the asset
Implemented in DDD_RSOAsset, and DDD_StructuredMemoryAsset.
|
pure virtual |
Returns asset type (class) name
Implemented in DDD_RSOAsset, and DDD_StructuredMemoryAsset.
|
protected |
Create a LUA parser instance for use by this asset
const char* DataDirectorVersion | ( | ) |
|
pure virtual |
Describes the Asset (for UI)
Implemented in DDD_RSOAsset, and DDD_StructuredMemoryAsset.
|
protected |
Destroy the LUA parser instance for this asset
|
virtual |
Executes a LUA script and returns true if the script set the variable "DDD_Result" to true
script | A string containing the script |
userData | User data passed to the script by the invoking asset |
|
virtual |
Executes a LUA script.
script | A string containing the script |
userData | User data passed to the script by the invoking asset |
|
inlinevirtual |
Searches this assets for the attribute. Not pure virtual. Child classes can override if they need to provide their own specialized local scoping of attribute names
name | The fully qualified name of the attribute to find (e.g. assetName.attribName) |
userData | Data to be used by asset for local scoping of attribute names |
|
protectedvirtual |
Generates unique asset instance name
assetList | List of assets used to check uniqueness of name |
Reimplemented in DDD_RSOAsset.
DDD_AttributeBase* GetAttribute | ( | const char * | attributeName | ) |
name | The name of the attribute to find |
DDD_AttributeBase* GetAttribute | ( | int | index | ) |
name | The name of the attribute to find |
const char* GetAttributeNames | ( | ) |
|
inline |
|
protectedpure virtual |
Gets an attribute from the assets internal dictionary and add it to the list of published attributes for the asset.
attributeName | The name of the attribute to get |
Implemented in DDD_RSOAsset, and DDD_StructuredMemoryAsset.
|
static |
Checks for illegal characters in asset name
The | asset name to check |
|
pure virtual |
Is this asset currently running?
Implemented in DDD_RSOAsset, and DDD_StructuredMemoryAsset.
|
protected |
Notifies all observers of this asset that its attribute list has been deleted
|
protected |
Notifies all observers of this asset that its attribute list has been added or readded
int NumberOfAttributes | ( | ) |
int NumberOfConnections | ( | ) |
|
virtual |
Pause asset. Do cleanup that should happen when the asset is paused.
Reimplemented in DDD_StructuredMemoryAsset.
|
protectedpure virtual |
Poll asset, put all "discovered" assets into _attributList
Implemented in DDD_RSOAsset, and DDD_StructuredMemoryAsset.
|
virtual |
Called every time the editor needs an update on the current attributes. Some Assets can change their Attribute lists dynamically. By default, it simply populates them the first time and leaves it. Assets with dynamically changing lists of attributes may reallocate their attribute list
bool RemoveAssetObserver | ( | DDD_AssetObserver * | observer | ) |
Removes an observer from the observer list
observer | The observer to remove. |
|
virtual |
Resume asset. Do allocations, initializations that should happen when the asset is resumed
Reimplemented in DDD_RSOAsset, and DDD_StructuredMemoryAsset.
void RevertAttributes | ( | ) |
Reverts all of the attributes in this list that are marked with the "Revertable" flag
|
virtual |
Start asset. Do allocations, initializations that should only happen once.
Reimplemented in DDD_RSOAsset, and DDD_StructuredMemoryAsset.
|
virtual |
Stop asset. Do deallocations, cleanups that should only happen once.
Reimplemented in DDD_StructuredMemoryAsset.
|
protected |
The list of observers to notify when this asset changes
|
protected |
This list contains all attributes that have been requested of this asset, not necessarily all of the attributes the asset supports. In the DataDirector editor this list is populated by PopulateAttributeList and generally contains all of the supported attributes of the asset. At runtime this list will typically contain the names of attributes that are connected.
|
protected |
Container that owns this asset. Allows this asset to access siblings.
|
protected |
Stores the context for the LUA script engine
|
protected |
Flag indicating whether or not the attribute list needs to be refreshed. This is intended only for use by the DataDirector Producer GUI for updating GUI elements and is not used in the runtime.