Main Page | Class Hierarchy | Class List | File List | Class Members | Related Pages

CResourceManager Class Reference

Basic Resource Manager class. More...

#include <ResourceManager.h>

Inheritance diagram for CResourceManager:

CDoubleList< CXMLResource * > CXMLResource CResource CEntity CAnimationManager CFontManager CMaterialManager CTextureManager List of all members.

Public Member Functions

virtual CXMLResourceLoadResource (TiXmlNode *pDataNode, CString strFilename, UINT uiID=0, CString strName="")=0
virtual CXMLResourceGetResource (int uiIndex, int uiID=-1, CString strName="", CString strFilename="")
virtual CXMLResourceAddResource (CString strName, UINT uiID=0, eEntityType ResourceType=Entity_Default)
int RemoveResource (CXMLResource *pResource)
virtual int LoadXML (TiXmlNode *pDataNode, CString strFilename)
virtual int SaveXML (TiXmlNode *pDataNode, CString strFilename)
virtual void Destroy ()
virtual bool IsOfType (eEntityType eType)

Detailed Description

Basic Resource Manager class.

This class serves as a base class for other resource managers. It manages a collection of resources (although not pooled yet!) and allow to retrieve them by index, name, ID or filename.

Definition at line 15 of file ResourceManager.h.


Member Function Documentation

CXMLResource * CResourceManager::AddResource CString  strName,
UINT  uiID = 0,
eEntityType  ResourceType = Entity_Default
[virtual]
 

Method details:

Parameters:
strName - Name of the resource to add
uiID - ID of the resource to add
ResourceType - Type of the resource to add
Returns:
Pointer to the resource if it has been added succesfully using given parameters, NULL if not

Reimplemented in CAnimationManager, CFontManager, CMaterialManager, and CTextureManager.

Definition at line 34 of file ResourceManager.cpp.

void CResourceManager::Destroy  )  [virtual]
 

Method details: This is where clean-up occurs

Reimplemented from CXMLResource.

Reimplemented in CAnimationManager, CFontManager, CMaterialManager, and CTextureManager.

Definition at line 96 of file ResourceManager.cpp.

References CXMLResource::Destroy(), CDoubleList< CXMLResource * >::pop_back(), and CDoubleList< CXMLResource * >::size().

Referenced by CTextureManager::Destroy(), CMaterialManager::Destroy(), CFontManager::Destroy(), and CAnimationManager::Destroy().

CXMLResource * CResourceManager::GetResource int  uiIndex,
int  uiID = -1,
CString  strName = "",
CString  strFilename = ""
[virtual]
 

Method details:

Parameters:
uiIndex - Index by which to retrieve the resource
uiID - ID by which to retrieve the resource
strName - Name by which to retrieve the resource
strFilename - Filename by which to retrieve the resource
Returns:
Pointer to the resource if it has been found using given parameters, NULL if not

Reimplemented in CAnimationManager, CFontManager, CMaterialManager, and CTextureManager.

Definition at line 40 of file ResourceManager.cpp.

References CDoubleList< CXMLResource * >::at(), CDoubleList< CXMLResource * >::begin(), CXMLResource::GetFilename(), CEntity::GetID(), CEntity::GetName(), CDoubleList< CXMLResource * >::next(), CDoubleList< CXMLResource * >::set_ptr(), and CDoubleList< CXMLResource * >::size().

bool CResourceManager::IsOfType eEntityType  eType  )  [virtual]
 

Method details: This is an implementation of Custom RTTI

Reimplemented from CXMLResource.

Reimplemented in CAnimationManager, CFontManager, CMaterialManager, and CTextureManager.

Definition at line 107 of file ResourceManager.cpp.

References CXMLResource::IsOfType().

Referenced by CTextureManager::IsOfType(), CMaterialManager::IsOfType(), CFontManager::IsOfType(), and CAnimationManager::IsOfType().

virtual CXMLResource* CResourceManager::LoadResource TiXmlNode pDataNode,
CString  strFilename,
UINT  uiID = 0,
CString  strName = ""
[pure virtual]
 

Method details:

Parameters:
pDataNode - Pointer to XML Data node containing data for the resource
strFilename - Name of the file containing data for the resource
uiID - ID for the resource to be loaded
strName - Name for the resource to be loaded
Returns:
Pointer to the resource if it has been loaded succesfully, NULL if not

Implemented in CAnimationManager, CFontManager, CMaterialManager, and CTextureManager.

int CResourceManager::LoadXML TiXmlNode pDataNode,
CString  strFilename
[virtual]
 

Method details:

Parameters:
pDataNode - Pointer to XML Node that holds data for this resource
strFilename - String containing filename where the data for the resource is stored

Reimplemented from CXMLResource.

Reimplemented in CAnimationManager, CFontManager, CMaterialManager, and CTextureManager.

Definition at line 14 of file ResourceManager.cpp.

References CXMLResource::LoadXML().

Referenced by CTextureManager::LoadXML(), CMaterialManager::LoadXML(), CFontManager::LoadXML(), and CAnimationManager::LoadXML().

int CResourceManager::RemoveResource CXMLResource pResource  ) 
 

Method details:

Parameters:
pResource - Pointer to the resource to remove
Returns:
1 if it has been found and removed succesfully, 0 otherwise
Definition at line 90 of file ResourceManager.cpp.

int CResourceManager::SaveXML TiXmlNode pDataNode,
CString  strFilename
[virtual]
 

Method details:

Parameters:
pDataNode - Pointer to XML Node that will be the parent hold the data for this resource
strFilename - String containing filename where the data for the resource is stored

Reimplemented from CXMLResource.

Reimplemented in CAnimationManager, CFontManager, CMaterialManager, and CTextureManager.

Definition at line 28 of file ResourceManager.cpp.


The documentation for this class was generated from the following files:
Generated on Sun Jul 17 21:34:30 2005 for OpenGL GUI by doxygen 1.3.8