Torque2D Reference
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
AssetManager Class Reference

#include <assetManager.h>

+ Inheritance diagram for AssetManager:

Public Member Functions

 AssetManager ()
 
virtual ~AssetManager ()
 
virtual bool onAdd ()
 SimObject overrides. More...
 
virtual void onRemove ()
 Called when the object is removed from the sim. More...
 
bool addModuleDeclaredAssets (ModuleDefinition *pModuleDefinition)
 Declared assets. More...
 
bool addDeclaredAsset (ModuleDefinition *pModuleDefinition, const char *pAssetFilePath)
 
StringTableEntry addPrivateAsset (AssetBase *pAssetBase)
 
bool removeDeclaredAssets (ModuleDefinition *pModuleDefinition)
 
bool removeDeclaredAsset (const char *pAssetId)
 
bool renameDeclaredAsset (const char *pAssetIdFrom, const char *pAssetIdTo)
 
StringTableEntry getAssetName (const char *pAssetId)
 
StringTableEntry getAssetDescription (const char *pAssetId)
 
StringTableEntry getAssetCategory (const char *pAssetId)
 
StringTableEntry getAssetType (const char *pAssetId)
 
StringTableEntry getAssetFilePath (const char *pAssetId)
 
StringTableEntry getAssetPath (const char *pAssetId)
 
ModuleDefinitiongetAssetModuleDefinition (const char *pAssetId)
 
bool isAssetInternal (const char *pAssetId)
 
bool isAssetPrivate (const char *pAssetId)
 
bool isAssetAutoUnload (const char *pAssetId)
 
bool isAssetLoaded (const char *pAssetId)
 
bool isDeclaredAsset (const char *pAssetId)
 
bool doesAssetDependOn (const char *pAssetId, const char *pDependsOnAssetId)
 
bool isAssetDependedOn (const char *pAssetId, const char *pDependedOnByAssetId)
 
bool compileReferencedAssets (ModuleDefinition *pModuleDefinition)
 Referenced assets. More...
 
bool isReferencedAsset (const char *pAssetId)
 
bool renameReferencedAsset (const char *pAssetIdFrom, const char *pAssetIdTo)
 
template<typename T >
T * acquireAsset (const char *pAssetId)
 Public asset acquisition. More...
 
template<typename T >
T * acquireAsPrivateAsset (const char *pAssetId)
 Private asset acquisition. More...
 
bool releaseAsset (const char *pAssetId)
 
void purgeAssets (void)
 
bool deleteAsset (const char *pAssetId, const bool deleteLooseFiles, const bool deleteDependencies)
 Asset deletion. More...
 
bool refreshAsset (const char *pAssetId)
 
void refreshAllAssets (const bool includeUnloaded=false)
 
void registerAssetPtrRefreshNotify (AssetPtrBase *pAssetPtrBase, AssetPtrCallback *pCallback)
 
void unregisterAssetPtrRefreshNotify (AssetPtrBase *pAssetPtrBase)
 
bool loadAssetTags (ModuleDefinition *pModuleDefinition)
 Asset tags. More...
 
bool saveAssetTags (void)
 
bool restoreAssetTags (void)
 
AssetTagsManifestgetAssetTags (void) const
 
U32 getDeclaredAssetCount (void) const
 Info. More...
 
U32 getReferencedAssetCount (void) const
 
U32 getLoadedInternalAssetCount (void) const
 
U32 getLoadedExternalAssetCount (void) const
 
U32 getLoadedPrivateAssetCount (void) const
 
U32 getMaxLoadedInternalAssetCount (void) const
 
U32 getMaxLoadedExternalAssetCount (void) const
 
U32 getMaxLoadedPrivateAssetCount (void) const
 
void dumpDeclaredAssets (void) const
 
void acquireAcquiredReferenceCount (void)
 Total acquired asset references. More...
 
void releaseAcquiredReferenceCount (void)
 
U32 getAcquiredReferenceCount (void) const
 
S32 findAllAssets (AssetQuery *pAssetQuery, const bool ignoreInternal=true, const bool ignorePrivate=true)
 Asset queries. More...
 
S32 findAssetName (AssetQuery *pAssetQuery, const char *pAssetName, const bool partialName=false)
 
