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) const |
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 () const |
Lock the renderbuffer. | |
T & | operator * () const |
Get current element. | |
operator T * () const | |
Retrieve a pointer to the contained data. | |
PointerProxy | operator++ (int) |
Set current element to the next, post-increment version. | |
PointerProxy | operator++ () |
Set current element to the next, pre-increment version. | |
PointerProxy | operator+= (int n) |
Add a value to the current element index. | |
T & | operator[] (size_t n) const |
Retrieve an item in the render buffer. | |
~csRenderBufferLock () | |
Destruct the helper. |
Detailed Description
template<class T, class TbufferKeeper = iRenderBuffer*>
class csRenderBufferLock< T, TbufferKeeper >
Helper class for convenient locking/unlocking of an iRenderBuffer.
The buffer is locked upon construction of the csRenderBufferLock<> object and unlocked on destruction.
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 csRef<iRenderBuffer> (instead a iRenderBuffer*) in case there is a risk that the buffer gets destroyed while thelock exists.
Definition at line 44 of file rbuflock.h.
Constructor & Destructor Documentation
csRenderBufferLock< T, TbufferKeeper >::csRenderBufferLock | ( | iRenderBuffer * | buf, | |
csRenderBufferLockType | lock = CS_BUF_LOCK_NORMAL | |||
) | [inline] |
csRenderBufferLock< T, TbufferKeeper >::~csRenderBufferLock | ( | ) | [inline] |
Member Function Documentation
T& csRenderBufferLock< T, TbufferKeeper >::Get | ( | size_t | n | ) | const [inline] |
Retrieve an item in the render buffer.
Definition at line 190 of file rbuflock.h.
Referenced by csRenderBufferLock< unsigned char >::operator *(), and csRenderBufferLock< unsigned char >::operator[]().
size_t csRenderBufferLock< T, TbufferKeeper >::GetSize | ( | ) | const [inline] |
bool csRenderBufferLock< T, TbufferKeeper >::IsValid | ( | ) | const [inline] |
T* csRenderBufferLock< T, TbufferKeeper >::Lock | ( | ) | const [inline] |
Lock the renderbuffer.
Returns a pointer to the contained data.
- Remarks:
- Watch the stride of the buffer.
Definition at line 141 of file rbuflock.h.
Referenced by csRenderBufferLock< unsigned char >::Get(), and csRenderBufferLock< unsigned char >::operator unsigned char *().
T& csRenderBufferLock< T, TbufferKeeper >::operator * | ( | ) | const [inline] |
csRenderBufferLock< T, TbufferKeeper >::operator T * | ( | ) | const [inline] |
Retrieve a pointer to the contained data.
- Remarks:
- Watch the stride of the buffer.
Definition at line 150 of file rbuflock.h.
PointerProxy csRenderBufferLock< T, TbufferKeeper >::operator++ | ( | int | ) | [inline] |
PointerProxy csRenderBufferLock< T, TbufferKeeper >::operator++ | ( | ) | [inline] |
PointerProxy csRenderBufferLock< T, TbufferKeeper >::operator+= | ( | int | n | ) | [inline] |
T& csRenderBufferLock< T, TbufferKeeper >::operator[] | ( | size_t | n | ) | const [inline] |
The documentation for this class was generated from the following file:
- cstool/rbuflock.h
Generated for Crystal Space by doxygen 1.4.7