deFileResourceList Class Reference

Resource list class. More...

#include <deFileResourceList.h>

List of all members.

Public Member Functions

Constructors and Destructors
 deFileResourceList ()
 Creates a new resource list.
 ~deFileResourceList ()
 Cleans up the resource list without freeing resources in the list.
Management
int GetResourceCount () const
 Retrieves the count of resources.
deFileResourceGetResourceAt (int index) const
 Retrieves the resource at the given index.
deFileResourceGetResourceNamed (const char *filename) const
 Retrieves the resource with the given filename.
int IndexOfResource (deFileResource *resource) const
 Retrieves the index of the given resource or -1 if not found.
bool HasResource (deFileResource *resource) const
 Determines if the given resource is part of the list.
void AddResource (deFileResource *resource)
 Adds a resource to the list without adding a reference to it.
void RemoveResource (deFileResource *resource)
 Removes a resource from the list without freeing it.
void RemoveAllResources ()
 Removes all resources without freeing them.

Detailed Description

Resource list class.

The resource list class is the backend for resource management. This list contains the main reference to the resource object. The list does not call 'delete' on the resource object but removes the pointer to it. The resource object calls 'delete' on itself thus never call it yourself except one situation. If you have created a resource object and have not added it to the resource list yet you have to use call 'delete' on it yourself to avoid triggering RemoveResource on the resource manager.

Author:
Plüss Roland
Version:
1.0
Date:
2008

Constructor & Destructor Documentation

deFileResourceList::deFileResourceList (  )

Creates a new resource list.

deFileResourceList::~deFileResourceList (  )

Cleans up the resource list without freeing resources in the list.


Member Function Documentation

void deFileResourceList::AddResource ( deFileResource resource )

Adds a resource to the list without adding a reference to it.

deFileResource* deFileResourceList::GetResourceAt ( int  index ) const

Retrieves the resource at the given index.

int deFileResourceList::GetResourceCount (  ) const [inline]

Retrieves the count of resources.

deFileResource* deFileResourceList::GetResourceNamed ( const char *  filename ) const

Retrieves the resource with the given filename.

bool deFileResourceList::HasResource ( deFileResource resource ) const

Determines if the given resource is part of the list.

int deFileResourceList::IndexOfResource ( deFileResource resource ) const

Retrieves the index of the given resource or -1 if not found.

void deFileResourceList::RemoveAllResources (  )

Removes all resources without freeing them.

void deFileResourceList::RemoveResource ( deFileResource resource )

Removes a resource from the list without freeing it.


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