nemo::TimeSeries< TimestampType, ValueType, strictOrdering >::TimestampView Class Reference
This class represents a view on the timestamps within one timeseries. More...
#include <TimeSeries.h>
Public Member Functions | |
TimestampType | operator[] (unsigned int index) const |
Index-based read access. | |
void | set (unsigned int index, TimestampType value) |
Set the timestamp at specified index to a new timestamp-value. | |
void | remove (unsigned int index) |
Removes the timeseries entry at position index . | |
unsigned int | numElements () const |
TimestampType | getElement (unsigned int elementIndex) const |
void | setElement (unsigned int elementIndex, TimestampType value) |
Change the value of an element. | |
void | transform (Mapping< TimestampType, TimestampType > m) |
Apply an element-wise in-place transformation. | |
template<typename OutType > | |
TimeSeries< OutType, ValueType, strictOrdering > | map (Mapping< TimestampType, OutType > m) const |
Apply an element-wise transformation. | |
ViewIterator< TimestampType > | begin () const |
Returns an STL-compliant (read-only) iterator pointing to the first timestamp. | |
ViewIterator< TimestampType > | end () const |
Returns an STL-compliant (read-only) iterator pointing one position after the last timestamp. | |
Friends | |
class | TimeSeries< TimestampType, ValueType, strictOrdering > |
Detailed Description
template<typename TimestampType, typename ValueType, bool strictOrdering = false>
class nemo::TimeSeries< TimestampType, ValueType, strictOrdering >::TimestampView
This class represents a view on the timestamps within one timeseries.
It allows index-based access and manipulation of the timestamps, as well as Collection::map
and Collection::transform operations. This class cannot be created or assigned manually, but can only be used via the TimeSeries::timestamps
instance.
Definition at line 224 of file TimeSeries.h.
Member Function Documentation
ViewIterator<TimestampType> nemo::TimeSeries< TimestampType, ValueType, strictOrdering >::TimestampView::begin | ( | ) | const [inline] |
Returns an STL-compliant (read-only) iterator pointing to the first timestamp.
Definition at line 382 of file TimeSeries.h.
ViewIterator<TimestampType> nemo::TimeSeries< TimestampType, ValueType, strictOrdering >::TimestampView::end | ( | ) | const [inline] |
Returns an STL-compliant (read-only) iterator pointing one position after the last timestamp.
Definition at line 388 of file TimeSeries.h.
TimestampType nemo::TimeSeries< TimestampType, ValueType, strictOrdering >::TimestampView::getElement | ( | unsigned int | elementIndex | ) | const [inline, virtual] |
- Parameters:
-
elementIndex between zero and numElements()-1
- Returns:
- Respective element in collection
Implements nemo::Collection< TimestampType >.
Definition at line 343 of file TimeSeries.h.
TimeSeries<OutType,ValueType,strictOrdering> nemo::TimeSeries< TimestampType, ValueType, strictOrdering >::TimestampView::map | ( | Mapping< TimestampType, OutType > | m | ) | const [inline] |
Apply an element-wise transformation.
The collection itself is not changed, but a new collection is returned that contains the results. Return values of implementing classes should be covariant: for instance MathVector<T>::map() returns a MathVector<OutType>.
Reimplemented from nemo::Collection< TimestampType >.
Definition at line 359 of file TimeSeries.h.
unsigned int nemo::TimeSeries< TimestampType, ValueType, strictOrdering >::TimestampView::numElements | ( | ) | const [inline, virtual] |
- Returns:
- Number of elements in a collection
Implements nemo::Collection< TimestampType >.
Definition at line 340 of file TimeSeries.h.
TimestampType nemo::TimeSeries< TimestampType, ValueType, strictOrdering >::TimestampView::operator[] | ( | unsigned int | index | ) | const [inline] |
Index-based read access.
Definition at line 255 of file TimeSeries.h.
void nemo::TimeSeries< TimestampType, ValueType, strictOrdering >::TimestampView::remove | ( | unsigned int | index | ) | [inline] |
Removes the timeseries entry at position index
.
Runtime: O(n)
Definition at line 332 of file TimeSeries.h.
void nemo::TimeSeries< TimestampType, ValueType, strictOrdering >::TimestampView::set | ( | unsigned int | index, | |
TimestampType | value | |||
) | [inline] |
Set the timestamp at specified index to a new timestamp-value.
This operation might lead to a re-ordering, such that the entry will be available at a different index.
Runtime: O(n) if re-ordering is necessary Runtime: O(1) if re-ordering is NOT necessary
Definition at line 268 of file TimeSeries.h.
void nemo::TimeSeries< TimestampType, ValueType, strictOrdering >::TimestampView::setElement | ( | unsigned int | elementIndex, | |
TimestampType | value | |||
) | [inline, virtual] |
Change the value of an element.
- Parameters:
-
elementIndex between zero and numElements()-1 value New value for respective element
Implements nemo::Collection< TimestampType >.
Definition at line 346 of file TimeSeries.h.
void nemo::TimeSeries< TimestampType, ValueType, strictOrdering >::TimestampView::transform | ( | Mapping< TimestampType, TimestampType > | map | ) | [inline, virtual] |
Apply an element-wise in-place transformation.
Each element e is replaced by map(e).
Implements nemo::Collection< TimestampType >.
Definition at line 349 of file TimeSeries.h.
Friends And Related Function Documentation
friend class TimeSeries< TimestampType, ValueType, strictOrdering > [friend] |
Definition at line 248 of file TimeSeries.h.
The documentation for this class was generated from the following file:
- nemo/TimeSeries.h
Generated on Mon Feb 25 12:49:59 2013 for NemoMath by
![doxygen](doxygen.png)