ResourceManager.h File Reference

Defines classes and types for loading/creating managed resources. More...

#include <assert.h>
#include <iostream>
#include <string>
#include <vector>
#include "Common/BaseTypes.h"
#include "Common/Path.h"

Classes

class  ForceNoResourceSharing
 Can be used as init data to force the Resource manager to never share a resource. More...
class  Resource< initType >
 The base type for all managed resources. More...
class  ResourceRef< resType, initType >
 The class used to access resource data. More...
class  ResourceMgr< resType, initType >
 Loads and manages Resource data of a spacific type. More...

Defines

#define DECLARE_RESOURCE_TYPE(className)
 Defines two types for the given Resourse class.
#define DECLARE_COMPLEX_RESOURCE_TYPE(className, loadDataType)
 Defines two types for the given Resouese class.
#define DECLARE_RESOURCE_LOAD_FUNCTION()   virtual bool Load(const char *filePath, const char *fileName, const VoidResourceInitData *void_data_do_not_use_);
 Helpful macro for declaring the Resource Load function in classes that derive from the Resource class.
#define DECLARE_COMPLEX_RESOURCE_LOAD_FUNCTION(loadDataType, initDataName)   virtual bool Load(const char *filePath, const char *fileName, const loadDataType *initDataName);
 Helpful macro for declaring the Resource Load function in classes that derive from the Resource class that uses user defined initialization data.
#define IMPLEMENT_RESOURCE_LOAD_FUNCTION(className)   bool className::Load(const char *filePath, const char *fileName, const VoidResourceInitData *_void_data_do_not_use_)
 Helpful macro for implemeting the Resource Load function. Should be used in conjuction with the DECLARE_RESOURCE_LOAD_FUNCTION macro.
#define IMPLEMENT_COMPLEX_RESOURCE_LOAD_FUNCTION(className, loadDataType, initDataName)   bool className::Load(const char *filePath, const char *fileName, const loadDataType *initDataName)
 Helpful macro for implemeting the Resource Load function. Should be used in conjuction with the DECLARE_COMPLEX_RESOURCE_LOAD_FUNCTION macro.

Typedefs

typedef int ResourceID
 The type used to uniquely identify managed resources of a certain type.

Variables

const ResourceID NULL_RESOURCEID = -1
 NULL ResourceID. Serves the same purpose as NULL but is used with ResourceIDs.

Detailed Description

Defines classes and types for loading/creating managed resources.

Author:
Joe Forte
Date:
5/19/2008

Defines the Resource class that all managed resources must inherit from. The ResourceMgr class responsible for managing resources is also defined.


Define Documentation

#define DECLARE_COMPLEX_RESOURCE_LOAD_FUNCTION ( loadDataType,
initDataName   )     virtual bool Load(const char *filePath, const char *fileName, const loadDataType *initDataName);

Helpful macro for declaring the Resource Load function in classes that derive from the Resource class that uses user defined initialization data.

Parameters:
[in] loadDataType the data type of the inialization data.
[in] initDataName the name of the function paramater for the pointer to the initialization data.
See also:
Font
#define DECLARE_COMPLEX_RESOURCE_TYPE ( className,
loadDataType   ) 
Value:
typedef ResourceRef<className, loadDataType> className##Ref; \
        typedef ResourceMgr<className, loadDataType> className##Mgr;

Defines two types for the given Resouese class.

Parameters:
[in] className the name of the resource class.
[in] loadDataType the data type used when loading a resource.

For instance, given a resource class Mesh the following types are defined

  1. MeshRef (a ResourceRef type used for accessing the Mesh resource)
  2. MeshMgr (the Resource Manager class for managing mesh resources)
 
#define DECLARE_RESOURCE_LOAD_FUNCTION (  )     virtual bool Load(const char *filePath, const char *fileName, const VoidResourceInitData *void_data_do_not_use_);

Helpful macro for declaring the Resource Load function in classes that derive from the Resource class.

See also:
Image
#define DECLARE_RESOURCE_TYPE ( className   ) 
Value:

Defines two types for the given Resourse class.

Parameters:
[in] className the name of the resource class.

For instance, given a resource class Mesh the following types are defined

  1. MeshRef (a ResourceRef type used for accessing the Mesh resource)
  2. MeshMgr (the Resource Manager class for managing mesh resources)
#define IMPLEMENT_COMPLEX_RESOURCE_LOAD_FUNCTION ( className,
loadDataType,
initDataName   )     bool className::Load(const char *filePath, const char *fileName, const loadDataType *initDataName)

Helpful macro for implemeting the Resource Load function. Should be used in conjuction with the DECLARE_COMPLEX_RESOURCE_LOAD_FUNCTION macro.

Parameters:
[in] className the name of the resource class.
[in] loadDataType the data type of the inialization data.
[in] initDataName the name of the function paramater for the pointer to the initialization data.
See also:
Image
DECLARE_COMPLEX_RESOURCE_LOAD_FUNCTION
#define IMPLEMENT_RESOURCE_LOAD_FUNCTION ( className   )     bool className::Load(const char *filePath, const char *fileName, const VoidResourceInitData *_void_data_do_not_use_)

Helpful macro for implemeting the Resource Load function. Should be used in conjuction with the DECLARE_RESOURCE_LOAD_FUNCTION macro.

Parameters:
[in] className the name of the resource class.
See also:
Image
DECLARE_RESOURCE_LOAD_FUNCTION
Generated on Mon Apr 5 19:08:05 2010 for BrickOut |ReDuX| by  doxygen 1.6.3