Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

# Keos::CBuffer< T > Class Template Reference

Wrapper manipulating the buffers (VB/IB/...). More...

`#include <KeosBuffer.h>`

List of all members.

## Public Member Functions

| CBuffer (IBufferBase *pBuffer=NULL)
| Default constructor.
T * | Lock (ulong nOffset=0, ulong nSize=0, ulong nFlags=0)
| Lock the buffer.
void | Unlock ()
| Unlock the buffer.
void | Fill (const T *pData, size_t nCount)
| Fill the buffer.
void | Release ()
| Destroy the buffer.
const IBufferBase * | GetBuffer () const
| Return pointer on the buffer.
ulong | GetCount () const
| Return the number of elements in the buffer.

## Private Attributes

CSmartPtr< IBufferBase > | m_Buffer
| Intern buffer.

## Detailed Description

### template<class T>
class Keos::CBuffer< T >

Wrapper manipulating the buffers (VB/IB/...).

Definition at line 34 of file KeosBuffer.h.

## Constructor & Destructor Documentation

template<class T>
Keos::CBuffer< T >::CBuffer | ( | IBufferBase * | pBuffer = `NULL` | ) | `[inline]`

| Default constructor.

Parameters:

  | pBuffer | Pointer on the intern buffer.

Definition at line 87 of file KeosBuffer.h.

## Member Function Documentation

template<class T>
void Keos::CBuffer< T >::Fill | ( | const T * | pData,
|  | size_t | nCount
| ) | `[inline]`

| Fill the buffer.

Parameters:

  | pData | Pointer on the data.
  | nCount | Number of elements to be copied.

Definition at line 109 of file KeosBuffer.h.

References Assert, Keos::CBuffer< T >::Lock(), and Keos::CBuffer< T >::Unlock().

Referenced by Keos::IRenderSystem::CreateIndexBuffer(), and Keos::IRenderSystem::CreateVertexBuffer().

template<class T>
const IBufferBase * Keos::CBuffer< T >::GetBuffer | ( |  | ) | const`[inline]`

| Return pointer on the buffer.

Returns:
  Pointer on the data.

Definition at line 127 of file KeosBuffer.h.

References Keos::CBuffer< T >::m_Buffer.

template<class T>
ulong Keos::CBuffer< T >::GetCount | ( |  | ) | const`[inline]`

| Return the number of elements in the buffer.

Returns:
  Buffer size.

Definition at line 134 of file KeosBuffer.h.

References Keos::CBuffer< T >::m_Buffer.

Referenced by Keos::CModel::Render().

template<class T>
T * Keos::CBuffer< T >::Lock | ( | ulong | nOffset = `0`,
|  | ulong | nSize = `0`,
|  | ulong | nFlags = `0`
| ) | `[inline]`

| Lock the buffer.

Parameters:

  | nOffset | Lock position.
  | nSize | Number of elements to be locked.
  | nFlags | Lock options.

Returns:
  Pointer on the data locked.

Definition at line 95 of file KeosBuffer.h.

References Keos::CBuffer< T >::m_Buffer.

Referenced by Keos::CFontManager::DrawString(), and Keos::CBuffer< T >::Fill().

template<class T>
void Keos::CBuffer< T >::Release | ( |  | ) | `[inline]`

| Destroy the buffer. Definition at line 120 of file KeosBuffer.h. References Keos::CBuffer< T >::m_Buffer.

template<class T>
void Keos::CBuffer< T >::Unlock | ( |  | ) | `[inline]`

| Unlock the buffer. Definition at line 102 of file KeosBuffer.h. References Keos::CBuffer< T >::m_Buffer. Referenced by Keos::CFontManager::DrawString(), and Keos::CBuffer< T >::Fill().

## Member Data Documentation

template<class T>
CSmartPtr<IBufferBase> Keos::CBuffer< T >::m_Buffer`[private]`

| Intern buffer. Definition at line 78 of file KeosBuffer.h. Referenced by Keos::CBuffer< T >::GetBuffer(), Keos::CBuffer< T >::GetCount(), Keos::CBuffer< T >::Lock(), Keos::CBuffer< T >::Release(), and Keos::CBuffer< T >::Unlock().

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

- KeosEngine/KeosBuffer.h