Resource Class Reference

#include <resource.h>

Inheritance diagram for Resource:

Image ImageSet Music SoundEffect SpriteDef SubImage Tileset

List of all members.


Detailed Description

A generic reference counted resource object.

Definition at line 31 of file resource.h.


Public Member Functions

 Resource ()
 Constructor.
void incRef ()
 Increments the internal reference count.
void decRef ()
 Decrements the reference count and deletes the object if no references are left.
const std::string & getIdPath () const
 Return the path identifying this resource.

Protected Member Functions

virtual ~Resource ()
 Destructor.

Private Attributes

std::string mIdPath
 Path identifying this resource.
time_t mTimeStamp
 Time at which the resource was orphaned.
unsigned mRefCount
 Reference count.

Friends

class ResourceManager

Constructor & Destructor Documentation

Resource::Resource (  )  [inline]

Constructor.

Definition at line 39 of file resource.h.

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

Destructor.

Definition at line 28 of file resource.cpp.


Member Function Documentation

void Resource::incRef (  ) 

Increments the internal reference count.

Definition at line 32 of file resource.cpp.

void Resource::decRef (  ) 

Decrements the reference count and deletes the object if no references are left.

Returns:
true if the object was deleted false otherwise.

Definition at line 37 of file resource.cpp.

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

Return the path identifying this resource.

Definition at line 58 of file resource.h.


Friends And Related Function Documentation

friend class ResourceManager [friend]

Definition at line 33 of file resource.h.


Member Data Documentation

std::string Resource::mIdPath [private]

Path identifying this resource.

Definition at line 68 of file resource.h.

time_t Resource::mTimeStamp [private]

Time at which the resource was orphaned.

Definition at line 69 of file resource.h.

unsigned Resource::mRefCount [private]

Reference count.

Definition at line 70 of file resource.h.


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

Generated on Sun Apr 26 17:30:44 2009 for The Mana World by  doxygen 1.5.5