|
Visualization Library 2.1.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
Implements a buffer whose storage is in local memory. More...
#include <Buffer.hpp>
Inheritance diagram for vl::Buffer:Public Types | |
| enum | EAllocationMode { UserAllocatedBuffer, AutoAllocatedBuffer } |
Public Member Functions | |
| Buffer () | |
| Buffer (const Buffer &other) | |
| Buffer & | operator= (const Buffer &other) |
| void | swap (Buffer &other) |
| ~Buffer () | |
| void | clear () |
| void | resize (size_t byte_count, size_t alignment=0) |
| void | setUserAllocatedBuffer (void *ptr, size_t bytes) |
| Uses a user-allocated buffer as storage. More... | |
| void | setAllocationMode (EAllocationMode mode) |
| EAllocationMode | allocationMode () const |
| size_t | bytesUsed () const |
| bool | empty () const |
| unsigned char * | ptr () |
| const unsigned char * | ptr () const |
| size_t | alignment () const |
Public Member Functions inherited from vl::Object | |
| Object () | |
| Constructor. More... | |
| Object (const Object &other) | |
| Copy constructor: copies the name, ref count mutex and user data. More... | |
| Object & | operator= (const Object &other) |
| Copy operator: copies the object's name, ref count mutex and user data. More... | |
| const std::string & | objectName () const |
| The name of the object, by default set to the object's class name. More... | |
| void | setObjectName (const char *name) |
| The name of the object, by default set to the object's class name in debug builds. More... | |
| void | setObjectName (const std::string &name) |
| The name of the object, by default set to the object's class name in debug builds. More... | |
| void | setRefCountMutex (IMutex *mutex) |
| The mutex used to protect the reference counting of an Object across multiple threads. More... | |
| IMutex * | refCountMutex () |
| The mutex used to protect the reference counting of an Object across multiple threads. More... | |
| const IMutex * | refCountMutex () const |
| The mutex used to protect the reference counting of an Object across multiple threads. More... | |
| int | referenceCount () const |
| Returns the number of references of an object. More... | |
| void | incReference () const |
| Increments the reference count of an object. More... | |
| void | decReference () |
Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More... | |
| void | setAutomaticDelete (bool autodel_on) |
| If set to true the Object is deleted when its reference count reaches 0. More... | |
| bool | automaticDelete () const |
| If set to true the Object is deleted when its reference count reaches 0. More... | |
| template<class T > | |
| T * | as () |
| Casts an Object to the specified class. More... | |
| template<class T > | |
| const T * | as () const |
| Casts an Object to the specified class. More... | |
Static Public Member Functions | |
| static void * | alignedMalloc (size_t bytes, size_t alignment) |
| static void | alignedFree (void *ptr) |
Protected Attributes | |
| unsigned char * | mPtr |
| size_t | mByteCount |
| size_t | mAlignment |
| EAllocationMode | mAllocationMode |
Protected Attributes inherited from vl::Object | |
| std::string | mObjectName |
| IMutex * | mRefCountMutex |
| int | mReferenceCount |
| bool | mAutomaticDelete |
Additional Inherited Members | |
Protected Member Functions inherited from vl::Object | |
| virtual | ~Object () |
Implements a buffer whose storage is in local memory.
Definition at line 46 of file Buffer.hpp.
| Enumerator | |
|---|---|
| UserAllocatedBuffer | |
| AutoAllocatedBuffer | |
Definition at line 51 of file Buffer.hpp.
|
inline |
Definition at line 58 of file Buffer.hpp.
References AutoAllocatedBuffer, mAlignment, mAllocationMode, mByteCount, mPtr, and NULL.
|
inline |
Definition at line 66 of file Buffer.hpp.
References AutoAllocatedBuffer, mAlignment, mAllocationMode, mByteCount, mPtr, and NULL.
|
inline |
Definition at line 114 of file Buffer.hpp.
References clear().
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
Definition at line 195 of file Buffer.hpp.
References mAllocationMode.
|
inline |
Definition at line 197 of file Buffer.hpp.
References mByteCount.
Referenced by vl::ArrayAbstract::bytesUsed(), vl::SlicedVolume::onActorRenderStarted(), operator=(), vl::ArrayAbstract::operator=(), and vl::BufferObject::setBufferData().
|
inline |
Definition at line 119 of file Buffer.hpp.
References alignedFree(), AutoAllocatedBuffer, mAllocationMode, mByteCount, mPtr, and NULL.
Referenced by vl::ArrayAbstract::clear(), vl::DrawPixels::Pixels::generatePixelBufferObject(), resize(), setAllocationMode(), vl::BufferObject::setBufferData(), vl::BufferObject::setBufferSubData(), setUserAllocatedBuffer(), and ~Buffer().
|
inline |
Definition at line 199 of file Buffer.hpp.
References mByteCount.
Definition at line 76 of file Buffer.hpp.
References AutoAllocatedBuffer, bytesUsed(), mAlignment, mAllocationMode, mByteCount, mPtr, ptr(), resize(), and VL_CHECK.
|
inline |
Definition at line 201 of file Buffer.hpp.
References mPtr.
Referenced by vl::OpenGLContext::bindVAS_Attribs(), vl::OpenGLContext::bindVAS_Fixed(), vl::BufferObject::downloadBufferObject(), vl::BufferObject::mapBufferObject(), operator=(), vl::ArrayAbstract::ptr(), resize(), vl::BufferObject::setBufferData(), and vl::BufferObject::setBufferSubData().
|
inline |
Definition at line 203 of file Buffer.hpp.
References mPtr.
|
inline |
Definition at line 130 of file Buffer.hpp.
References alignedFree(), alignedMalloc(), alignment(), AutoAllocatedBuffer, clear(), mAlignment, mAllocationMode, mByteCount, vl::min(), mPtr, NULL, ptr(), and VL_CHECK.
Referenced by vl::BufferObject::downloadBufferObject(), operator=(), vl::ArrayAbstract::operator=(), and vl::Array< bvec2, GLbyte, 2, GL_BYTE >::resize().
|
inline |
Definition at line 182 of file Buffer.hpp.
References clear(), mAlignment, mAllocationMode, mByteCount, and mPtr.
|
inline |
Uses a user-allocated buffer as storage.
After calling this function any call to resize() is illegal. Calling this function enables the UserAllocatedBuffer mode. Call setAllocationMode( AutoAllocatedBuffer ) to revert to the default behaviour.
Definition at line 173 of file Buffer.hpp.
References clear(), mAlignment, mAllocationMode, mByteCount, mPtr, and UserAllocatedBuffer.
|
inline |
Definition at line 98 of file Buffer.hpp.
References mAlignment, mByteCount, and mPtr.
Referenced by vl::BufferObject::swap().
|
protected |
Definition at line 267 of file Buffer.hpp.
Referenced by alignment(), Buffer(), operator=(), resize(), setAllocationMode(), setUserAllocatedBuffer(), and swap().
|
protected |
Definition at line 268 of file Buffer.hpp.
Referenced by allocationMode(), Buffer(), clear(), operator=(), resize(), setAllocationMode(), and setUserAllocatedBuffer().
|
protected |
Definition at line 266 of file Buffer.hpp.
Referenced by Buffer(), bytesUsed(), clear(), empty(), operator=(), resize(), setAllocationMode(), setUserAllocatedBuffer(), and swap().
|
protected |
Definition at line 265 of file Buffer.hpp.
Referenced by Buffer(), clear(), operator=(), ptr(), resize(), setAllocationMode(), setUserAllocatedBuffer(), and swap().
Visualization Library 2.1.0 Reference Documentation
Updated on Wed Mar 10 2021 16:02:48.
© Copyright Michele Bosi. All rights reserved.