Ogre::SharedPtr< T > Class Template Reference
General

Reference-counted shared pointer, used for objects where implicit destruction is required. More...

`#include <OgreSharedPtr.h>`

List of all members.

## Public Member Functions

OGRE_AUTO_SHARED_MUTEX | SharedPtr ()
| Constructor, does not initialise the SharedPtr.
template<class Y >
| SharedPtr (Y *rep, SharedPtrFreeMethod inFreeMethod=SPFM_DELETE)
| Constructor.
| SharedPtr (const SharedPtr &r)
SharedPtr & | operator= (const SharedPtr &r)
template<class Y >
| SharedPtr (const SharedPtr< Y > &r)
template<class Y >
SharedPtr & | operator= (const SharedPtr< Y > &r)
virtual | ~SharedPtr ()
T & | operator* () const
T * | operator-> () const
T * | get () const
void | bind (T *rep, SharedPtrFreeMethod inFreeMethod=SPFM_DELETE)
| Binds rep to the SharedPtr.
bool | unique () const
unsigned int | useCount () const
unsigned int * | useCountPointer () const
T * | getPointer () const
SharedPtrFreeMethod | freeMethod () const
bool | isNull (void) const
void | setNull (void)

## Protected Member Functions

void | release (void)
virtual void | destroy (void)
virtual void | swap (SharedPtr< T > &other)

## Protected Attributes

T * | pRep
unsigned int * | pUseCount
SharedPtrFreeMethod | useFreeMethod

## Detailed Description

### template<class T>
class Ogre::SharedPtr< T >

Reference-counted shared pointer, used for objects where implicit destruction is required.

Remarks:
  This is a standard shared pointer implementation which uses a reference count to work out when to delete the object.

  If OGRE_THREAD_SUPPORT is defined to be 1, use of this class is thread-safe.

Definition at line 60 of file OgreSharedPtr.h.

## Constructor & Destructor Documentation

template<class T>

OGRE_AUTO_SHARED_MUTEX Ogre::SharedPtr< T >::SharedPtr | ( |  | ) |

Constructor, does not initialise the SharedPtr.

Remarks:
  Dangerous! You have to call bind() before using the SharedPtr.

Definition at line 72 of file OgreSharedPtr.h.

template<class T>
template<class Y >

Ogre::SharedPtr< T >::SharedPtr | ( | Y * | rep,
|  | SharedPtrFreeMethod | inFreeMethod = `SPFM_DELETE`
| ) |  | `[explicit]`

Constructor.

Parameters:

  rep | The pointer to take ownership of
  freeMode | The mechanism to use to free the pointer

Definition at line 82 of file OgreSharedPtr.h.

template<class T>

Ogre::SharedPtr< T >::SharedPtr | ( | const SharedPtr< T > & | r | ) |

Definition at line 93 of file OgreSharedPtr.h.

template<class T>
template<class Y >

Ogre::SharedPtr< T >::SharedPtr | ( | const SharedPtr< Y > & | r | ) |

Definition at line 124 of file OgreSharedPtr.h.

template<class T>

virtual Ogre::SharedPtr< T >::~SharedPtr | ( |  | ) | `[virtual]`

Definition at line 154 of file OgreSharedPtr.h.

## Member Function Documentation

template<class T>

void Ogre::SharedPtr< T >::bind | ( | T * | rep,
|  | SharedPtrFreeMethod | inFreeMethod = `SPFM_DELETE`
| ) |  |

Binds rep to the SharedPtr.

Remarks:
  Assumes that the SharedPtr is uninitialised!

Definition at line 167 of file OgreSharedPtr.h.

template<class T>

virtual void Ogre::SharedPtr< T >::destroy | ( | void |  | ) | `[protected, virtual]`

Reimplemented in Ogre::MeshPtr.

Definition at line 223 of file OgreSharedPtr.h.

Referenced by Ogre::SharedPtr< D3D11GpuProgram >::release().

template<class T>

SharedPtrFreeMethod Ogre::SharedPtr< T >::freeMethod | ( |  | ) | const

Definition at line 181 of file OgreSharedPtr.h.

Referenced by Ogre::SharedPtr< D3D11GpuProgram >::SharedPtr().

template<class T>

T* Ogre::SharedPtr< T >::get | ( | void |  | ) | const

Definition at line 161 of file OgreSharedPtr.h.

Referenced by Ogre::operator!=(), and Ogre::operator==().

template<class T>

T* Ogre::SharedPtr< T >::getPointer | ( |  | ) | const

