AssetManager Class Reference

The AssetManager class manages the AssetGroups that are being used by the framework. An asset managed by the AssetManager is only accessible through the AssetManager and its related classes. That means that you can access assets through their respective "normal" managers (i.e. meshes by Irrlicht's IMeshCache or entities by Sirrf's EntityManager). More...

Inheritance diagram for AssetManager:

Inheritance graph
[legend]
Collaboration diagram for AssetManager:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 AssetManager ()
 Constructor.
 ~AssetManager ()
 Deconstructor.
void init ()
 Initialises the AssetManager.
void clear ()
 Clears the AssetManager.
void grab ()
 Increases the reference counter.
void drop ()
 Decreases the reference counter.
bool addAssetGroup (AssetGroup *group)
 Adds the given AssetGroup to the DataStore.
AssetGroupcreateAssetGroup (const std::string &name, const std::string &dirName, bool grab=true)
 Creates (and adds) a AssetGroup with the given name.
AssetGroupgetAssetGroup (const u32 id)
 Gets the AssetGroup with the given ID.
AssetGroupgetAssetGroup (const std::string &name)
 Gets the AssetGroup with the given name.
bool registerProcessorFactory (const std::string &name, AssetProcessor *(*f)(AssetGroup *))
 Registers an AssetProcessor factory function.
bool unregisterProcessorFactory (const std::string &name)
 Unregisters an AssetProcessor factory function.
void unregisterProcessorFactories ()
 Unregisters all AssetProcessor factory functions.
void removeAssetGroups ()
 Removes all AssetGroups from the AssetManager.
bool removeAssetGroup (AssetGroup *group)
 Removes the given AssetGroup.
bool removeAssetGroup (const u32 id)
 Removes the given AssetGroup with the given ID.
bool removeAssetGroup (const std::string &name)
 Removes the given AssetGroup with the given name.

Friends

class AssetGroup


Detailed Description

The AssetManager class manages the AssetGroups that are being used by the framework. An asset managed by the AssetManager is only accessible through the AssetManager and its related classes. That means that you can access assets through their respective "normal" managers (i.e. meshes by Irrlicht's IMeshCache or entities by Sirrf's EntityManager).

Definition at line 37 of file AssetManager.h.


Constructor & Destructor Documentation

AssetManager::AssetManager (  ) 

Constructor.

Definition at line 23 of file AssetManager.cpp.

AssetManager::~AssetManager (  ) 

Deconstructor.

Definition at line 28 of file AssetManager.cpp.


Member Function Documentation

bool AssetManager::addAssetGroup ( AssetGroup group  ) 

Adds the given AssetGroup to the DataStore.

Parameters:
group Pointer to the AssetGroup to add.
Returns:
True if addition was successful, false if addition was a failure.

Definition at line 57 of file AssetManager.cpp.

void AssetManager::clear (  ) 

Clears the AssetManager.

Definition at line 39 of file AssetManager.cpp.

AssetGroup * AssetManager::createAssetGroup ( const std::string &  name,
const std::string &  dirName,
bool  grab = true 
)

Creates (and adds) a AssetGroup with the given name.

Parameters:
name Name of the AssetGroup.
dirName Name of the base directory of the asset group.
grab Should the AssetsManager add the loaded asset group to the internal list?
Returns:
Pointer to the AssetGroup on success, NULL on failure.

Definition at line 75 of file AssetManager.cpp.

void AssetManager::drop (  )  [virtual]

Decreases the reference counter.

Note:
This is a dummy function.

Reimplemented from ReferenceCounted.

Definition at line 51 of file AssetManager.cpp.

AssetGroup * AssetManager::getAssetGroup ( const std::string &  name  ) 

Gets the AssetGroup with the given name.

Returns:
Pointer to the AssetGroup if found, else NULL.

Definition at line 106 of file AssetManager.cpp.

AssetGroup * AssetManager::getAssetGroup ( const u32  id  ) 

Gets the AssetGroup with the given ID.

Returns:
Pointer to the AssetGroup if found, else NULL.

Definition at line 94 of file AssetManager.cpp.

void AssetManager::grab (  )  [virtual]

Increases the reference counter.

Note:
This is a dummy function.

Reimplemented from ReferenceCounted.

Definition at line 45 of file AssetManager.cpp.

void AssetManager::init (  ) 

Initialises the AssetManager.

Definition at line 33 of file AssetManager.cpp.

bool AssetManager::registerProcessorFactory ( const std::string &  name,
AssetProcessor *(*)(AssetGroup *)  f 
)

Registers an AssetProcessor factory function.

Returns:
True if addition was succesful, false if addition was a failure.

Definition at line 128 of file AssetManager.cpp.

bool AssetManager::removeAssetGroup ( const std::string &  name  ) 

Removes the given AssetGroup with the given name.

Parameters:
name Name of the AssetGroup to remove.
Returns:
True if removal was successful, false if removal was a failure.

Definition at line 225 of file AssetManager.cpp.

bool AssetManager::removeAssetGroup ( const u32  id  ) 

Removes the given AssetGroup with the given ID.

Parameters:
id ID of the AssetGroup to remove.
Returns:
True if removal was successful, false if removal was a failure.

Definition at line 203 of file AssetManager.cpp.

bool AssetManager::removeAssetGroup ( AssetGroup group  ) 

Removes the given AssetGroup.

Parameters:
group Pointer to the AssetGroup to remove.
Returns:
True if removal was successful, false if removal was a failure.

Definition at line 177 of file AssetManager.cpp.

void AssetManager::removeAssetGroups (  ) 

Removes all AssetGroups from the AssetManager.

Definition at line 167 of file AssetManager.cpp.

void AssetManager::unregisterProcessorFactories (  ) 

Unregisters all AssetProcessor factory functions.

Definition at line 161 of file AssetManager.cpp.

bool AssetManager::unregisterProcessorFactory ( const std::string &  name  ) 

Unregisters an AssetProcessor factory function.

Returns:
True if removal was successful, false if removal was a failure.

Definition at line 144 of file AssetManager.cpp.


Friends And Related Function Documentation

friend class AssetGroup [friend]

Definition at line 39 of file AssetManager.h.


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

Generated on Fri Aug 21 23:55:12 2009 for Sirrf - Simple Irrlicht Framework by  doxygen 1.5.8