quantity::QuantityVectorTuple< Loki::Typelist< QuantityVector< T, Quantity< QT, ST >, SU >, LTail > > Class Template Reference

a tuple of QuantityVectors More...

#include <QuantityCluster.h>

List of all members.

Public Types

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

Public Member Functions

bool operator== (const QuantityVectorTuple &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 QTuple &new_values)
 add a new set of data to the QuantityVectorTuple
void insert (const QTuple &new_values, const int index)
 add a new set of data to the QuantityVectorTuple at position index
void erase (const int index)
 erase a set of data from the QuantityVectorTuple at position index
template<int I>
Loki::TL::TypeAt< L,
I >::Result::V 
value (const unsigned int index) const
 return a variable value
template<int I, class NU>
T< typename
Loki::TL::TypeAt< L,
I >::Result::V::BQ,
NU > 
value (const int index, const NU &unit) const
 return a variable value in unit
QTuple operator[] (const int index) const
 return the values at position index within the vectors
QTuple values (const int index) const
 return the values at position index within the vectors
template<int I>
QuantityVector< T,
typename
Loki::TL::TypeAt< L,
I >::Result::V::BQ,
typename
Loki::TL::TypeAt< L,
I >
::Result::V::Unit > 
getVector (Loki::Int2Type< I >) const
 return a vector of variables according to index I

Private Types

typedef
Loki::Typelist
< QuantityVector< T,
Quantity< QT, ST >,
SU >, LTail > 
L
 the typelist
typedef
QuantityVectorTuple
< L
QVT
 the quantity vector tuple

Private Member Functions

template<typename Archive>
void save (Archive &ar, const unsigned int) const
 serialization of QuantityVectorTuple - save part
template<typename Archive>
void load (Archive &ar, const unsigned int)
 serialization of QuantityVectorTuple - load part

Private Attributes

Loki::Tuple< Lvectors
 the tuple of quantity vectors

Friends

class AddVal
 friend class
class GetVal
class EraVal
class CmpVec
class Copy
class Assign
class SaveVec
class LoadVec
class boost::serialization::access
 allow access of boost::serialization library


Detailed Description

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
class quantity::QuantityVectorTuple< Loki::Typelist< QuantityVector< T, Quantity< QT, ST >, SU >, LTail > >

a tuple of QuantityVectors

specialization for a Typelist with first element being a QuantityVector. In fact, all elements should be QuantityVectors. Thus, a QuantityVectorTuple is a collection of QuantityVectors. The template is parametrized by a Typelist (Alexandrescu) having the types of the QuantityVectors to be stored as elements;

Definition at line 737 of file QuantityCluster.h.


Member Typedef Documentation

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
typedef Loki::Typelist<QuantityVector<T, Quantity<QT, ST>, SU>, LTail> quantity::QuantityVectorTuple< Loki::Typelist< QuantityVector< T, Quantity< QT, ST >, SU >, LTail > >::L [private]

the typelist

Definition at line 742 of file QuantityCluster.h.

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
typedef QuantityVectorTuple<L> quantity::QuantityVectorTuple< Loki::Typelist< QuantityVector< T, Quantity< QT, ST >, SU >, LTail > >::QVT [private]

the quantity vector tuple

Definition at line 745 of file QuantityCluster.h.

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
typedef Loki::Tuple<typename GetVar<L>::Result> quantity::QuantityVectorTuple< Loki::Typelist< QuantityVector< T, Quantity< QT, ST >, SU >, LTail > >::QTuple

a tuple of quantities

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

Definition at line 756 of file QuantityCluster.h.


Member Function Documentation

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
bool quantity::QuantityVectorTuple< Loki::Typelist< QuantityVector< T, Quantity< QT, ST >, SU >, LTail > >::operator== ( const QuantityVectorTuple< Loki::Typelist< QuantityVector< T, Quantity< QT, ST >, SU >, LTail > > &  tuple  )  const [inline]

equality

compares each pair of QuantityVectors

Definition at line 761 of file QuantityCluster.h.

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
int quantity::QuantityVectorTuple< Loki::Typelist< QuantityVector< T, Quantity< QT, ST >, SU >, LTail > >::number ( void   )  const [inline]

return the number of vectors

Definition at line 766 of file QuantityCluster.h.

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
int quantity::QuantityVectorTuple< Loki::Typelist< QuantityVector< T, Quantity< QT, ST >, SU >, LTail > >::size ( void   )  const [inline]

return the size of the vectors

Definition at line 772 of file QuantityCluster.h.

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
void quantity::QuantityVectorTuple< Loki::Typelist< QuantityVector< T, Quantity< QT, ST >, SU >, LTail > >::push_back ( const QTuple new_values  )  [inline]

add a new set of data to the QuantityVectorTuple

Definition at line 778 of file QuantityCluster.h.

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
void quantity::QuantityVectorTuple< Loki::Typelist< QuantityVector< T, Quantity< QT, ST >, SU >, LTail > >::insert ( const QTuple new_values,
const int  index 
) [inline]

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