Definition at line 180 of file OgreSharedPtr.h.

Referenced by Ogre::CompositorPtr::CompositorPtr(), Ogre::D3D11GpuProgramPtr::D3D11GpuProgramPtr(), Ogre::D3D11TexturePtr::D3D11TexturePtr(), Ogre::D3D9GpuProgramPtr::D3D9GpuProgramPtr(), Ogre::D3D9TexturePtr::D3D9TexturePtr(), Ogre::FontPtr::FontPtr(), Ogre::GLES2TexturePtr::GLES2TexturePtr(), Ogre::GLESTexturePtr::GLESTexturePtr(), Ogre::GLTexturePtr::GLTexturePtr(), Ogre::GpuProgramPtr::GpuProgramPtr(), Ogre::HighLevelGpuProgramPtr::HighLevelGpuProgramPtr(), Ogre::MaterialPtr::MaterialPtr(), Ogre::PatchMeshPtr::operator=(), Ogre::D3D11GpuProgramPtr::operator=(), Ogre::GLESTexturePtr::operator=(), Ogre::GLES2TexturePtr::operator=(), Ogre::GLTexturePtr::operator=(), Ogre::SharedPtr< D3D11GpuProgram >::operator=(), Ogre::HighLevelGpuProgramPtr::operator=(), Ogre::D3D9GpuProgramPtr::operator=(), Ogre::D3D11TexturePtr::operator=(), Ogre::CompositorPtr::operator=(), Ogre::D3D9TexturePtr::operator=(), Ogre::FontPtr::operator=(), Ogre::GpuProgramPtr::operator=(), Ogre::TexturePtr::operator=(), Ogre::SkeletonPtr::operator=(), Ogre::MaterialPtr::operator=(), Ogre::PatchMeshPtr::PatchMeshPtr(), Ogre::SharedPtr< D3D11GpuProgram >::SharedPtr(), Ogre::SkeletonPtr::SkeletonPtr(), and Ogre::TexturePtr::TexturePtr().

template<class T>

bool Ogre::SharedPtr< T >::isNull | ( | void |  | ) | const

Definition at line 183 of file OgreSharedPtr.h.

Referenced by Ogre::PatchMeshPtr::operator=(), Ogre::GLES2TexturePtr::operator=(), Ogre::GLESTexturePtr::operator=(), Ogre::GLTexturePtr::operator=(), Ogre::HighLevelGpuProgramPtr::operator=(), Ogre::CompositorPtr::operator=(), Ogre::D3D9TexturePtr::operator=(), Ogre::FontPtr::operator=(), Ogre::GpuProgramPtr::operator=(), Ogre::TexturePtr::operator=(), Ogre::SkeletonPtr::operator=(), and Ogre::MaterialPtr::operator=().

template<class T>

T& Ogre::SharedPtr< T >::operator* | ( |  | ) | const

Definition at line 159 of file OgreSharedPtr.h.

template<class T>

T* Ogre::SharedPtr< T >::operator-> | ( |  | ) | const

Definition at line 160 of file OgreSharedPtr.h.

template<class T>

SharedPtr& Ogre::SharedPtr< T >::operator= | ( | const SharedPtr< T > & | r | ) |

Definition at line 113 of file OgreSharedPtr.h.

template<class T>
template<class Y >

SharedPtr& Ogre::SharedPtr< T >::operator= | ( | const SharedPtr< Y > & | r | ) |

Definition at line 145 of file OgreSharedPtr.h.

template<class T>

void Ogre::SharedPtr< T >::release | ( | void |  | ) | `[protected]`

Definition at line 197 of file OgreSharedPtr.h.

Referenced by Ogre::SharedPtr< D3D11GpuProgram >::setNull(), and Ogre::SharedPtr< D3D11GpuProgram >::~SharedPtr().

template<class T>

void Ogre::SharedPtr< T >::setNull | ( | void |  | ) |

Definition at line 185 of file OgreSharedPtr.h.

template<class T>

virtual void Ogre::SharedPtr< T >::swap | ( | SharedPtr< T > & | other | ) | `[protected, virtual]`

Definition at line 247 of file OgreSharedPtr.h.

Referenced by Ogre::SharedPtr< D3D11GpuProgram >::operator=(), and Ogre::SharedPtr< D3D11GpuProgram >::swap().

template<class T>

bool Ogre::SharedPtr< T >::unique | ( |  | ) | const

Definition at line 176 of file OgreSharedPtr.h.

template<class T>

unsigned int Ogre::SharedPtr< T >::useCount | ( |  | ) | const

