#include <QuantityCluster.h>
Public Types | |
typedef M< BQ, DerivedQuantity< QT, SU, DQT > > | V |
the stored quantity | |
typedef QuantityVector< M, BQ, DerivedQuantity < QT, SU, DQT > > | QV |
the quantity vector | |
typedef ST | StorageType |
the storage type | |
typedef unit::CheckUnit < unit::Unit< UT >, SU >::Check | StorageUnit |
check the storage unit | |
Public Member Functions | |
QuantityVector (void) | |
default constructor | |
QuantityVector & | operator= (const QuantityVector &new_vector) |
copy constructor from different unit (conversion) | |
template<typename SSU, typename SDQT> | |
QuantityVector & | operator= (const QuantityVector< M, BQ, DerivedQuantity< QT, SSU, SDQT > > &new_vector) |
assignment operator | |
bool | operator== (const QV &vector) const |
equality | |
int | size (void) const |
return the number of elements | |
template<template< typename, typename > class Q1, typename QT1, typename ST1, typename SSU, typename SDQT> | |
void | push_back (const Q1< Quantity< QT1, ST1 >, DerivedQuantity< QT1, SSU, SDQT > > &new_quantity) |
add a new element at the end of the vector | |
template<template< typename, typename > class Q1, typename QT1, typename ST1, typename SSU, typename SDQT> | |
void | insert (const Q1< Quantity< QT1, ST1 >, DerivedQuantity< QT1, SSU, SDQT > > &new_quantity, const int index) |
add a new element to the vector at position index | |
template<template< typename, typename > class Q1, typename QT1, typename ST1, typename SSU, typename SDQT> | |
void | replace (const Q1< Quantity< QT1, ST1 >, DerivedQuantity< QT1, SSU, SDQT > > &new_quantity, const int index) |
replace an element in the vector at position index | |
void | erase (const int index) |
erase the element at position index | |
void | clear (void) |
clear all elements from vector | |
std::vector< ST > | values (void) |
return the vector of _values | |
V | value (const int index) const |
return the value located in the QuantityVector at index | |
V | operator[] (const int index) const |
return the value located in the QuantityVector at index | |
template<typename NU> | |
M< Quantity< QT, ST >, DerivedQuantity< QT, NU, DQT > > | value (const int index, const NU &) const |
return the value located in the QuantityVector at index in unit NU | |
V | max (void) const |
return maximum | |
V | min (void) const |
return maximum in unit NU | |
Private Types | |
typedef QuantityTraits< QT > ::Dimension | DIM |
the corresponding quantity (including mode) | |
typedef QuantityTraits< QT > ::UnitType | UT |
the unit type | |
typedef QuantityTraits< QT > ::UnitList | UL |
the unit list | |
typedef QuantityTraits< QT > ::DefaultUnit | DU |
the default unit | |
typedef Quantity< QT, ST > | BQ |
the base quantity type | |
typedef Vector < Quantity< QT, ST > > | VEC |
the base quantity vector | |
Private Member Functions | |
template<typename Archive> | |
void | serialize (Archive &ar, const unsigned int) |
serialization of QuantityVector | |
Private Attributes | |
std::vector< ST > | _values |
the storage vector | |
Friends | |
class | boost::serialization::access |
return minimum in unit NU |
version for base quantity being a Quantity. template parameters:
The elements of the quantity vector are stored as a vector _values of objects of type ST.
Definition at line 118 of file QuantityCluster.h.
typedef QuantityTraits<QT>::Dimension quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::DIM [private] |
the corresponding quantity (including mode)
the dimension
taken from the quantity traits template
Definition at line 128 of file QuantityCluster.h.
typedef QuantityTraits<QT>::UnitType quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::UT [private] |
the unit type
taken from the quantity traits template
Definition at line 133 of file QuantityCluster.h.
typedef QuantityTraits<QT>::UnitList quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::UL [private] |
the unit list
taken from the quantity traits template
Definition at line 138 of file QuantityCluster.h.
typedef QuantityTraits<QT>::DefaultUnit quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::DU [private] |
the default unit
taken from the quantity traits template
Definition at line 143 of file QuantityCluster.h.
typedef Quantity<QT, ST> quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::BQ [private] |
the base quantity type
the Quantity which is used as the base class for the quantity type stored in the vector;
Reimplemented from quantity::Vector< Quantity< QT, ST > >.
Definition at line 149 of file QuantityCluster.h.
typedef Vector<Quantity<QT, ST> > quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::VEC [private] |
typedef M<BQ, DerivedQuantity<QT, SU, DQT> > quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::V |
typedef QuantityVector<M, BQ, DerivedQuantity<QT, SU, DQT> > quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::QV |
the quantity vector
abbreviate the type of the quantity vector
Definition at line 164 of file QuantityCluster.h.
typedef ST quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::StorageType |
typedef unit::CheckUnit<unit::Unit<UT>, SU>::Check quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::StorageUnit |
quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::QuantityVector | ( | void | ) | [inline] |
QuantityVector& quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::operator= | ( | const QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > > & | new_vector | ) | [inline] |
copy constructor from different unit (conversion)
reserves a std::vector<ST> of same size 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; the conversion routine checks that NU is appropriate. !!!!!!!!!! This should be changed! !!!!!!!!!!!!!!!!!!!!! assignment operator
assign a QuantityVector of identical type
Definition at line 205 of file QuantityCluster.h.
QuantityVector& quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::operator= | ( | const QuantityVector< M, BQ, DerivedQuantity< QT, SSU, SDQT > > & | new_vector | ) | [inline] |
assignment operator
assign a QuantityVector of identical base quantity but different derived quantity. no need to check against self assignment, since the two objects have different type, and must be different.
Definition at line 222 of file QuantityCluster.h.
bool quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::operator== | ( | const QV & | vector | ) | const [inline] |
equality
compares the size of the two values vectors and their contents !!!!!!!!!!!!!!!!! other comparisons?!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!! different ST, SU !!!!!!!!!!!!!!!!!!!!!
Definition at line 244 of file QuantityCluster.h.
int quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::size | ( | void | ) | const [inline, virtual] |
return the number of elements
The size function returns an integer which gives the number of elements in the vector. This is calculated using the STL vector function size().
Implements quantity::Vector< Quantity< QT, ST > >.
Definition at line 255 of file QuantityCluster.h.
void quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::push_back | ( | const Q1< Quantity< QT1, ST1 >, DerivedQuantity< QT1, SSU, SDQT > > & | new_quantity | ) | [inline] |
add a new element at the end of the vector
this element can be a quantity based on the base quantity BQ; its value is recalculated into the storage unit of the vector; it is appended at the end of the vector; uses std::vector push_back function.
Definition at line 265 of file QuantityCluster.h.
void quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::insert | ( | const Q1< Quantity< QT1, ST1 >, DerivedQuantity< QT1, SSU, SDQT > > & | new_quantity, | |
const int | index | |||
) | [inline] |
add a new element to the vector at position index
this element can be a quantity based on the base quantity BQ; its value is recalculated into the storage unit of the vector; range checked; uses std::vector function insert.
Definition at line 280 of file QuantityCluster.h.
void quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::replace | ( | const Q1< Quantity< QT1, ST1 >, DerivedQuantity< QT1, SSU, SDQT > > & | new_quantity, | |
const int | index | |||
) | [inline] |
replace an element in the vector at position index
this element can be a quantity based on the base quantity BQ; its value is recalculated into the storage unit Unit of the vector; range checked; this is a function which is not available in std::vector.
Definition at line 307 of file QuantityCluster.h.
void quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::erase | ( | const int | index | ) | [inline] |
erase the element at position index
range checked; forwards to the std::vector erase function
Definition at line 326 of file QuantityCluster.h.
void quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::clear | ( | void | ) | [inline] |
std::vector<ST> quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::values | ( | void | ) | [inline] |
return the vector of _values
provides access to the value vector
Definition at line 343 of file QuantityCluster.h.
V quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::value | ( | const int | index | ) | const [inline] |
return the value located in the QuantityVector at index
alternative to operator[]; used by operator[]; range checked.
Definition at line 348 of file QuantityCluster.h.
V quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::operator[] | ( | const int | index | ) | const [inline] |
return the value located in the QuantityVector at index
read access to one element in the QuantityVector; uses value (index).
Definition at line 359 of file QuantityCluster.h.
M<Quantity<QT, ST>, DerivedQuantity<QT, NU, DQT> > quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::value | ( | const int | index, | |
const NU & | ||||
) | const [inline] |
return the value located in the QuantityVector 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 368 of file QuantityCluster.h.
V quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::max | ( | void | ) | const [inline] |
return maximum
calculate the maximum of the _values stored in the vector and return it in an object of type V
Definition at line 375 of file QuantityCluster.h.
V quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::min | ( | void | ) | const [inline] |
return maximum in unit NU
calculate the maximum of the _values stored in the vector, convert into NU and return in an appropriate object !!!!!!!!!!!!! must be corrected !!!!!!!!! if at all possible !!!!!!! return minimum
calculate the minimum of the _values stored in the vector and return it in an object of type V
Definition at line 402 of file QuantityCluster.h.
void quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::serialize | ( | Archive & | ar, | |
const unsigned | int | |||
) | [inline, private] |
serialization of QuantityVector
uses boost::serialization
Reimplemented from quantity::Vector< Quantity< QT, ST > >.
Definition at line 433 of file QuantityCluster.h.
friend class boost::serialization::access [friend] |
return minimum in unit NU
calculate the minimum of the _values stored in the vector, convert into NU and return in an appropriate object !!!!!!!!!!!!! must be corrected !!!!!!!!! if at all possible !!!!!!! allow access of boost::serialization library
Reimplemented from quantity::Vector< Quantity< QT, ST > >.
Definition at line 427 of file QuantityCluster.h.
std::vector<ST> quantity::QuantityVector< M, Quantity< QT, ST >, DerivedQuantity< QT, SU, DQT > >::_values [private] |