S32 findAssetCategory (AssetQuery *pAssetQuery, const char *pAssetCategory, const bool assetQueryAsSource=false)
 
S32 findAssetAutoUnload (AssetQuery *pAssetQuery, const bool assetAutoUnload, const bool assetQueryAsSource=false)
 
S32 findAssetInternal (AssetQuery *pAssetQuery, const bool assetInternal, const bool assetQueryAsSource=false)
 
S32 findAssetPrivate (AssetQuery *pAssetQuery, const bool assetPrivate, const bool assetQueryAsSource=false)
 
S32 findAssetType (AssetQuery *pAssetQuery, const char *pAssetType, const bool assetQueryAsSource=false)
 
S32 findAssetDependsOn (AssetQuery *pAssetQuery, const char *pAssetId)
 
S32 findAssetIsDependedOn (AssetQuery *pAssetQuery, const char *pAssetId)
 
S32 findInvalidAssetReferences (AssetQuery *pAssetQuery)
 
S32 findTaggedAssets (AssetQuery *pAssetQuery, const char *pAssetTagNames, const bool assetQueryAsSource=false)
 
S32 findAssetLooseFile (AssetQuery *pAssetQuery, const char *pLooseFile, const bool assetQueryAsSource=false)
 
 DECLARE_CONOBJECT (AssetManager)
 Declare Console Object. More...
 
- Public Member Functions inherited from SimObject
StringTableEntry getClassNamespace () const
 
StringTableEntry getSuperClassNamespace () const
 
void setClassNamespace (const char *classNamespace)
 
void setSuperClassNamespace (const char *superClassNamespace)
 
void pushScriptCallbackGuard (void)
 
void popScriptCallbackGuard (void)
 
S32 getScriptCallbackGuard (void)
 
virtual SimObjectfindObject (const char *name)
 
NamespacegetNamespace ()
 Return the object's namespace. More...
 
const char * tabComplete (const char *prevText, S32 baseLen, bool)
 
virtual void dump ()
 
virtual void dumpClassHierarchy ()
 
SimObjectclone (const bool copyDynamicFields)
 
virtual void copyTo (SimObject *object)
 
template<typename T >
bool isType (void)
 
virtual bool handlesConsoleMethod (const char *fname, S32 *routingId)
 
 DECLARE_CONOBJECT (SimObject)
 
NotifyremoveNotify (void *ptr, Notify::Type)
 Remove a notification from the list. More...
 
void deleteNotify (SimObject *obj)
 Notify an object when we are deleted. More...
 
void clearNotify (SimObject *obj)
 Notify an object when we are cleared. More...
 
void clearAllNotifications ()
 Remove all notifications for this object. More...
 
void processDeleteNotifies ()
 Send out deletion notifications. More...
 
void registerReference (SimObject **obj)
 
void unregisterReference (SimObject **obj)
 
const char * getDataField (StringTableEntry slotName, const char *array)
 
void setDataField (StringTableEntry slotName, const char *array, const char *value)
 
const char * getPrefixedDataField (StringTableEntry fieldName, const char *array)
 
void setPrefixedDataField (StringTableEntry fieldName, const char *array, const char *value)
 
const char * getPrefixedDynamicDataField (StringTableEntry fieldName, const char *array, const S32 fieldType=-1)
 
void setPrefixedDynamicDataField (StringTableEntry fieldName, const char *array, const char *value, const S32 fieldType=-1)
 
StringTableEntry getDataFieldPrefix (StringTableEntry fieldName)
 
U32 getDataFieldType (StringTableEntry slotName, const char *array)
 
SimFieldDictionarygetFieldDictionary ()
 
void clearDynamicFields (void)
 Clear all dynamic fields. More...
 
void setCanSaveDynamicFields (bool bCanSave)
 Set whether fields created at runtime should be saved. Default is true. More...
 
bool getCanSaveDynamicFields (void) const
 Get whether fields created at runtime should be saved. Default is true. More...
 
void setInternalName (const char *newname)
 
StringTableEntry getInternalName ()
 Get the internal of of this control. More...
 
virtual bool save (const char *pcFilePath, bool bOnlySelected=false)
 Save object as a TorqueScript File. More...
 
virtual bool isMethod (const char *methodName)
 Check if a method exists in the objects current namespace. More...
 
SimObjectId getId (void) const
 
