ResourceMgr< resType, initType > Class Template Reference
Loads and manages Resource data of a spacific type.
More...
#include <Memory/ResourceManager.h>
List of all members.
Detailed Description
template<class resType, class initType>
class ResourceMgr< resType, initType >
Loads and manages Resource data of a spacific type.
- Template Parameters:
-
| resType | The type of the Resource being managed. Must inherit from the Resource class. |
| initType | The data type of the object passed into the Load function. initType must have a default constructor and have the following operators overloaded:
- bool operator==(const initType&) const
|
Member Function Documentation
template<class resType , class initType >
Estimates the total number of bytes used by all managed resources.
- Returns:
- The estimated number of bytes used.
template<class resType , class initType >
uint ResourceMgr< resType, initType >::GetNumberOfResourcesLoaded |
( |
|
) |
[inline] |
Gets the number of resources being managed.
- Returns:
- The number of managed resources.
template<class resType , class initType >
std::vector<resType*> ResourceMgr< resType, initType >::GetResources |
( |
|
) |
const [inline] |
Gets the resource data.
- Returns:
- The vector of resources.
template<class resType , class initType >
ResourceRef< resType, initType > ResourceMgr< resType, initType >::LoadResource |
( |
const char * |
fileName, |
|
|
const initType * |
initData = NULL , |
|
|
bool |
useResourcePath = true | |
|
) |
| | [inline] |
Loads a resource.
- Parameters:
-
[in] | fileName | name of the resource file to load. |
[in] | initData | pointer to the initialization data. Defaults to NULL. |
[in] | useResourcePath | set to true to use the currently set resource path. Defaults to true. |
- Returns:
- A Resource Referance to the loaded data or an invalid if the file couldn't be loaded.
template<class resType , class initType >
void ResourceMgr< resType, initType >::SetDefaultResource |
( |
const char * |
defaultResourcePath, |
|
|
const initType * |
initData = NULL | |
|
) |
| | [inline] |
Sets the default resource to use when a resource is loaded that doesn't exist.
- Parameters:
-
[in] | defaultResourcePath | the path to a default resource that must exist or NULL if no default resource is needed. |
[in] | initData | the initialization data for the default resource. Defaults to NULL. |
template<class resType , class initType >
void ResourceMgr< resType, initType >::SetResourcePath |
( |
const char * |
p |
) |
[inline] |
Sets a path to be concatenated onto all file names when loading resources.
- Parameters:
-
The documentation for this class was generated from the following file: