Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | Related Pages

wftk::ResourceRegistry< R, Loader, Invalid, Destroy > Class Template Reference

R is the class of the resource type Loader specifies how to load the resource from a file Invalid specifies the fallback mechanism if a resource isn't found Destroy specifies how to free the resource data when the resource is freed. More...

#include <resources.h>

List of all members.

Public Types

typedef Resource< R, Destroy > Resource
 the type resource this registry holds

typedef StringHash< Resource
* >::Map 
ResourceMap
 internal registry map type


Public Member Functions

Resourceload (const std::string &resname, const std::string &spec)
 template for loading a Resource from disk

ResourceloadAnonymous (const std::string &spec)
 For this one, you own a reference to the resource returned.

void insert (const std::string &resname, Resource *res)
 insert a Resource into the pool The resource must be valid

Invalid::OutType find (const std::string &resname) const
 Find a resource, with fallback on failure.

Resourceget (const std::string &resname) const
 Find a resource, return null on failure.

void unregisterAll ()
 Release all resources in this registry.

ResourceMap::const_iterator begin () const
 begin() function for internal map

ResourceMap::const_iterator end () const
 end() function for internal map

ResourceMap::size_type size () const
 size() function for internal map

bool empty () const
 empty() function for internal map


Detailed Description

template<class R, class Loader = ResLoad<R>, class Invalid = ResInval<R>, class Destroy = ResDestroy<R>>
class wftk::ResourceRegistry< R, Loader, Invalid, Destroy >

R is the class of the resource type Loader specifies how to load the resource from a file Invalid specifies the fallback mechanism if a resource isn't found Destroy specifies how to free the resource data when the resource is freed.


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

Generated Thu Mar 18 20:06:05 2004.
Copyright © 1998-2003 by the respective authors.

This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.