|
DUDS
|
Distributed Update of Data from Something
|
A fixed size array of quantities all sharing the same units. More...
#include <QuantityArray.hpp>
Public Types | |
| typedef std::array< double, L > | 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 | |
| iterator | begin () |
| const_iterator | begin () const |
| const_iterator | cbegin () const |
| const_iterator | cend () const |
| template<std::size_t N> | |
| QuantityArray & | copy (const QuantityArray< N > &a) |
| Copies one QuantityArray into another; sizes do not need to match. More... | |
| iterator | end () |
| const_iterator | end () const |
| Quantity | get (std::size_t pos) const |
| Returns a new Quantity object for the requested position. More... | |
| QuantityArray & | operator= (const QuantityArray &a)=default |
| Copies one QuantityArray into another for an exact match. More... | |
| QuantityArray & | operator= (const QuantityNddArray &a) |
| Copies the contents of a QuantityNddArray into this object. More... | |
| void | set (std::size_t 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... | |
A fixed size array of quantities all sharing the same units.
A std::array is used to store the quantity values, doubles, instead of Quantity objects. This reduces the memory usage over having an array of Quantity objects. Functions are provided that work with Quantity objects.
| L | The length of the array. |
Definition at line 120 of file QuantityArray.hpp.
| typedef std::array<double, L> duds::data::QuantityArray< L >::Array |
The type of the array holding quantity values.
Definition at line 124 of file QuantityArray.hpp.
| typedef QuantityIterator<typename Array::const_iterator> duds::data::QuantityArray< L >::const_iterator |
A const iterator type that will yield Quantity objects when dereferenced.
Definition at line 140 of file QuantityArray.hpp.
| typedef QuantityIterator<typename Array::iterator> duds::data::QuantityArray< L >::iterator |
An iterator type that will yield Quantity objects when dereferenced.
Definition at line 136 of file QuantityArray.hpp.
|
inline |
Definition at line 141 of file QuantityArray.hpp.
|
inline |
Definition at line 144 of file QuantityArray.hpp.
|
inline |
Definition at line 147 of file QuantityArray.hpp.
|
inline |
Definition at line 156 of file QuantityArray.hpp.
|
inline |
Copies one QuantityArray into another; sizes do not need to match.
Definition at line 193 of file QuantityArray.hpp.
|
inline |
Definition at line 150 of file QuantityArray.hpp.
|
inline |
Definition at line 153 of file QuantityArray.hpp.
|
inline |
Returns a new Quantity object for the requested position.
| pos | The position in the array. |
| std::out_of_range | Thrown by Array::at() when the position is outside the array's boundries. |
Definition at line 165 of file QuantityArray.hpp.
|
default |
Copies one QuantityArray into another for an exact match.
| QuantityArray< L > & duds::data::QuantityArray< L >::operator= | ( | const QuantityNddArray & | a | ) |
Copies the contents of a QuantityNddArray into this object.
| a | The source array. It must be one dimensional. The intersection of the elements will be copied; the sizes do not need to match. If a is smaller than this array, some elements will remain unchanged. |
Definition at line 444 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. |
| std::out_of_range | Thrown by Array::at() when the position is outside the array's boundries. |
Definition at line 179 of file QuantityArray.hpp.
| Array duds::data::QuantityArray< L >::array |
The array of quantity values.
Definition at line 128 of file QuantityArray.hpp.
Referenced by duds::data::QuantityArray< 3 >::copy(), and duds::data::QuantityNddArray::operator=().
| Unit duds::data::QuantityArray< L >::unit |
The units of all values in the array.
Definition at line 132 of file QuantityArray.hpp.
Referenced by duds::hardware::devices::instruments::LSM9DS1AccelGyro::accelerometerQuantity(), duds::data::QuantityArray< 3 >::copy(), duds::hardware::devices::instruments::LSM9DS1AccelGyro::gyroscopeQuantity(), duds::data::QuantityNddArray::operator=(), and duds::hardware::devices::instruments::LSM9DS1Mag::quantity().