Caelum::OwnedResourcePtrTraits< PointedT, InnerT, ManagerT > Struct Template Reference

OwnedPtr traits for uniquely-owned resources. More...

#include <OwnedPtr.h>

List of all members.

Public Types

typedef InnerT InnerPointerType

Static Public Member Functions

static const InnerT getNullValue ()
static PointedT * getPointer (const InnerPointerType &inner)
static void destroy (InnerPointerType &inner)


Detailed Description

template<class PointedT, class InnerT, class ManagerT>
struct Caelum::OwnedResourcePtrTraits< PointedT, InnerT, ManagerT >

OwnedPtr traits for uniquely-owned resources.

All ogre resources are tracked by a resource managed by name and can be globally referenced from multiple places. This traits class allows you to hold a pointer to a resource which you create and completely control.

The best example of this is a cloned material. It is frequently useful to create a clone of an existing material and tweak settings for one particular usage. After the clone is no longer useful the material must be explicitly removed from the MaterialManager. Otherwise an unloaded resource handle is leaked.

When the OwnedPtr gets out of scope the resource is removed from the manager. In debug mode this will also check that there are no other references to the destroyed resource.

Definition at line 207 of file OwnedPtr.h.


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

Generated on Mon Jan 19 09:15:32 2009 for Caelum by  doxygen 1.5.6