Definition at line 786 of file QuantityCluster.h.

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
void quantity::QuantityVectorTuple< Loki::Typelist< QuantityVector< T, Quantity< QT, ST >, SU >, LTail > >::erase ( const int  index  )  [inline]

erase a set of data from the QuantityVectorTuple at position index

uses helper class EraVal.

Definition at line 795 of file QuantityCluster.h.

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
template<int I>
Loki::TL::TypeAt<L, I>::Result::V quantity::QuantityVectorTuple< Loki::Typelist< QuantityVector< T, Quantity< QT, ST >, SU >, LTail > >::value ( const unsigned int  index  )  const [inline]

return a variable value

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

Definition at line 806 of file QuantityCluster.h.

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
template<int I, class NU>
T<typename Loki::TL::TypeAt<L, I>::Result::V::BQ, NU> quantity::QuantityVectorTuple< Loki::Typelist< QuantityVector< T, Quantity< QT, ST >, SU >, LTail > >::value ( const int  index,
const NU &  unit 
) const [inline]

return a variable value in unit

The first index I defines the QuantityVector 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 base quantity BQ of this Variable (in turn retrieved from the typelist of the enclosing QuantityVectorTuple, at position I), and the new unit, in which the value should be returned. Index I iterates over a, possibly, inhomogeneous collection of QuantityVectors. The second index index defines the position of the requested values in the QuantityVector. 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 831 of file QuantityCluster.h.

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
QTuple quantity::QuantityVectorTuple< Loki::Typelist< QuantityVector< T, Quantity< QT, 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 QTuple with the values located in the vectors of the QuantityVectorTuple, at position index respectively.

Definition at line 840 of file QuantityCluster.h.

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
QTuple quantity::QuantityVectorTuple< Loki::Typelist< QuantityVector< T, Quantity< QT, 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 850 of file QuantityCluster.h.

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
template<int I>
QuantityVector<T, typename Loki::TL::TypeAt<L, I>::Result::V::BQ, typename Loki::TL::TypeAt<L, I>::Result::V::Unit> quantity::QuantityVectorTuple< Loki::Typelist< QuantityVector< T, Quantity< QT, ST >, SU >, LTail > >::getVector ( Loki::Int2Type< I >   )  const [inline]

return a vector of variables according to index I

Definition at line 856 of file QuantityCluster.h.

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
template<typename Archive>
void quantity::QuantityVectorTuple< Loki::Typelist< QuantityVector< T, Quantity< QT, ST >, SU >, LTail > >::save ( Archive &  ar,
const unsigned  int 
) const [inline, private]

serialization of QuantityVectorTuple - save part

uses boost::serialization; starts recursion through all elements of the Tuple; NOTE: QuantityVectorTuple is not auto registered with the serialization library, since it is not a derived class and can not be serialized through a base class; before any of the vectors, the (for all vectors in the tuple identical) size is stored; this is needed by the load routine to assure that all vectors have the same number of elements.

Definition at line 892 of file QuantityCluster.h.

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
template<typename Archive>
void quantity::QuantityVectorTuple< Loki::Typelist< QuantityVector< T, Quantity< QT, ST >, SU >, LTail > >::load ( Archive &  ar,
const unsigned  int 
) [inline, private]

serialization of QuantityVectorTuple - load part

uses boost::serialization; starts recursion through all elements of the Tuple; NOTE: QuantityVectorTuple is not auto registered with the serialization library, since it is not a derived class and can not be serialized through a base class; before any of the vectors is read, the variable _size is retrieved; this is the size of all of the vectors and must be equal for each vector in the tuple.

Definition at line 910 of file QuantityCluster.h.


Friends And Related Function Documentation

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
friend class AddVal [friend]

friend class

Definition at line 863 of file QuantityCluster.h.

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
friend class GetVal [friend]

Definition at line 865 of file QuantityCluster.h.

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
friend class EraVal [friend]

Definition at line 867 of file QuantityCluster.h.

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
friend class CmpVec [friend]

Definition at line 869 of file QuantityCluster.h.

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
friend class Copy [friend]

Definition at line 871 of file QuantityCluster.h.

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
friend class Assign [friend]

Definition at line 873 of file QuantityCluster.h.

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
friend class SaveVec [friend]

Definition at line 875 of file QuantityCluster.h.

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
friend class LoadVec [friend]

Definition at line 876 of file QuantityCluster.h.

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
friend class boost::serialization::access [friend]

allow access of boost::serialization library

Definition at line 880 of file QuantityCluster.h.


Member Data Documentation

template<template< typename, typename > class T, typename QT, typename ST, typename SU, typename LTail>
Loki::Tuple<L> quantity::QuantityVectorTuple< Loki::Typelist< QuantityVector< T, Quantity< QT, ST >, SU >, LTail > >::vectors [private]

the tuple of quantity vectors

Definition at line 748 of file QuantityCluster.h.


The documentation for this class was generated from the following file:
Generated on Mon Jul 27 15:55:47 2009 for Quantities by  doxygen 1.5.3