# OgreResource.h File Reference

`#include "OgrePrerequisites.h"`
`#include "OgreString.h"`
`#include "OgreSharedPtr.h"`
`#include "OgreStringInterface.h"`
`#include "OgreAtomicWrappers.h"`

Go to the source code of this file.

## Namespaces

namespace | Ogre

## Typedefs

typedef unsigned long | ResourceHandle
typedef SharedPtr< Resource > | ResourcePtr
| Shared pointer to a Resource.

## Typedef Documentation

typedef unsigned long Ogre::ResourceHandle

| Definition at line 40 of file OgreResource.h.

typedef SharedPtr<Resource> Ogre::ResourcePtr

Shared pointer to a Resource.

Remarks:
  This shared pointer allows many references to a resource to be held, and when the final reference is removed, the resource will be destroyed. Note that the ResourceManager which created this Resource will be holding at least one reference, so this resource will not get destroyed until someone removes the resource from the manager - this at least gives you strong control over when resources are freed. But the nature of the shared pointer means that if anyone refers to the removed resource in the meantime, the resource will remain valid.

  You may well see references to ResourcePtr (i.e. ResourcePtr&) being passed around internally within Ogre. These are 'weak references' ie they do not increment the reference count on the Resource. This is done for efficiency in temporary operations that shouldn't need to incur the overhead of maintaining the reference count; however we don't recommend you do it yourself since these references are not guaranteed to remain valid.

Definition at line 466 of file OgreResource.h.

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sat Apr 11 13:46:45 2009