#include <QuantityCluster.h>
Inheritance diagram for quantity::VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU >:
Public Types | |
typedef Quantity< DIM, BT, UL, DU, ST > | PQ |
the parent quantity type | |
typedef Variable< Quantity< DIM, BT, UL, 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) | |
void | save (BSUtilities::xmlw::XmlStream &os) const |
save a QuantityVector to XML | |
void | load (const TiXmlHandle node) |
load a QuantityVector from XML | |
bool | operator== (const VariableVector< Quantity< DIM, BT, UL, DU, ST >, SU > &vector) const |
equality | |
int | size (void) const |
return the number of elements | |
template<template< class, class > class Q1, class BT1, class DIM1, class UL1, class DU1, class SU1, class ST1> void | push_back (const Q1< Quantity< DIM1, BT1, UL1, DU1, ST1 >, SU1 > &new_quantity) |
add a new element at the end of the vector | |
template<template< class, class > class Q1, class BT1, class DIM1, class UL1, class DU1, class SU1, class ST1> void | insert (const Q1< Quantity< DIM1, BT1, UL1, 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 BT1, class DIM1, class UL1, class DU1, class SU1, class ST1> void | replace (const Q1< Quantity< DIM1, BT1, UL1, DU1, ST1 >, SU1 > &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 | |
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< DIM, BT, UL, 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< DIM, BT, UL, DU, ST >, NU > | max (const NU &unit) const |
return maximum in unit NU | |
V | min (void) const |
return minimum | |
template<class NU> Variable< Quantity< DIM, BT, UL, DU, ST >, NU > | min (const NU &unit) const |
return minimum in unit NU | |
Static Public Attributes | |
const std::string | ID = "Variable" |
definition of xml VariableVector ID | |
Protected Attributes | |
std::vector< ST > | values |
the storage vector | |
Private Types | |
typedef unit::CheckUnit< unit::Unit< BT >, SU >::Check | Check |
check the unit SU |
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 130 of file QuantityCluster.h.
|
check the unit SU
Definition at line 135 of file QuantityCluster.h. |
|
the parent quantity type
Definition at line 139 of file QuantityCluster.h. |
|
the storage unit
Definition at line 145 of file QuantityCluster.h. |
|
the Variable
Definition at line 142 of file QuantityCluster.h. Referenced by max(), min(), operator[](), and value(). |
|
clear all elements from vector
Definition at line 337 of file QuantityCluster.h. |
|
erase the element at position index range checked; forwards to the std::vector erase function Definition at line 324 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; uses std::vector function insert. Definition at line 279 of file QuantityCluster.h. |
|
load a QuantityVector 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 quantity vector) (3) the value of the ID variable (must be Variable) Subsequently, the child nodes of the element are searched for data elements. If found, the data text is converted into the storage unit and appended to the values vector. Definition at line 207 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 386 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 369 of file QuantityCluster.h. References V. |
|
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 409 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 392 of file QuantityCluster.h. References V. |
|
equality compares the size of the two values vectors and their contents Definition at line 240 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 353 of file QuantityCluster.h. References V. |
|
add a new element at the end of 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; uses std::vector push_back function. Definition at line 262 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; this is a function which is not available in std::vector. Definition at line 305 of file QuantityCluster.h. |
|
save a QuantityVector to XML write the relevant information of the QuantityVector object to a stream in XML format; these are: (1) the type of Quantity (i.e., Variable, etc.) (2) the default name of the Quantity (3) the name of the storage unit (4) the data itself Should we save the storage type? Definition at line 182 of file QuantityCluster.h. |
|
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(). Definition at line 252 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 362 of file QuantityCluster.h. |
|
return the value located in the VariableVector at index alternative to operator[]; used by operator[]; range checked. Definition at line 342 of file QuantityCluster.h. References V. |
|
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, SU; the conversion routine checks that NU is appropriate. Definition at line 162 of file QuantityCluster.h. |
|
default constructor
Definition at line 153 of file QuantityCluster.h. |
|
definition of xml VariableVector ID must be defined outside of class. Definition at line 421 of file QuantityCluster.h. |
|
the storage vector
Definition at line 149 of file QuantityCluster.h. |