Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

WRAP< N, T > Class Template Reference

Helper class for LUT parameters. More...

#include <LUT.h>

List of all members.

Public Methods

WRAP< N, T > & operator[] (T x)
 Specify another coordinate.

 operator T () const
 Coerce the return value.


Friends

class LUT< N, T >


Detailed Description

template<int N, typename T>
class WRAP< N, T >

Helper class for LUT parameters.

Helper class templates for improved syntax when accessing tables. LUT::operator[] returns a WRAP object which can be further dereferenced with operator[]. When N coordinates have been specified, WRAP queries the LUT to get the interpolated value. WRAP defines (operator T) to act as a variable of type T to return this value. In practice, here's what it looks like:

LUT<3,float> table; ... float x = table[10.2][3.3][1.4];

Here table[10.2] returns a WRAP<3,float>. The next two dereferences build up the internal VEC<3, float>, finally calling table.getValue(). The righthand-side expression is still a WRAP<3, float> at this point, but is implicitly coerced to a float to assign the interpolated value to 'x'.

Author:
Mark Rose <mrose@stm.lbl.gov>


Member Function Documentation

template<int N, typename T>
WRAP< N, T >::operator T   const [inline]
 

Coerce the return value.

template<int N, typename X>
WRAP< N, X > & WRAP< N, X >::operator[]   x [inline]
 

Specify another coordinate.


Friends And Related Function Documentation

template<int N, typename T>
friend class LUT< N, T > [friend]
 


The documentation for this class was generated from the following file:
SimData version pre-0.4.0. For more information on SimData, visit the SimData Homepage.

Generated on Tue Oct 14 12:06:42 2003, using Doxygen 1.2.18.

[SF.net]