Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes

Resource Class Reference

A basic Resource. More...

#include <Resource.h>

Inheritance diagram for Resource:
Font Image Music Skin Sound

List of all members.

Public Member Functions

 Resource (const std::string &filePath)
 Resource ()
virtual ~Resource ()
const std::string & getName () const
const std::string & getErrorMessage () const
const Uint getID () const
bool isLoaded () const

Protected Attributes

std::string mResourceName
std::string mErrorDescription
bool mIsLoaded

Private Member Functions

virtual void load ()=0

Private Attributes

Uint mGUID

Detailed Description

A basic Resource.

A base Resource class from which all other resources are derived. Provides the basic framework for Resources to load and initialize themselves.

Can be used with or without a ResourceManager however it is recommended that a ResourceManager be used.

Todo:
Determine if the 'GUID' field is necessary.

Constructor & Destructor Documentation

Resource::Resource ( const std::string &  filePath  ) 
Resource::Resource (  ) 

Default Constructor.

virtual Resource::~Resource (  )  [inline, virtual]

Member Function Documentation

const std::string& Resource::getErrorMessage (  )  const [inline]

Returns the last error message.

const Uint Resource::getID (  )  const [inline]

Returns the GUID of this Resource.

const std::string& Resource::getName (  )  const [inline]

Returns the name of the Resource as a file name with directory path.

bool Resource::isLoaded (  )  const [inline]

Returns true if this Resource loaded properly.

virtual void Resource::load (  )  [private, pure virtual]

Performs the necessary operations to load a Resource.

Note:
This is a pure virtual function and so must be overridden by all derived classes.
It is the responsibility of the derived class to call this function.

Implemented in Font, Image, Music, Skin, and Sound.


Member Data Documentation

std::string Resource::mErrorDescription [protected]

Internal Error Message.

Uint Resource::mGUID [private]

A 'unique' id for this resource.

bool Resource::mIsLoaded [protected]

Flag indicating whether or not this Resource has loaded properly.

std::string Resource::mResourceName [protected]

File path and internal identifier.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines