A utility template to automate the registration of new resource types. More...
#include <ResourceFactory.h>
Public Member Functions | |
Type () | |
Creates a new Type instance. | |
Static Public Member Functions | |
static ptr< Object > | ctor (ptr< ResourceManager > manager, const string &name, ptr< ResourceDescriptor > desc, const TiXmlElement *e) |
Creation function for resources of class T. |
A utility template to automate the registration of new resource types.
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. |
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.
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