#include <QuantityCluster.h>
Public Types | |
typedef Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > | V |
the Variable | |
typedef SU | Unit |
the storage unit | |
Public Member Functions | |
VariableVector (void) | |
default constructor | |
template<class NU> | VariableVector (const VariableVector< PQ, NU > &new_vector) |
copy constructor from different unit (conversion) | |
int | length (void) const |
return the number of elements | |
template<template< class, class > class Q1, class GT1, class Head1, class Tail1, class DU1, class SU1, class ST1> void | add (const Q1< Quantity< GT1, Loki::Typelist< Head1, Tail1 >, DU1, ST1 >, SU1 > &new_quantity) |
add a new element to the vector | |
template<template< class, class > class Q1, class GT1, class Head1, class Tail1, class DU1, class SU1, class ST1> void | add (const Q1< Quantity< GT1, Loki::Typelist< Head1, Tail1 >, DU1, ST1 >, SU1 > &new_quantity, const int index) |
add a new element to the vector at position index | |
template<template< class, class > class Q1, class GT1, class Head1, class Tail1, class DU1, class SU1, class ST1> void | replace (const Q1< Quantity< GT1, Loki::Typelist< Head1, Tail1 >, DU1, ST1 >, SU1 > &new_quantity, const int index) |
replace an element in the vector at position index | |
void | remove (const int index) |
remove the element at position index | |
void | clear (void) |
clear all elements from vector | |
V | value (const int index) const |
return the value located in the VariableVector at index | |
V | operator[] (const int index) const |
return the value located in the VariableVector at index | |
template<class NU> Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, NU > | value (const int index, const NU &unit) const |
return the value located in the VariableVector at index in unit NU | |
V | max (void) const |
return maximum | |
template<class NU> Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, NU > | max (const NU &unit) const |
return maximum in unit NU | |
V | min (void) const |
return minimum | |
template<class NU> Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, NU > | min (const NU &unit) const |
return minimum in unit NU | |
Protected Attributes | |
std::vector< ST > | values |
the storage vector | |
Private Types | |
typedef Units::CheckUnit< Units::Unit< GT, ST >, SU >::Check | Checked |
check the unit SU | |
typedef Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST > | PQ |
the parent quantity type |
specialization for PQ being a Quantity. the elements of the quantity vector are stored as a vector values of objects of type ST.
Definition at line 94 of file QuantityCluster.h.
|
add a new element to the vector at position index this element can be a quantity based on the parent quantity PQ; its value is recalculated into the storage unit SU of the vector; range checked. Definition at line 174 of file QuantityCluster.h. |
|
add a new element to the vector this element can be a quantity based on the parent quantity PQ; its value is recalculated into the storage unit USU of the vector; it is appended at the end of the vector. Definition at line 156 of file QuantityCluster.h. |
|
return the number of elements The length function returns an integer which gives the number of elements in the vector. This is calculated using the STL vector function size(). Definition at line 147 of file QuantityCluster.h. |
|
return maximum in unit NU calculate the maximum of the values stored in the vector, convert into NU and return in an appropriate object Definition at line 281 of file QuantityCluster.h. |
|
return maximum calculate the maximum of the values stored in the vector and return it in an object of type V Definition at line 264 of file QuantityCluster.h. |
|
return minimum in unit NU calculate the minimum of the values stored in the vector, convert into NU and return in an appropriate object Definition at line 304 of file QuantityCluster.h. |
|
return minimum calculate the minimum of the values stored in the vector and return it in an object of type V Definition at line 287 of file QuantityCluster.h. |
|
return the value located in the VariableVector at index read access to one element in the VariableVector; uses value (index). Definition at line 248 of file QuantityCluster.h. |
|
remove the element at position index range checked. Definition at line 219 of file QuantityCluster.h. |
|
replace an element in the vector at position index this element can be a quantity based on the parent quantity PQ; its value is recalculated into the storage unit Unit of the vector; range checked. Definition at line 199 of file QuantityCluster.h. |
|
return the value located in the VariableVector at index in unit NU use value (index) and convert the result into NU; the conversion routine between variables checks that NU is available in the unit list. Definition at line 257 of file QuantityCluster.h. |
|
return the value located in the VariableVector at index alternative to operator[]; used by operator[]; range checked. Definition at line 237 of file QuantityCluster.h. |
|
copy constructor from different unit (conversion) reserves a std::vector<ST> of same length as the vector in the new_vector object, and fills it with the elements of new_vector converted to the storage unit of the present variable vector, SU; the conversion routine checks that NU is appropriate. Definition at line 132 of file QuantityCluster.h. |