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

OgreResource.h File Reference

#include "OgrePrerequisites.h"
#include "OgreString.h"
#include "OgreSharedPtr.h"
#include "OgreStringInterface.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 35 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 245 of file OgreResource.h.


Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Jul 23 10:05:43 2006