Drag[en]gine Game Engine  1.0
deResource Class Reference

Base resource class. More...

#include <deResource.h>

Inheritance diagram for deResource:
deObject deAI deAnimator deAnimatorInstance deBillboard deCamera deCanvas deCaptureCanvas deCollider deComponent deConnection deDebugDrawer deDecal deDynamicSkin deEffect deEnvMapProbe deFileResource deForceField deHeightTerrain deLight deLocomotion deLumimeter deMicrophone deNavigationBlocker deNavigationSpace deNavigator deNetworkState deParticleEmitter deParticleEmitterInstance dePropField deRenderWindow deServer deSky deSmokeEmitter deSpeaker deSynthesizer deSynthesizerInstance deTouchSensor deVideoPlayer deWorld

Public Member Functions

Management
deResourceManagerGetResourceManager () const
 Resource manager or NULL if resource is leaking. More...
 
deEngineGetEngine () const
 Game engine object from resource manager. More...
 
Resource manager linked list
deResourceGetLLManagerPrev () const
 Previous resource in the resource manager linked list. More...
 
void SetLLManagerPrev (deResource *resource)
 Set next resource in the resource manager linked list. More...
 
deResourceGetLLManagerNext () const
 Next resource in the resource manager linked list. More...
 
void SetLLManagerNext (deResource *resource)
 Set next resource in the resource manager linked list. More...
 
void MarkLeaking ()
 Marks the resource leaking. More...
 
- Public Member Functions inherited from deObject
int GetRefCount () const
 Reference count. More...
 
void AddReference ()
 Add reference increasing reference count by 1. More...
 
void FreeReference ()
 Decrease reference count by one and delete object if count reaches 0. More...
 
 deObject ()
 Create object with reference count of 1. More...
 

Constructors and Destructors

 deResource (deResourceManager *resourceManager)
 Create resource. More...
 
virtual ~deResource ()
 Clean up resource. More...
 

Additional Inherited Members

- Protected Member Functions inherited from deObject
virtual ~deObject ()
 Clean up object. More...
 

Detailed Description

Base resource class.

Provides the basic class for all resources. Each resource is assigned the resource manager it originates from and a reference count. If you want to add a reference to this resource do so using the AddReference function. If you want to free the reference you have added before use the FreeReference function and do not call 'delete' on the resource. Once you receive as resource manager subclass the RemoveResource call you have to use 'delete' to dispose of the resource and only then.

Constructor & Destructor Documentation

◆ deResource()

deResource::deResource ( deResourceManager resourceManager)

Create resource.

◆ ~deResource()

virtual deResource::~deResource ( )
protectedvirtual

Clean up resource.

Note
Subclasses should set their destructor protected too to avoid users accidently deleting a reference counted object through the object pointer. Only FreeReference() is allowed to delete the object.

Member Function Documentation

◆ GetEngine()

deEngine* deResource::GetEngine ( ) const

Game engine object from resource manager.

Exceptions
deeInvalidActionif resource is leaking and has no resource manager anymore.

Referenced by GetResourceManager().

◆ GetLLManagerNext()

deResource* deResource::GetLLManagerNext ( ) const
inline

Next resource in the resource manager linked list.

References MarkLeaking(), and SetLLManagerNext().

◆ GetLLManagerPrev()

deResource* deResource::GetLLManagerPrev ( ) const
inline

Previous resource in the resource manager linked list.

References SetLLManagerPrev().

◆ GetResourceManager()

deResourceManager* deResource::GetResourceManager ( ) const
inline

Resource manager or NULL if resource is leaking.

References GetEngine().

◆ MarkLeaking()

void deResource::MarkLeaking ( )

Marks the resource leaking.

Warning
For use by resource managers only.

Referenced by GetLLManagerNext().

◆ SetLLManagerNext()

void deResource::SetLLManagerNext ( deResource resource)

Set next resource in the resource manager linked list.

Warning
For use by resource managers only.

Referenced by GetLLManagerNext().

◆ SetLLManagerPrev()

void deResource::SetLLManagerPrev ( deResource resource)

Set next resource in the resource manager linked list.

Warning
For use by resource managers only.

Referenced by GetLLManagerPrev().


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