CrystalSpace

Public API Reference

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.
size_t GetSize () const
 Get number of elements in the iterated buffer.
void ResetState ()
 Start from the beginning.

 operator Tbase const * () const
 Get current element.
const Tcomplex & operator* () const
 Get current element.

csVertexListWalkeroperator++ ()
 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.


Member Function Documentation

template<typename Tbase, typename Tcomplex = Tbase>
size_t csVertexListWalker< Tbase, Tcomplex >::GetSize (  )  const [inline]

Get number of elements in the iterated buffer.

Definition at line 110 of file vertexlistwalker.h.

template<typename Tbase, typename Tcomplex = Tbase>
csVertexListWalker< Tbase, Tcomplex >::operator Tbase const * (  )  const [inline]

Get current element.

Definition at line 78 of file vertexlistwalker.h.

template<typename Tbase, typename Tcomplex = Tbase>
const Tcomplex& csVertexListWalker< Tbase, Tcomplex >::operator* (  )  const [inline]

Get current element.

Definition at line 83 of file vertexlistwalker.h.

template<typename Tbase, typename Tcomplex = Tbase>
csVertexListWalker& csVertexListWalker< Tbase, Tcomplex >::operator++ (  )  [inline]

Set current element to the next.

Definition at line 94 of file vertexlistwalker.h.

template<typename Tbase, typename Tcomplex = Tbase>
void csVertexListWalker< Tbase, Tcomplex >::ResetState (  )  [inline]

Start from the beginning.

Definition at line 103 of file vertexlistwalker.h.


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

Generated for Crystal Space 1.4.1 by doxygen 1.7.1