Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | Related Pages

Quantities::VariableVectorTuple< Loki::Typelist< LHead, LTail > > Class Template Reference

a tuple of VariableVectors More...

#include <QuantityCluster.h>

List of all members.

Public Types

typedef Loki::Tuple< typename
GetVar< L >::Result > 
VariableTuple
 a tuple of quantities


Public Member Functions

int number (void)
 return the number of vectors

int length (void)
 return the length of the vectors

void add (const VariableTuple &new_values)
 add a new set of data to the VariableVectorTuple

void add (const VariableTuple &new_values, const int index)
 add a new set of data to the VariableVectorTuple at position index

void remove (const int index)
 remove a set of data from the VariableVectorTuple at position index

template<int I> Loki::TL::TypeAt< L, I
>::Result::V 
value (const int index) const
 return a variable value

template<int I, class NU> Variable< typename Loki::TL::TypeAt<
L, I >::Result::V::PQ, NU > 
value (const int index, const NU &unit) const
 return a variable value in unit

VariableTuple operator[] (const int index) const
 return the values at position index within the vectors

VariableTuple values (const int index) const
 return the values at position index within the vectors


Private Types

typedef Loki::Typelist< LHead,
LTail > 
L
 the typelist


Private Attributes

Loki::Tuple< Lvectors


Detailed Description

template<class LHead, class LTail>
class Quantities::VariableVectorTuple< Loki::Typelist< LHead, LTail > >

a tuple of VariableVectors

specialization for a Typelist These are collections of VariableVectors. The template is parametrized by a Typelist (Alexandrescu) having the types of the VariableVectors to be stored as elements;

Definition at line 471 of file QuantityCluster.h.


Member Typedef Documentation

template<class LHead, class LTail>
typedef Loki::Tuple<typename GetVar<L>::Result> Quantities::VariableVectorTuple< Loki::Typelist< LHead, LTail > >::VariableTuple
 

a tuple of quantities

helper type with one object of the types stored in the various VariableVectors in the correct order. This can be used for input and output to and from the VariableVectorTuple.

Definition at line 485 of file QuantityCluster.h.

Referenced by add(), operator[](), and values().


Member Function Documentation

template<class LHead, class LTail>
VariableTuple Quantities::VariableVectorTuple< Loki::Typelist< LHead, LTail > >::operator[] const int  index  )  const [inline]
 

return the values at position index within the vectors

uses helper class GetVal to retrieve a VariableTuple with the values located in the vectors of the VariableVectorTuple, at position index respectively.

Definition at line 562 of file QuantityCluster.h.

References VariableTuple.

template<class LHead, class LTail>
void Quantities::VariableVectorTuple< Loki::Typelist< LHead, LTail > >::remove const int  index  )  [inline]
 

remove a set of data from the VariableVectorTuple at position index

uses helper class RemVal.

Definition at line 517 of file QuantityCluster.h.

template<class LHead, class LTail>
template<int I, class NU>
Variable<typename Loki::TL::TypeAt<L, I>::Result::V::PQ, NU> Quantities::VariableVectorTuple< Loki::Typelist< LHead, LTail > >::value const int  index,
const NU &  unit
const [inline]
 

return a variable value in unit

The first index I defines the VariableVector from which the value should be taken. This, consequently, also defines the return type of the function, since this vector is associated with a certain Variable<> type. The return type is determined by the parent quantity PQ of this Variable (in turn retrieved from the typelist of the enclosing VariableVectorTuple, at position I), and the new unit, in which the value should be returned. Index I iterates over a, possibly, inhomogeneous collection of VariableVectors. The second index index defines the position of the requested values in the VariableVector. This collection is homogeneous, all values are returned in the same type. Thus, index does not change the return type, but only defines the numerical value of the result. The difference between the two accessing indices is reflected in their respective treatment as a template parameter (which must be fixed at compile time, thus fixing the return type) and a function parameter (not fixed), respectively. The value is converted into unit. The conversion routine of variables checks that NU is of an appropriate type.

Definition at line 553 of file QuantityCluster.h.

template<class LHead, class LTail>
template<int I>
Loki::TL::TypeAt<L, I>::Result::V Quantities::VariableVectorTuple< Loki::Typelist< LHead, LTail > >::value const int  index  )  const [inline]
 

return a variable value

return the value of the variable located in VariableVector I at position index.

Definition at line 528 of file QuantityCluster.h.

template<class LHead, class LTail>
VariableTuple Quantities::VariableVectorTuple< Loki::Typelist< LHead, LTail > >::values const int  index  )  const [inline]
 

return the values at position index within the vectors

alternative to operator[]; uses operator[]

Definition at line 572 of file QuantityCluster.h.

References VariableTuple.


The documentation for this class was generated from the following file:
Generated on Sun Jan 15 13:58:00 2006 for Quantity by doxygen 1.3.6