StringTableEntry getIdString (void) const
 
U32 getType () const
 
const StringTableEntry getName (void) const
 
void setId (SimObjectId id)
 
void assignName (const char *name)
 
SimGroupgetGroup () const
 
bool isChildOfGroup (SimGroup *pGroup)
 
bool isProperlyAdded () const
 
bool isDeleted () const
 
bool isRemoved () const
 
bool isLocked ()
 
void setLocked (bool b)
 
bool isHidden ()
 
void setHidden (bool b)
 
void setProgenitorFile (const char *pFile)
 
StringTableEntry getProgenitorFile (void) const
 
void setPeriodicTimerID (const S32 timerID)
 
S32 getPeriodicTimerID (void) const
 
bool isPeriodicTimerActive (void) const
 
bool isSelected () const
 
bool isExpanded () const
 
void setSelected (bool sel)
 
void setExpanded (bool exp)
 
void setModDynamicFields (bool dyn)
 
void setModStaticFields (bool sta)
 
 SimObject (const U8 namespaceLinkMask=LinkSuperClassName|LinkClassName)
 
virtual ~SimObject ()
 
virtual bool processArguments (S32 argc, const char **argv)
 Process constructor options. (ie, new SimObject(1,2,3)) More...
 
virtual void onGroupAdd ()
 Called when the object is added to a SimGroup. More...
 
virtual void onGroupRemove ()
 Called when the object is removed from a SimGroup. More...
 
virtual void onNameChange (const char *name)
 Called when the object's name is changed. More...
 
virtual void onStaticModified (const char *slotName, const char *newValue=NULL)
 
virtual void inspectPreApply ()
 
virtual void inspectPostApply ()
 
virtual void onDeleteNotify (SimObject *object)
 
virtual void onEditorEnable ()
 Called when the editor is activated. More...
 
virtual void onEditorDisable ()
 Called when the editor is deactivated. More...
 
bool registerObject ()
 
bool registerObject (U32 id)
 
bool registerObject (const char *name)
 
bool registerObject (const char *name, U32 id)
 
void unregisterObject ()
 
void deleteObject ()
 
bool addToSet (SimObjectId)
 
bool addToSet (const char *)
 
bool removeFromSet (SimObjectId)
 
bool removeFromSet (const char *)
 
virtual bool writeField (StringTableEntry fieldname, const char *value)
 
virtual void write (Stream &stream, U32 tabStop, U32 flags=0)
 
virtual void writeFields (Stream &stream, U32 tabStop)
 
virtual bool writeObject (Stream *stream)
 
virtual bool readObject (Stream *stream)
 
virtual void buildFilterList ()
 
void addFieldFilter (const char *fieldName)
 
void removeFieldFilter (const char *fieldName)
 
void clearFieldFilters ()
 
bool isFiltered (const char *fieldName)
 
void assignFieldsFrom (SimObject *obj)
 
void assignDynamicFieldsFrom (SimObject *obj)
 
- Public Member Functions inherited from ConsoleObject
const AbstractClassRep::FieldfindField (StringTableEntry fieldName) const
 Get a reference to a field by name. More...
 
virtual AbstractClassRepgetClassRep () const
 Gets the ClassRep. More...
 
bool setField (const char *fieldName, const char *value)
 Set the value of a field. More...
 
virtual ~ConsoleObject ()
 
const AbstractClassRep::FieldListgetFieldList () const
 Get a list of all the fields. This information cannot be modified. More...
 
AbstractClassRep::FieldListgetModifiableFieldList ()
 
bool & getDynamicGroupExpand ()
 
S32 getClassId (U32 netClassGroup) const
 
const char * getClassName () const
 

Static Public Member Functions

static void initPersistFields ()
 
- Static Public Member Functions inherited from SimObject
static void initPersistFields ()
 
- Static Public Member Functions inherited from ConsoleObject
static const char * lookupClassName (const U32 in_classTag)
 Get the classname from a class tag. More...
 
static void initPersistFields ()
 
static void consoleInit ()
 
static AbstractClassRepgetStaticClassRep ()
 Get the abstract class information for this class. More...
 
static AbstractClassRepgetParentStaticClassRep ()
 Get the abstract class information for this class's superclass. More...
 
static ConsoleObjectcreate (const char *in_pClassName)
 
