Ogre::DefaultHardwareBufferManager Class Reference
[RenderSystem]

DefaultHardwareBufferManager as a Singleton. More...

#include <OgreDefaultHardwareBufferManager.h>

Inheritance diagram for Ogre::DefaultHardwareBufferManager:
Inheritance graph
[legend]

List of all members.

Public Types

enum  BufferLicenseType { BLT_MANUAL_RELEASE, BLT_AUTOMATIC_RELEASE }

Public Member Functions

 DefaultHardwareBufferManager ()
 ~DefaultHardwareBufferManager ()
HardwareVertexBufferSharedPtr createVertexBuffer (size_t vertexSize, size_t numVerts, HardwareBuffer::Usage usage, bool useShadowBuffer=false)
HardwareIndexBufferSharedPtr createIndexBuffer (HardwareIndexBuffer::IndexType itype, size_t numIndexes, HardwareBuffer::Usage usage, bool useShadowBuffer=false)
RenderToVertexBufferSharedPtr createRenderToVertexBuffer ()
virtual VertexDeclarationcreateVertexDeclaration (void)
virtual void destroyVertexDeclaration (VertexDeclaration *decl)
virtual VertexBufferBindingcreateVertexBufferBinding (void)
virtual void destroyVertexBufferBinding (VertexBufferBinding *binding)
virtual void registerVertexBufferSourceAndCopy (const HardwareVertexBufferSharedPtr &sourceBuffer, const HardwareVertexBufferSharedPtr &copy)
virtual
HardwareVertexBufferSharedPtr 
allocateVertexBufferCopy (const HardwareVertexBufferSharedPtr &sourceBuffer, BufferLicenseType licenseType, HardwareBufferLicensee *licensee, bool copyData=false)
virtual void releaseVertexBufferCopy (const HardwareVertexBufferSharedPtr &bufferCopy)
virtual void touchVertexBufferCopy (const HardwareVertexBufferSharedPtr &bufferCopy)
virtual void _freeUnusedBufferCopies (void)
virtual void _releaseBufferCopies (bool forceFreeUnused=false)
virtual void _forceReleaseBufferCopies (const HardwareVertexBufferSharedPtr &sourceBuffer)
virtual void _forceReleaseBufferCopies (HardwareVertexBuffer *sourceBuffer)
void _notifyVertexBufferDestroyed (HardwareVertexBuffer *buf)
void _notifyIndexBufferDestroyed (HardwareIndexBuffer *buf)
void * operator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info
void * operator new (size_t sz)
void * operator new (size_t sz, void *ptr)
 placement operator new
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info
void * operator new[] (size_t sz)
void operator delete (void *ptr)
void operator delete (void *ptr, void *)
void operator delete (void *ptr, const char *, int, const char *)
void operator delete[] (void *ptr)
void operator delete[] (void *ptr, const char *, int, const char *)

Static Public Member Functions

static HardwareBufferManagergetSingleton (void)
 Override standard Singleton retrieval.
static HardwareBufferManagergetSingletonPtr (void)
 Override standard Singleton retrieval.

Protected Types

typedef set
< HardwareVertexBuffer * >
::type 
VertexBufferList
 WARNING: The following two members should place before all other members.
typedef set
< HardwareIndexBuffer * >
::type 
IndexBufferList
typedef set< VertexDeclaration * >
::type 
VertexDeclarationList
typedef set
< VertexBufferBinding * >
::type 
VertexBufferBindingList
typedef multimap
< HardwareVertexBuffer
*, HardwareVertexBufferSharedPtr >
::type 
FreeTemporaryVertexBufferMap
 Map from original buffer to temporary buffers.
typedef map
< HardwareVertexBuffer
*, VertexBufferLicense >::type 
TemporaryVertexBufferLicenseMap
 Map from temporary buffer to details of a license.

Protected Member Functions

virtual void destroyAllDeclarations (void)
 Internal method for destroys all vertex declarations.
virtual void destroyAllBindings (void)
 Internal method for destroys all vertex buffer bindings.
virtual VertexDeclarationcreateVertexDeclarationImpl (void)
 Internal method for creates a new vertex declaration, may be overridden by certain rendering APIs.
virtual void destroyVertexDeclarationImpl (VertexDeclaration *decl)
 Internal method for destroys a vertex declaration, may be overridden by certain rendering APIs.
virtual VertexBufferBindingcreateVertexBufferBindingImpl (void)
 Internal method for creates a new VertexBufferBinding, may be overridden by certain rendering APIs.
virtual void destroyVertexBufferBindingImpl (VertexBufferBinding *binding)
 Internal method for destroys a VertexBufferBinding, may be overridden by certain rendering APIs.
virtual
HardwareVertexBufferSharedPtr 
makeBufferCopy (const HardwareVertexBufferSharedPtr &source, HardwareBuffer::Usage usage, bool useShadowBuffer)
 Creates a new buffer as a copy of the source, does not copy data.

Protected Attributes

HardwareBufferManagerBasemImpl
VertexBufferList mVertexBuffers
IndexBufferList mIndexBuffers
VertexDeclarationList mVertexDeclarations
VertexBufferBindingList mVertexBufferBindings
FreeTemporaryVertexBufferMap mFreeTempVertexBufferMap
 Map of current available temp buffers.
TemporaryVertexBufferLicenseMap mTempVertexBufferLicenses
 Map of currently licensed temporary buffers.
size_t mUnderUsedFrameCount
 Number of frames elapsed since temporary buffers utilization was above half the available.

Static Protected Attributes

static const size_t UNDER_USED_FRAME_THRESHOLD
 Number of frames to wait before free unused temporary buffers.
static const size_t EXPIRED_DELAY_FRAME_THRESHOLD
 Frame delay for BLT_AUTOMATIC_RELEASE temporary buffers.
static HardwareBufferManagermsSingleton

Detailed Description

DefaultHardwareBufferManager as a Singleton.

Definition at line 121 of file OgreDefaultHardwareBufferManager.h.


Member Typedef Documentation

Map from original buffer to temporary buffers.

Definition at line 187 of file OgreHardwareBufferManager.h.

Definition at line 120 of file OgreHardwareBufferManager.h.

Map from temporary buffer to details of a license.

Definition at line 191 of file OgreHardwareBufferManager.h.

Definition at line 126 of file OgreHardwareBufferManager.h.

WARNING: The following two members should place before all other members.

Members destruct order is very important here, because destructing other members will cause notify back to this class, and then will access to this two members.

Definition at line 119 of file OgreHardwareBufferManager.h.

Definition at line 125 of file OgreHardwareBufferManager.h.


Member Enumeration Documentation

Enumerator:
BLT_MANUAL_RELEASE 

Licensee will only release buffer when it says so.

BLT_AUTOMATIC_RELEASE 

Licensee can have license revoked.

Definition at line 153 of file OgreHardwareBufferManager.h.


Constructor & Destructor Documentation

Ogre::DefaultHardwareBufferManager::DefaultHardwareBufferManager (  ) 

Definition at line 124 of file OgreDefaultHardwareBufferManager.h.

Ogre::DefaultHardwareBufferManager::~DefaultHardwareBufferManager (  ) 

Definition at line 129 of file OgreDefaultHardwareBufferManager.h.

References OGRE_DELETE.


Member Function Documentation

virtual void Ogre::HardwareBufferManager::_forceReleaseBufferCopies ( HardwareVertexBuffer sourceBuffer  )  [virtual, inherited]
virtual void Ogre::HardwareBufferManager::_forceReleaseBufferCopies ( const HardwareVertexBufferSharedPtr sourceBuffer  )  [virtual, inherited]
virtual void Ogre::HardwareBufferManager::_freeUnusedBufferCopies ( void   )  [virtual, inherited]
void Ogre::HardwareBufferManager::_notifyIndexBufferDestroyed ( HardwareIndexBuffer buf  )  [inherited]
void Ogre::HardwareBufferManager::_notifyVertexBufferDestroyed ( HardwareVertexBuffer buf  )  [inherited]
virtual void Ogre::HardwareBufferManager::_releaseBufferCopies ( bool  forceFreeUnused = false  )  [virtual, inherited]
virtual HardwareVertexBufferSharedPtr Ogre::HardwareBufferManager::allocateVertexBufferCopy ( const HardwareVertexBufferSharedPtr sourceBuffer,
BufferLicenseType  licenseType,
HardwareBufferLicensee licensee,
bool  copyData = false 
) [virtual, inherited]
HardwareIndexBufferSharedPtr Ogre::HardwareBufferManager::createIndexBuffer ( HardwareIndexBuffer::IndexType  itype,
size_t  numIndexes,
HardwareBuffer::Usage  usage,
bool  useShadowBuffer = false 
) [virtual, inherited]
RenderToVertexBufferSharedPtr Ogre::HardwareBufferManager::createRenderToVertexBuffer (  )  [virtual, inherited]
HardwareVertexBufferSharedPtr Ogre::HardwareBufferManager::createVertexBuffer ( size_t  vertexSize,
size_t  numVerts,
HardwareBuffer::Usage  usage,
bool  useShadowBuffer = false 
) [virtual, inherited]
virtual VertexBufferBinding* Ogre::HardwareBufferManager::createVertexBufferBinding ( void   )  [virtual, inherited]
virtual VertexBufferBinding* Ogre::HardwareBufferManagerBase::createVertexBufferBindingImpl ( void   )  [protected, virtual, inherited]

Internal method for creates a new VertexBufferBinding, may be overridden by certain rendering APIs.

virtual VertexDeclaration* Ogre::HardwareBufferManager::createVertexDeclaration ( void   )  [virtual, inherited]
virtual VertexDeclaration* Ogre::HardwareBufferManagerBase::createVertexDeclarationImpl ( void   )  [protected, virtual, inherited]

Internal method for creates a new vertex declaration, may be overridden by certain rendering APIs.

virtual void Ogre::HardwareBufferManagerBase::destroyAllBindings ( void   )  [protected, virtual, inherited]

Internal method for destroys all vertex buffer bindings.

virtual void Ogre::HardwareBufferManagerBase::destroyAllDeclarations ( void   )  [protected, virtual, inherited]

Internal method for destroys all vertex declarations.

virtual void Ogre::HardwareBufferManager::destroyVertexBufferBinding ( VertexBufferBinding binding  )  [virtual, inherited]
virtual void Ogre::HardwareBufferManagerBase::destroyVertexBufferBindingImpl ( VertexBufferBinding binding  )  [protected, virtual, inherited]

Internal method for destroys a VertexBufferBinding, may be overridden by certain rendering APIs.

virtual void Ogre::HardwareBufferManager::destroyVertexDeclaration ( VertexDeclaration decl  )  [virtual, inherited]
virtual void Ogre::HardwareBufferManagerBase::destroyVertexDeclarationImpl ( VertexDeclaration decl  )  [protected, virtual, inherited]

Internal method for destroys a vertex declaration, may be overridden by certain rendering APIs.

static HardwareBufferManager& Ogre::HardwareBufferManager::getSingleton ( void   )  [static, inherited]

Override standard Singleton retrieval.

Remarks:
Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.
This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.

Reimplemented from Ogre::Singleton< HardwareBufferManager >.

static HardwareBufferManager* Ogre::HardwareBufferManager::getSingletonPtr ( void   )  [static, inherited]

Override standard Singleton retrieval.

Remarks:
Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.
This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.

Reimplemented from Ogre::Singleton< HardwareBufferManager >.

virtual HardwareVertexBufferSharedPtr Ogre::HardwareBufferManagerBase::makeBufferCopy ( const HardwareVertexBufferSharedPtr source,
HardwareBuffer::Usage  usage,
bool  useShadowBuffer 
) [protected, virtual, inherited]

Creates a new buffer as a copy of the source, does not copy data.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
const char *  ,
int  ,
const char *   
) [inherited]

Definition at line 107 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
void *   
) [inherited]

Definition at line 101 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr  )  [inherited]

Definition at line 95 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr,
const char *  ,
int  ,
const char *   
) [inherited]

Definition at line 118 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr  )  [inherited]

Definition at line 112 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
void *  ptr 
) [inherited]

placement operator new

Definition at line 78 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz  )  [inherited]

Definition at line 72 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
const char *  file,
int  line,
const char *  func 
) [inherited]

operator new, with debug line info

Definition at line 67 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz  )  [inherited]

Definition at line 90 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz,
const char *  file,
int  line,
const char *  func 
) [inherited]

array operator new, with debug line info

Definition at line 85 of file OgreMemoryAllocatedObject.h.

virtual void Ogre::HardwareBufferManager::registerVertexBufferSourceAndCopy ( const HardwareVertexBufferSharedPtr sourceBuffer,
const HardwareVertexBufferSharedPtr copy 
) [virtual, inherited]
virtual void Ogre::HardwareBufferManager::releaseVertexBufferCopy ( const HardwareVertexBufferSharedPtr bufferCopy  )  [virtual, inherited]
virtual void Ogre::HardwareBufferManager::touchVertexBufferCopy ( const HardwareVertexBufferSharedPtr bufferCopy  )  [virtual, inherited]

Member Data Documentation

const size_t Ogre::HardwareBufferManagerBase::EXPIRED_DELAY_FRAME_THRESHOLD [static, protected, inherited]

Frame delay for BLT_AUTOMATIC_RELEASE temporary buffers.

Definition at line 199 of file OgreHardwareBufferManager.h.

Map of current available temp buffers.

Definition at line 189 of file OgreHardwareBufferManager.h.

Definition at line 389 of file OgreHardwareBufferManager.h.

Definition at line 122 of file OgreHardwareBufferManager.h.

Definition at line 75 of file OgreSingleton.h.

Map of currently licensed temporary buffers.

Definition at line 193 of file OgreHardwareBufferManager.h.

Number of frames elapsed since temporary buffers utilization was above half the available.

Definition at line 195 of file OgreHardwareBufferManager.h.

Definition at line 128 of file OgreHardwareBufferManager.h.

Definition at line 121 of file OgreHardwareBufferManager.h.

Definition at line 127 of file OgreHardwareBufferManager.h.

const size_t Ogre::HardwareBufferManagerBase::UNDER_USED_FRAME_THRESHOLD [static, protected, inherited]

Number of frames to wait before free unused temporary buffers.

Definition at line 197 of file OgreHardwareBufferManager.h.


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

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Fri May 25 23:37:20 2012