AaronCameron.net
What's your point?
Not a Member? - Login or Create an Account...MC Offline
Tuesday the 19th of September 2017 @ 11:05am
Front Page Projects Your Profile About
[]

LibN2L-4 Library Code Reference

Classes
Compounds
Files
Members
Method Index
Full Reference

n2l::cResourceManager Class Reference

A caching resource loader which allows the request of files from a vfs root without the development overhead of searching, checking and casting. More...

#include <cResourceManager.h>

Collaboration diagram for n2l::cResourceManager:

Collaboration graph
[legend]
List of all members.

Static Public Member Functions

Classes

  • class cResource
    Common handle for internally stored resource items.
  • class cResourceSheath
    A customizable child of cResource to specalize the loading of individual resources.

Detailed Description

A caching resource loader which allows the request of files from a vfs root without the development overhead of searching, checking and casting.

Definition at line 46 of file cResourceManager.h.


Member Function Documentation

static const tUint n2l::cResourceManager::aggLoadTime  )  [inline, static]
 

Definition at line 146 of file cResourceManager.h.

static void n2l::cResourceManager::clearAggLoadTime  )  [inline, static]
 

Definition at line 147 of file cResourceManager.h.

void n2l::cResourceManager::clearAllCache  )  [static]
 

Remove all auto pointers to cached elements.

Any outstanding Instances of these resources will still be held, but the copy in the resource manager will be removed.

Warning:
If a resource is still held outside the resource manager, and it is cleared and re-requested the resource manager will have no knowledge of the outstanding copy and will load a new copy. Since this behaviour is generally not wanted it is usually better to call clearUnusedCache() instead, which will retain copies of resources still in use.
See also:
clearUnusedCache
Note:
It's usually a good idea to call this method right before you shut down your application and shut down n2l.

Definition at line 175 of file cResourceManager.cpp.

void n2l::cResourceManager::clearCachedResource const tString iName  )  [static]
 

Definition at line 182 of file cResourceManager.cpp.

References n2l::n2lDebug().

void n2l::cResourceManager::clearUnusedCache  )  [static]
 

Remove any currently unused resources from the resource managers cache.

This is a good idea if you want to clean house, but don't want to end up with duplicate copies of resources in memory over time.

See also:
clearAllCache

Definition at line 196 of file cResourceManager.cpp.

References n2l::n2lDebug().

const cAutoPtr< const cVfsDirectoryInterface > & n2l::cResourceManager::dataRoot  )  [static]
 

Request the current data root.

Definition at line 52 of file cResourceManager.cpp.

void n2l::cResourceManager::dataRoot const cAutoPtr< const cVfsDirectoryInterface > &  iDataRoot  )  [static]
 

Specify a data root to use for loading resource files.

Definition at line 44 of file cResourceManager.cpp.

template<class TRes>
static const cAutoPtr<const TRes>& n2l::cResourceManager::get const tString iName  )  [inline, static]
 

Definition at line 68 of file cResourceManager.h.

References n2l::n2lDebug(), n2l::n2lGetTicks(), and n2l::cException::rethrow().

const cAutoPtr< const cGuiElement > & n2l::cResourceManager::getGuiElement const tString iName  )  [static]
 

Definition at line 58 of file cResourceManager.cpp.

References n2l::cGuiFactory::current(), n2l::cGuiFactory::load(), n2l::n2lDebug(), n2l::n2lGetTicks(), and n2l::cException::rethrow().

Referenced by n2l::cGuiTextDisplay::load(), n2l::cGuiSButtonSelectBox::load(), n2l::cGuiCanvas::load(), and n2l::cGuiButtonSelectBox::load().

const tString n2l::cResourceManager::getReferenceReport  )  [static]
 

Definition at line 158 of file cResourceManager.cpp.

References n2l::asString().

const cAutoPtr< const cVfsNodeInterface > & n2l::cResourceManager::getVfsNode const tString iName  )  [static]
 

Definition at line 92 of file cResourceManager.cpp.

References n2l::n2lDebug(), n2l::n2lGetTicks(), and n2l::cException::rethrow().

Referenced by n2l::cGuiSEFactory::load(), and n2l::cGuiACFactory::load().

const tUint n2l::cResourceManager::numReferences const tString iName  )  [static]
 

Get the number of references to the requested file.

Definition at line 150 of file cResourceManager.cpp.

void n2l::cResourceManager::refreshTextures  )  [static]
 

Reload all textures.

Definition at line 127 of file cResourceManager.cpp.

References n2l::n2lDebug().


The documentation for this class was generated from the following files:
©2017 Aaron Cameron