csRenderBufferLock< T, TbufferKeeper > Class Template Reference
Helper class for convenient locking/unlocking of an iRenderBuffer. More...
#include <cstool/rbuflock.h>
Public Member Functions | |
| csRenderBufferLock (iRenderBuffer *buf, csRenderBufferLockType lock=CS_BUF_LOCK_NORMAL) | |
| Construct the helper. | |
| T & | Get (size_t n) |
| Retrieve an item in the render buffer. | |
| size_t | GetSize () const |
| Retrieve number of items in buffer. | |
| bool | IsValid () const |
| Returns whether the buffer is valid (ie not null). | |
| T * | Lock () |
| Lock the renderbuffer. | |
| T & | operator * () |
| Get current element. | |
| operator T * () | |
| Retrieve a pointer to the contained data. | |
| void | operator++ () |
| Set current element to the next. | |
| T & | operator[] (size_t n) |
| Retrieve an item in the render buffer. | |
| void | Unlock () |
| Unlock the renderbuffer. | |
| ~csRenderBufferLock () | |
| Destruct the helper. | |
Detailed Description
template<class T, class TbufferKeeper = csRef<iRenderBuffer>>
class csRenderBufferLock< T, TbufferKeeper >
Helper class for convenient locking/unlocking of an iRenderBuffer.
The contents can be accessed either directly, array-style or iterator-style in a typed way.
- Remarks:
- The TbufferKeeper template argument can be used to have the lock store the buffer in a simple iRenderBuffer* (instead a csRef<>) to avoid an IncRef() and DecRef() if it is known that the buffer will not be destroyed as long as the lock exists.
Definition at line 40 of file rbuflock.h.
Constructor & Destructor Documentation
|
||||||||||||||||
|
Construct the helper.
Definition at line 71 of file rbuflock.h. References iRenderBuffer::GetElementCount(). |
|
|||||||||
|
Destruct the helper. Automatically unlocks the buffer if it was locked. Definition at line 85 of file rbuflock.h. References csRenderBufferLock< T, TbufferKeeper >::Unlock(). |
Member Function Documentation
|
||||||||||
|
Retrieve an item in the render buffer.
Definition at line 145 of file rbuflock.h. References CS_ASSERT, and csRenderBufferLock< T, TbufferKeeper >::Lock(). Referenced by csRenderBufferLock< T, TbufferKeeper >::operator *(), and csRenderBufferLock< T, TbufferKeeper >::operator[](). |
|
|||||||||
|
Retrieve number of items in buffer.
Definition at line 152 of file rbuflock.h. |
|
|||||||||
|
Returns whether the buffer is valid (ie not null).
Definition at line 158 of file rbuflock.h. |
|
|||||||||
|
Lock the renderbuffer. Returns a pointer to the contained data.
Definition at line 94 of file rbuflock.h. References CS_ASSERT. Referenced by csRenderBufferLock< T, TbufferKeeper >::Get(), and csRenderBufferLock< T, TbufferKeeper >::operator T *(). |
|
|||||||||
|
Get current element.
Definition at line 126 of file rbuflock.h. References csRenderBufferLock< T, TbufferKeeper >::Get(). |
|
|||||||||
|
Retrieve a pointer to the contained data.
Definition at line 120 of file rbuflock.h. References csRenderBufferLock< T, TbufferKeeper >::Lock(). |
|
|||||||||
|
Set current element to the next.
Definition at line 132 of file rbuflock.h. References CS_ASSERT. |
|
||||||||||
|
Retrieve an item in the render buffer.
Definition at line 139 of file rbuflock.h. References csRenderBufferLock< T, TbufferKeeper >::Get(). |
|
|||||||||
|
Unlock the renderbuffer.
Definition at line 107 of file rbuflock.h. Referenced by csRenderBufferLock< T, TbufferKeeper >::~csRenderBufferLock(). |
The documentation for this class was generated from the following file:
- cstool/rbuflock.h
Generated for Crystal Space by doxygen 1.4.6
