| ## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# csVertexListWalker< Tbase, Tcomplex > Class Template Reference

Helper class to make it easier to iterate over elements from renderbuffers, with automatic conversion to Tbase. More...

`#include <csgfx/vertexlistwalker.h>`

List of all members.

## Public Member Functions
| csVertexListWalker (iRenderBuffer *buffer, size_t desiredComponents=0, const Tbase *defaultComponents=0)
| Construct new walker.
void | ResetState ()
| Start from the beginning.
const Tcomplex & | operator * () const
| operator Tbase const * () const
| Get current element.
csVertexListWalker & | operator++ ()
| Set current element to the next.

## Detailed Description

### template<typename Tbase, typename Tcomplex = Tbase>
class csVertexListWalker< Tbase, Tcomplex >

Helper class to make it easier to iterate over elements from renderbuffers, with automatic conversion to Tbase.

Elements can also be queried as Tcomplex, which must consist of multiple Tbase.

Remarks:
  The element actually returned (converted or not) is stored in an array internal to the class. That has the consequence that for a queried element, you will only get what you expect as long as operator++() is not called. If you need to retain an element, you have to copy it! This also means you cannot really manipulate the buffer this way...

Definition at line 42 of file vertexlistwalker.h.

## Constructor & Destructor Documentation

template<typename Tbase, typename Tcomplex = Tbase>

csVertexListWalker< Tbase, Tcomplex >::csVertexListWalker | ( | iRenderBuffer * | buffer,
|  | size_t | desiredComponents = `0`,
|  | const Tbase * | defaultComponents = `0` |
| ) |  |  | `[inline]`

Construct new walker.

Parameters:

  | buffer | The render buffer to walk over.
  | desiredComponents | Number of components to fetch from the buffer. Those can differ from the real number; the components are filled up with default values, if necessary. If 0, the component count as set in the buffer will be returned.
  | defaultComponents | The default values for components, if more are requested than available. If 0, the values {0,0,0,1} are used.

Definition at line 55 of file vertexlistwalker.h.

References CS_ASSERT, iRenderBuffer::GetComponentCount(), iRenderBuffer::GetComponentType(), and iRenderBuffer::GetElementCount().

## Member Function Documentation

template<typename Tbase, typename Tcomplex = Tbase>

csVertexListWalker< Tbase, Tcomplex >::operator Tbase const * | ( |  | ) | const`[inline]`

Get current element.

Definition at line 70 of file vertexlistwalker.h.

References CS_ASSERT.

template<typename Tbase, typename Tcomplex = Tbase>

csVertexListWalker& csVertexListWalker< Tbase, Tcomplex >::operator++ | ( |  | ) | `[inline]`

Set current element to the next.

Definition at line 86 of file vertexlistwalker.h.

template<typename Tbase, typename Tcomplex = Tbase>

void csVertexListWalker< Tbase, Tcomplex >::ResetState | ( |  | ) | `[inline]`

Start from the beginning.

Definition at line 95 of file vertexlistwalker.h.

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

- csgfx/vertexlistwalker.h