|
DUDS
|
Distributed Update of Data from Something
|
An iterator template for QuantityArray and QuantityNddArray that provides a Quantity object when dereferenced. More...
#include <QuantityArray.hpp>
Public Types | |
| typedef void | difference_type |
| typedef std::iterator_traits< I >::iterator_category | iterator_category |
| typedef std::iterator_traits< I >::pointer | pointer |
| typedef std::iterator_traits< I >::reference | reference |
| typedef Quantity | value_type |
Public Member Functions | |
| QuantityIterator ()=default | |
| Make an iterator to nowhere. More... | |
| QuantityIterator (const I &i, Unit u) | |
| Construct a new iterator with the given units. More... | |
| bool | operator!= (const QuantityIterator &it) const |
| Quantity | operator* () const |
| Returns a new Quantity object. More... | |
| QuantityIterator & | operator++ () |
| QuantityIterator & | operator++ (int) |
| QuantityIterator & | operator-- () |
| QuantityIterator & | operator-- (int) |
| bool | operator== (const QuantityIterator &it) const |
| Unit | unit () const |
| Returns the units of all quantities stored in the container. More... | |
| auto | value () const |
| Returns a reference to the value stored in the container. More... | |
Private Attributes | |
| Unit | arrayUnit |
| The units used for all Quantities in the array. More... | |
| I | iter |
| The iterator wrapped by this object. More... | |
An iterator template for QuantityArray and QuantityNddArray that provides a Quantity object when dereferenced.
It is intended to be a BidirectionalIterator. It fails to be an OutputIterator because dereferencing the iterator creates and returns a new Quantity object. However, the underlying value is available and writable through value(). The Unit for all quantities is also accessible, but not writable, through unit().
Definition at line 33 of file QuantityArray.hpp.
| typedef void duds::data::QuantityIterator< I >::difference_type |
Definition at line 49 of file QuantityArray.hpp.
| typedef std::iterator_traits<I>::iterator_category duds::data::QuantityIterator< I >::iterator_category |
Definition at line 48 of file QuantityArray.hpp.
| typedef std::iterator_traits<I>::pointer duds::data::QuantityIterator< I >::pointer |
Definition at line 46 of file QuantityArray.hpp.
| typedef std::iterator_traits<I>::reference duds::data::QuantityIterator< I >::reference |
Definition at line 47 of file QuantityArray.hpp.
| typedef Quantity duds::data::QuantityIterator< I >::value_type |
Definition at line 45 of file QuantityArray.hpp.
|
default |
Make an iterator to nowhere.
|
inline |
Construct a new iterator with the given units.
| i | The wrapped iterator. It must yield a double when dereferenced. |
| u | The units of all items the iterator can reference. |
Definition at line 59 of file QuantityArray.hpp.
|
inline |
Definition at line 81 of file QuantityArray.hpp.
|
inline |
Returns a new Quantity object.
Since the object is created here, it cannot be used to change the data in the container.
Definition at line 88 of file QuantityArray.hpp.
|
inline |
Definition at line 60 of file QuantityArray.hpp.
|
inline |
Definition at line 64 of file QuantityArray.hpp.
|
inline |
Definition at line 69 of file QuantityArray.hpp.
|
inline |
Definition at line 73 of file QuantityArray.hpp.
|
inline |
Definition at line 78 of file QuantityArray.hpp.
|
inline |
Returns the units of all quantities stored in the container.
The units cannot be changed through the iterator.
Definition at line 103 of file QuantityArray.hpp.
Referenced by duds::data::QuantityArray< 3 >::begin(), duds::data::QuantityNddArray::begin(), duds::data::QuantityArray< 3 >::cbegin(), duds::data::QuantityNddArray::cbegin(), duds::data::QuantityArray< 3 >::cend(), duds::data::QuantityNddArray::cend(), duds::data::QuantityArray< 3 >::end(), duds::data::QuantityNddArray::end(), and duds::data::QuantityArray< 3 >::get().
|
inline |
Returns a reference to the value stored in the container.
Definition at line 96 of file QuantityArray.hpp.
|
private |
The units used for all Quantities in the array.
This could have been a pointer to the array, but that would use as much or more memory.
Definition at line 42 of file QuantityArray.hpp.
Referenced by duds::data::QuantityIterator< I >::unit().
|
private |
The iterator wrapped by this object.
Definition at line 37 of file QuantityArray.hpp.
Referenced by duds::data::QuantityIterator< I >::operator!=(), duds::data::QuantityIterator< I >::operator++(), duds::data::QuantityIterator< I >::operator--(), duds::data::QuantityIterator< I >::operator==(), and duds::data::QuantityIterator< I >::value().