|
DUDS
|
Distributed Update of Data from Something
|
An array of quantites of dynamic size and number of dimensions. More...
#include <QuantityArray.hpp>
Public Types | |
| typedef duds::general::NddArray< double > | Array |
| The type of the array holding quantity values. More... | |
| typedef QuantityIterator< typename Array::const_iterator > | const_iterator |
| A const iterator type that will yield Quantity objects when dereferenced. More... | |
| typedef QuantityIterator< typename Array::iterator > | iterator |
| An iterator type that will yield Quantity objects when dereferenced. More... | |
Public Member Functions | |
| QuantityNddArray ()=default | |
| The default constructor; expect unit to be uninitialized. More... | |
| QuantityNddArray (const QuantityNddArray &)=default | |
| A default copy constrcutor. More... | |
| QuantityNddArray (QuantityNddArray &&q) noexcept | |
| Move constructor; the array of quantities is moved rather than copied. More... | |
| iterator | begin () |
| const_iterator | begin () const |
| const_iterator | cbegin () const |
| const_iterator | cend () const |
| void | clear () noexcept |
| Clears the array and units. More... | |
| bool | empty () const |
| True if the array is empty; units are immateral. More... | |
| iterator | end () |
| const_iterator | end () const |
| template<class Dim > | |
| Quantity | get (const Dim &pos) const |
| Returns a new Quantity object for the requested position. More... | |
| Quantity | get (const Array::DimList &pos) const |
| Returns a new Quantity object for the requested position. More... | |
| QuantityNddArray & | operator= (const QuantityNddArray &a)=default |
| Copies one QuantityNddArray into another for an exact match. More... | |
| QuantityNddArray & | operator= (QuantityNddArray &&q)=default |
| Move assignment; the array of quantities is moved rather than copied. More... | |
| template<std::size_t N> | |
| QuantityNddArray & | operator= (const QuantityArray< N > &q) |
| Copies the contents of a QuantityArray into this object. More... | |
| template<class Dim > | |
| void | set (const Dim &pos, const Quantity &q) |
| Sets a stored quantity to be the same as given Quantity object. More... | |
| void | set (const Array::DimList &pos, const Quantity &q) |
| Sets a stored quantity to be the same as given Quantity object. More... | |
Public Attributes | |
| Array | array |
| The array of quantity values. More... | |
| Unit | unit |
| The units of all values in the array. More... | |
Private Member Functions | |
| template<class A > | |
| void | serialize (A &a, const unsigned int) |
Friends | |
| class | boost::serialization::access |
An array of quantites of dynamic size and number of dimensions.
A duds::general::NddArray is used to hold all quantity values, doubles, and the units are held separately. This reduces the memory usage over having an array of Quantity objects. Functions are provided that work with Quantity objects.
Definition at line 284 of file QuantityArray.hpp.
| typedef duds::general::NddArray<double> duds::data::QuantityNddArray::Array |
The type of the array holding quantity values.
Definition at line 288 of file QuantityArray.hpp.
| typedef QuantityIterator<typename Array::const_iterator> duds::data::QuantityNddArray::const_iterator |
A const iterator type that will yield Quantity objects when dereferenced.
Definition at line 351 of file QuantityArray.hpp.
| typedef QuantityIterator<typename Array::iterator> duds::data::QuantityNddArray::iterator |
An iterator type that will yield Quantity objects when dereferenced.
Definition at line 347 of file QuantityArray.hpp.
|
default |
The default constructor; expect unit to be uninitialized.
|
default |
A default copy constrcutor.
|
inlinenoexcept |
Move constructor; the array of quantities is moved rather than copied.
Definition at line 309 of file QuantityArray.hpp.
|
inline |
Definition at line 352 of file QuantityArray.hpp.
|
inline |
Definition at line 355 of file QuantityArray.hpp.
|
inline |
Definition at line 358 of file QuantityArray.hpp.
|
inline |
Definition at line 367 of file QuantityArray.hpp.
|
inlinenoexcept |
Clears the array and units.
Definition at line 334 of file QuantityArray.hpp.
|
inline |
True if the array is empty; units are immateral.
Definition at line 341 of file QuantityArray.hpp.
|
inline |
Definition at line 361 of file QuantityArray.hpp.
|
inline |
Definition at line 364 of file QuantityArray.hpp.
|
inline |
Returns a new Quantity object for the requested position.
| Dim | The type holding the position. It must have forward iterators. |
| pos | The position in the array. |
| duds::data::general::OutOfRangeError | Thrown by Array::at() when the position is outside the array's boundries. |
Definition at line 380 of file QuantityArray.hpp.
|
inline |
Returns a new Quantity object for the requested position.
| pos | The position in the array. |
| OutOfRangeError | Thrown by Array::at() when the position is outside the array's boundries. |
Definition at line 389 of file QuantityArray.hpp.
|
default |
Copies one QuantityNddArray into another for an exact match.
|
default |
Move assignment; the array of quantities is moved rather than copied.
|
inline |
Copies the contents of a QuantityArray into this object.
| N | The length of the source array. |
| q | The source array. |
Definition at line 326 of file QuantityArray.hpp.
|
inlineprivate |
Definition at line 436 of file QuantityArray.hpp.
|
inline |
Sets a stored quantity to be the same as given Quantity object.
| Dim | The type holding the position. It must have forward iterators. |
| pos | The position in the array. |
| q | The quantity to store. |
| UnitMismatch | The units of q are not the same as the units of this array. |
| duds::data::general::OutOfRangeError | Thrown by Array::at() when the position is outside the array's boundries. |
Definition at line 407 of file QuantityArray.hpp.
|
inline |
Sets a stored quantity to be the same as given Quantity object.
| pos | The position in the array. |
| q | The quantity to store. |
| UnitMismatch | The units of q are not the same as the units of this array. |
| duds::data::general::OutOfRangeError | Thrown by Array::at() when the position is outside the array's boundries. |
Definition at line 425 of file QuantityArray.hpp.
|
friend |
Definition at line 434 of file QuantityArray.hpp.
| Array duds::data::QuantityNddArray::array |
The array of quantity values.
Definition at line 292 of file QuantityArray.hpp.
Referenced by duds::data::QuantityArray< 3 >::operator=().
| Unit duds::data::QuantityNddArray::unit |
The units of all values in the array.
Definition at line 296 of file QuantityArray.hpp.
Referenced by duds::data::QuantityArray< 3 >::operator=().