static ConsoleObjectcreate (const U32 groupId, const U32 typeId, const U32 in_classId)
 

Additional Inherited Members

- Public Types inherited from SimObject
enum  WriteFlags { SelectedOnly = BIT(0) }
 
- Protected Types inherited from SimObject
enum  SimObjectNSLinkType { LinkClassName = BIT(0), LinkSuperClassName = BIT(1) }
 
- Protected Member Functions inherited from SimObject
virtual void onTamlPreWrite (void)
 Taml callbacks. More...
 
virtual void onTamlPostWrite (void)
 Called after Taml has finished writing the object. More...
 
virtual void onTamlPreRead (void)
 Called prior to Taml reading the object. More...
 
virtual void onTamlPostRead (const TamlCustomNodes &customNodes)
 
virtual void onTamlAddParent (SimObject *pParentObject)
 Called after Taml has finished reading the object and has added the object to any parent. More...
 
virtual void onTamlCustomWrite (TamlCustomNodes &customNodes)
 Called during the writing of the object to allow custom properties to be written. More...
 
virtual void onTamlCustomRead (const TamlCustomNodes &customNodes)
 Called during the reading of the object to allow custom properties to be read. More...
 
void linkNamespaces ()
 
void unlinkNamespaces ()
 
- Static Protected Member Functions inherited from SimObject
static bool setClass (void *obj, const char *data)
 
static bool setSuperClass (void *obj, const char *data)
 
static bool writeCanSaveDynamicFields (void *obj, StringTableEntry pFieldName)
 
static bool writeInternalName (void *obj, StringTableEntry pFieldName)
 
static bool setParentGroup (void *obj, const char *data)
 
static bool writeParentGroup (void *obj, StringTableEntry pFieldName)
 
static bool writeSuperclass (void *obj, StringTableEntry pFieldName)
 
static bool writeClass (void *obj, StringTableEntry pFieldName)
 
static SimObject::NotifyallocNotify ()
 Get a free Notify structure. More...
 
static void freeNotify (SimObject::Notify *)
 Mark a Notify structure as free. More...
 
- Protected Attributes inherited from SimObject
SimObjectId mId
 Id number for this object. More...
 
StringTableEntry mIdString
 
NamespacemNameSpace
 
U32 mTypeMask
 
S32 mScriptCallbackGuard
 Whether the object is executing a script callback. More...
 
bool mCanSaveFieldDictionary
 true if dynamic fields (added at runtime) should be saved, defaults to true More...
 
StringTableEntry mInternalName
 Stores object Internal Name. More...
 
StringTableEntry mClassName
 Stores the class name to link script class namespaces. More...
 
StringTableEntry mSuperClassName
 Stores super class name to link script class namespaces. More...
 
U8 mNSLinkMask
 
- Static Protected Attributes inherited from SimObject
static SimObject::NotifymNotifyFreeList = NULL
 

Constructor & Destructor Documentation

virtual ~AssetManager ( )
inlinevirtual

Member Function Documentation

void acquireAcquiredReferenceCount ( void  )
inline

Total acquired asset references.

T* acquireAsPrivateAsset ( const char *  pAssetId)
inline

Private asset acquisition.

T* acquireAsset ( const char *  pAssetId)
inline

Public asset acquisition.

bool addDeclaredAsset ( ModuleDefinition pModuleDefinition,
const char *  pAssetFilePath 
)
bool addModuleDeclaredAssets ( ModuleDefinition pModuleDefinition)

Declared assets.

StringTableEntry addPrivateAsset ( AssetBase pAssetBase)
bool compileReferencedAssets ( ModuleDefinition pModuleDefinition)

Referenced assets.

DECLARE_CONOBJECT ( AssetManager  )

Declare Console Object.

bool deleteAsset ( const char *  pAssetId,
const bool  deleteLooseFiles,
const bool  deleteDependencies 
)

Asset deletion.

bool doesAssetDependOn ( const char *  pAssetId,
const char *  pDependsOnAssetId 
)
void dumpDeclaredAssets ( void  ) const
S32 findAllAssets ( AssetQuery pAssetQuery,
const bool  ignoreInternal = true,
const bool  ignorePrivate = true 
)

Asset queries.

