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

quantity::VariableVectorTuple< Loki::Typelist< VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU >, 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

void save (BSUtilities::xmlw::XmlStream &os) const
 save a VariableVectorTuple to XML

void load (const TiXmlHandle node)
 load a VariableVectorTuple from XML

bool operator== (const VariableVectorTuple &tuple) const
 equality

int number (void) const
 return the number of vectors

int size (void) const
 return the size of the vectors

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

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

void erase (const int index)
 erase 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


Static Public Attributes

const std::string TAG
 the xml VariableVectorTuple tag

const std::string QTAG
 the xml quantity tag

const std::string UTAG
 the xml unit tag

const std::string DTAG
 the xml data tag

const std::string VTAG
 the xml value tag


Private Types

typedef Loki::Typelist< VariableVector<
Quantity< DIM, BT, UL, DU,
ST >, SU >, LTail > 
L
 the typelist


Private Attributes

Loki::Tuple< Lvectors


Detailed Description

template<class DIM, class BT, class UL, class DU, class ST, class SU, class LTail>
class quantity::VariableVectorTuple< Loki::Typelist< VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU >, LTail > >

a tuple of VariableVectors

specialization for a Typelist with first element being a VariableVector. 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 767 of file QuantityCluster.h.


Member Typedef Documentation

template<class DIM, class BT, class UL, class DU, class ST, class SU, class LTail>
typedef Loki::Typelist<VariableVector< Quantity<DIM, BT, UL, DU, ST>, SU>, LTail> quantity::VariableVectorTuple< Loki::Typelist< VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU >, LTail > >::L [private]
 

the typelist

Definition at line 773 of file QuantityCluster.h.

template<class DIM, class BT, class UL, class DU, class ST, class SU, class LTail>
typedef Loki::Tuple<typename GetVar<L>::Result> quantity::VariableVectorTuple< Loki::Typelist< VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU >, 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 783 of file QuantityCluster.h.

Referenced by insert(), operator[](), push_back(), and values().


Member Function Documentation

template<class DIM, class BT, class UL, class DU, class ST, class SU, class LTail>
void quantity::VariableVectorTuple< Loki::Typelist< VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU >, LTail > >::erase const int  index  )  [inline]
 

erase a set of data from the VariableVectorTuple at position index

uses helper class EraVal.

Definition at line 884 of file QuantityCluster.h.

template<class DIM, class BT, class UL, class DU, class ST, class SU, class LTail>
void quantity::VariableVectorTuple< Loki::Typelist< VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU >, LTail > >::insert const VariableTuple new_values,
const int  index
[inline]
 

add a new set of data to the VariableVectorTuple at position index

Definition at line 875 of file QuantityCluster.h.

References VariableTuple.

template<class DIM, class BT, class UL, class DU, class ST, class SU, class LTail>
void quantity::VariableVectorTuple< Loki::Typelist< VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU >, LTail > >::load const TiXmlHandle  node  )  [inline]
 

load a VariableVectorTuple from XML

uses TinyXml; an element is extracted from the TiXmlHandle, and checked for (1) non-null element pointer (2) the name of the element (must be a variable vector tuple) (3) the correctness of quantities and units in the element's attributes Subsequently, the LoadVec helper template's loadvec function is called.

Definition at line 818 of file QuantityCluster.h.

template<class DIM, class BT, class UL, class DU, class ST, class SU, class LTail>
int quantity::VariableVectorTuple< Loki::Typelist< VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU >, LTail > >::number void   )  const [inline]
 

return the number of vectors

Definition at line 855 of file QuantityCluster.h.

template<class DIM, class BT, class UL, class DU, class ST, class SU, class LTail>
bool quantity::VariableVectorTuple< Loki::Typelist< VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU >, LTail > >::operator== const VariableVectorTuple< Loki::Typelist< VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU >, LTail > > &  tuple  )  const [inline]
 

equality

compares the size of the two values vectors and their contents

Definition at line 850 of file QuantityCluster.h.

