ork::ResourceFactory::Type< t, T > Class Template Reference

A utility template to automate the registration of new resource types. More...

#include <ResourceFactory.h>

List of all members.

Public Member Functions

 Type ()
 Creates a new Type instance.

Static Public Member Functions

static ptr< Objectctor (ptr< ResourceManager > manager, const string &name, ptr< ResourceDescriptor > desc, const TiXmlElement *e)
 Creation function for resources of class T.

Detailed Description

template<const char * t, class T>
class ork::ResourceFactory::Type< t, T >

A utility template to automate the registration of new resource types.

Template Parameters:
t a resource type (e.g. texture1D, shader, mesh, etc).
T the corresponding concrete Resource class. This class must be instantiated for all resources of type t.

Constructor & Destructor Documentation

template<const char * t, class T >
ork::ResourceFactory::Type< t, T >::Type (  )  [inline]

Creates a new Type instance.

This constructor registers the creation function ctor (encapsulating a call to new T) with the resource type t in the ResourceFactory instance. Hence declaring a static variable of type Type<t, T> automatically registers a new resource type.


Member Function Documentation

template<const char * t, class T >
static ptr<Object> ork::ResourceFactory::Type< t, T >::ctor ( ptr< ResourceManager manager,
const string &  name,
ptr< ResourceDescriptor desc,
const TiXmlElement *  e 
) [inline, static]

Creation function for resources of class T.

This function just calls new T(manager, name, desc, e). See ResourceFactory::createFunc


Generated on Mon Oct 18 09:36:11 2010 for ork by  doxygen 1.6.1