S32 findAssetAutoUnload ( AssetQuery pAssetQuery,
const bool  assetAutoUnload,
const bool  assetQueryAsSource = false 
)
S32 findAssetCategory ( AssetQuery pAssetQuery,
const char *  pAssetCategory,
const bool  assetQueryAsSource = false 
)
S32 findAssetDependsOn ( AssetQuery pAssetQuery,
const char *  pAssetId 
)
S32 findAssetInternal ( AssetQuery pAssetQuery,
const bool  assetInternal,
const bool  assetQueryAsSource = false 
)
S32 findAssetIsDependedOn ( AssetQuery pAssetQuery,
const char *  pAssetId 
)
S32 findAssetLooseFile ( AssetQuery pAssetQuery,
const char *  pLooseFile,
const bool  assetQueryAsSource = false 
)
S32 findAssetName ( AssetQuery pAssetQuery,
const char *  pAssetName,
const bool  partialName = false 
)
S32 findAssetPrivate ( AssetQuery pAssetQuery,
const bool  assetPrivate,
const bool  assetQueryAsSource = false 
)
S32 findAssetType ( AssetQuery pAssetQuery,
const char *  pAssetType,
const bool  assetQueryAsSource = false 
)
S32 findInvalidAssetReferences ( AssetQuery pAssetQuery)
S32 findTaggedAssets ( AssetQuery pAssetQuery,
const char *  pAssetTagNames,
const bool  assetQueryAsSource = false 
)
U32 getAcquiredReferenceCount ( void  ) const
inline
StringTableEntry getAssetCategory ( const char *  pAssetId)
StringTableEntry getAssetDescription ( const char *  pAssetId)
StringTableEntry getAssetFilePath ( const char *  pAssetId)
ModuleDefinition * getAssetModuleDefinition ( const char *  pAssetId)
StringTableEntry getAssetName ( const char *  pAssetId)
StringTableEntry getAssetPath ( const char *  pAssetId)
AssetTagsManifest* getAssetTags ( void  ) const
inline
StringTableEntry getAssetType ( const char *  pAssetId)
U32 getDeclaredAssetCount ( void  ) const
inline

Info.

U32 getLoadedExternalAssetCount ( void  ) const
inline
U32 getLoadedInternalAssetCount ( void  ) const
inline
U32 getLoadedPrivateAssetCount ( void  ) const
inline
U32 getMaxLoadedExternalAssetCount ( void  ) const
inline
U32 getMaxLoadedInternalAssetCount ( void  ) const
inline
U32 getMaxLoadedPrivateAssetCount ( void  ) const
inline
U32 getReferencedAssetCount ( void  ) const
inline
void initPersistFields ( )
static
bool isAssetAutoUnload ( const char *  pAssetId)
bool isAssetDependedOn ( const char *  pAssetId,
const char *  pDependedOnByAssetId 
)
bool isAssetInternal ( const char *  pAssetId)
bool isAssetLoaded ( const char *  pAssetId)
bool isAssetPrivate ( const char *  pAssetId)
bool isDeclaredAsset ( const char *  pAssetId)
bool isReferencedAsset ( const char *  pAssetId)
bool loadAssetTags ( ModuleDefinition pModuleDefinition)

Asset tags.

bool onAdd ( void  )
virtual

SimObject overrides.

Reimplemented from SimObject.

void onRemove ( )
virtual

Called when the object is removed from the sim.

Reimplemented from SimObject.

void purgeAssets ( void  )
void refreshAllAssets ( const bool  includeUnloaded = false)
bool refreshAsset ( const char *  pAssetId)
void registerAssetPtrRefreshNotify ( AssetPtrBase pAssetPtrBase,
AssetPtrCallback pCallback 
)
void releaseAcquiredReferenceCount ( void  )
inline
bool releaseAsset ( const char *  pAssetId)
bool removeDeclaredAsset ( const char *  pAssetId)
bool removeDeclaredAssets ( ModuleDefinition pModuleDefinition)
bool renameDeclaredAsset ( const char *  pAssetIdFrom,
const char *  pAssetIdTo 
)
bool renameReferencedAsset ( const char *  pAssetIdFrom,
const char *  pAssetIdTo 
)
bool restoreAssetTags ( void  )
bool saveAssetTags ( void  )
void unregisterAssetPtrRefreshNotify ( AssetPtrBase pAssetPtrBase)

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