template<class DIM, class BT, class UL, class DU, class ST, class SU, class LTail>
VariableTuple quantity::VariableVectorTuple< Loki::Typelist< VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU >, 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 929 of file QuantityCluster.h.

References VariableTuple.

template<class DIM, class BT, class UL, class DU, class ST, class SU, class LTail>
void quantity::VariableVectorTuple< Loki::Typelist< VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU >, LTail > >::push_back const VariableTuple new_values  )  [inline]
 

add a new set of data to the VariableVectorTuple

Definition at line 867 of file QuantityCluster.h.

References VariableTuple.

template<class DIM, class BT, class UL, class DU, class ST, class SU, class LTail>
void quantity::VariableVectorTuple< Loki::Typelist< VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU >, LTail > >::save BSUtilities::xmlw::XmlStream &  os  )  const [inline]
 

save a VariableVectorTuple to XML

write the relevant information of the VariableVectorTuple object to a stream in XML format; these are given by the individual VariableVectors

Definition at line 790 of file QuantityCluster.h.

template<class DIM, class BT, class UL, class DU, class ST, class SU, class LTail>
int quantity::VariableVectorTuple< Loki::Typelist< VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU >, LTail > >::size void   )  const [inline]
 

return the size of the vectors

Definition at line 861 of file QuantityCluster.h.

template<class DIM, class BT, class UL, class DU, class ST, class SU, class LTail>
template<int I, class NU>
Variable<typename Loki::TL::TypeAt<L, I>::Result::V::PQ, NU> quantity::VariableVectorTuple< Loki::Typelist< VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU >, 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 argument (which must be fixed at compile time, thus fixing the return type) and a function argument (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 920 of file QuantityCluster.h.

template<class DIM, class BT, class UL, class DU, class ST, class SU, class LTail>
template<int I>
Loki::TL::TypeAt<L, I>::Result::V quantity::VariableVectorTuple< Loki::Typelist< VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU >, 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 895 of file QuantityCluster.h.

template<class DIM, class BT, class UL, class DU, class ST, class SU, class LTail>
VariableTuple quantity::VariableVectorTuple< Loki::Typelist< VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU >, LTail > >::values const int  index  )  const [inline]
 

return the values at position index within the vectors

alternative to operator[]; uses operator[]

Definition at line 939 of file QuantityCluster.h.

References VariableTuple.


Member Data Documentation

template<class DIM, class BT, class UL, class DU, class ST, class SU, class LTail>
const std::string quantity::VariableVectorTuple< Loki::Typelist< VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU >, LTail > >::DTAG [static]
 

the xml data tag

Definition at line 969 of file QuantityCluster.h.

template<class DIM, class BT, class UL, class DU, class ST, class SU, class LTail>
const std::string quantity::VariableVectorTuple< Loki::Typelist< VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU >, LTail > >::QTAG [static]
 

the xml quantity tag

Definition at line 963 of file QuantityCluster.h.

template<class DIM, class BT, class UL, class DU, class ST, class SU, class LTail>
const std::string quantity::VariableVectorTuple< Loki::Typelist< VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU >, LTail > >::TAG [static]
 

the xml VariableVectorTuple tag

Definition at line 960 of file QuantityCluster.h.

template<class DIM, class BT, class UL, class DU, class ST, class SU, class LTail>
const std::string quantity::VariableVectorTuple< Loki::Typelist< VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU >, LTail > >::UTAG [static]
 

the xml unit tag

Definition at line 966 of file QuantityCluster.h.

template<class DIM, class BT, class UL, class DU, class ST, class SU, class LTail>
Loki::Tuple<L> quantity::VariableVectorTuple< Loki::Typelist< VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU >, LTail > >::vectors [private]
 

Definition at line 775 of file QuantityCluster.h.

template<class DIM, class BT, class UL, class DU, class ST, class SU, class LTail>
const std::string quantity::VariableVectorTuple< Loki::Typelist< VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU >, LTail > >::VTAG [static]
 

the xml value tag

Definition at line 972 of file QuantityCluster.h.


The documentation for this class was generated from the following file:
Generated on Sun Jan 15 14:05:22 2006 for Quantity by doxygen 1.3.6