Definition at line 177 of file OgreSharedPtr.h.

template<class T>

unsigned int* Ogre::SharedPtr< T >::useCountPointer | ( |  | ) | const

Definition at line 178 of file OgreSharedPtr.h.

Referenced by Ogre::CompositorPtr::CompositorPtr(), Ogre::D3D11GpuProgramPtr::D3D11GpuProgramPtr(), Ogre::D3D11TexturePtr::D3D11TexturePtr(), Ogre::D3D9GpuProgramPtr::D3D9GpuProgramPtr(), Ogre::D3D9TexturePtr::D3D9TexturePtr(), Ogre::FontPtr::FontPtr(), Ogre::GLES2TexturePtr::GLES2TexturePtr(), Ogre::GLESTexturePtr::GLESTexturePtr(), Ogre::GLTexturePtr::GLTexturePtr(), Ogre::GpuProgramPtr::GpuProgramPtr(), Ogre::HighLevelGpuProgramPtr::HighLevelGpuProgramPtr(), Ogre::MaterialPtr::MaterialPtr(), Ogre::PatchMeshPtr::operator=(), Ogre::D3D11GpuProgramPtr::operator=(), Ogre::GLESTexturePtr::operator=(), Ogre::GLES2TexturePtr::operator=(), Ogre::GLTexturePtr::operator=(), Ogre::HighLevelGpuProgramPtr::operator=(), Ogre::D3D9GpuProgramPtr::operator=(), Ogre::D3D11TexturePtr::operator=(), Ogre::CompositorPtr::operator=(), Ogre::D3D9TexturePtr::operator=(), Ogre::FontPtr::operator=(), Ogre::GpuProgramPtr::operator=(), Ogre::TexturePtr::operator=(), Ogre::SkeletonPtr::operator=(), Ogre::MaterialPtr::operator=(), Ogre::PatchMeshPtr::PatchMeshPtr(), Ogre::SharedPtr< D3D11GpuProgram >::SharedPtr(), Ogre::SkeletonPtr::SkeletonPtr(), and Ogre::TexturePtr::TexturePtr().

## Member Data Documentation

template<class T>

T* Ogre::SharedPtr< T >::pRep `[protected]`

Definition at line 63 of file OgreSharedPtr.h.

Referenced by Ogre::SharedPtr< D3D11GpuProgram >::bind(), Ogre::SharedPtr< D3D11GpuProgram >::destroy(), Ogre::SharedPtr< D3D11GpuProgram >::get(), Ogre::SharedPtr< D3D11GpuProgram >::getPointer(), Ogre::SharedPtr< D3D11GpuProgram >::isNull(), Ogre::SharedPtr< D3D11GpuProgram >::operator*(), Ogre::SharedPtr< D3D11GpuProgram >::operator->(), Ogre::SharedPtr< D3D11GpuProgram >::operator=(), Ogre::SharedPtr< D3D11GpuProgram >::setNull(), Ogre::SharedPtr< D3D11GpuProgram >::SharedPtr(), and Ogre::SharedPtr< D3D11GpuProgram >::swap().

template<class T>

unsigned int* Ogre::SharedPtr< T >::pUseCount `[protected]`

Definition at line 64 of file OgreSharedPtr.h.

Referenced by Ogre::SharedPtr< D3D11GpuProgram >::bind(), Ogre::SharedPtr< D3D11GpuProgram >::destroy(), Ogre::SharedPtr< D3D11GpuProgram >::release(), Ogre::SharedPtr< D3D11GpuProgram >::setNull(), Ogre::SharedPtr< D3D11GpuProgram >::SharedPtr(), Ogre::SharedPtr< D3D11GpuProgram >::swap(), Ogre::SharedPtr< D3D11GpuProgram >::unique(), Ogre::SharedPtr< D3D11GpuProgram >::useCount(), and Ogre::SharedPtr< D3D11GpuProgram >::useCountPointer().

template<class T>

SharedPtrFreeMethod Ogre::SharedPtr< T >::useFreeMethod `[protected]`

Definition at line 65 of file OgreSharedPtr.h.

Referenced by Ogre::SharedPtr< D3D11GpuProgram >::bind(), Ogre::SharedPtr< D3D11GpuProgram >::destroy(), Ogre::SharedPtr< D3D11GpuProgram >::freeMethod(), Ogre::SharedPtr< D3D11GpuProgram >::SharedPtr(), and Ogre::SharedPtr< D3D11GpuProgram >::swap().

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

- OgreSharedPtr.h

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Sun Sep 2 2012 07:27:39