Stores values over time, in chronological order, in a deque for two-ended access.
More...
#include <HistoryContainer.h>
|
using | value_type = ValueType |
|
using | timestamp_type = detail::timestamp |
|
using | full_value_type = detail::full_value_type< value_type > |
|
using | container_type = detail::inner_container_type< value_type > |
|
using | size_type = detail::container_size_type< value_type > |
|
using | iterator = detail::iterator< value_type > |
|
using | const_iterator = iterator |
|
using | comparator_type = detail::TimestampPairLessThan< value_type > |
|
using | subset_range_type = detail::HistorySubsetRange< value_type > |
|
|
size_type | size () const |
| Get number of entries in history.
|
|
size_type | highWaterMark () const |
| Get the maximum number of entries ever recorded.
|
|
bool | empty () const |
| Gets whether history is empty or not.
|
|
timestamp_type const & | oldest_timestamp () const |
|
value_type const & | oldest () const |
|
timestamp_type const & | newest_timestamp () const |
| Returns the newest timestamp in the container. More...
|
|
value_type const & | newest () const |
|
void | pop_oldest () |
|
void | pop_newest () |
|
const_iterator | begin () const |
|
const_iterator | cbegin () const |
|
const_iterator | end () const |
|
const_iterator | cend () const |
|
void | clear () |
|
bool | is_strictly_newest (timestamp_type const &tv) const |
| Returns true if the given timestamp is strictly newer than the newest timestamp in the container, or if the container is empty (thus making the timestamp trivially newest)
|
|
bool | is_as_new_as_newest (timestamp_type const &tv) const |
| Returns true if the given timestamp is no older than the newest timestamp in the container, or if the container is empty (thus making the timestamp trivially newest)
|
|
bool | is_valid_to_push_newest (timestamp_type const &tv) |
| Returns true if the given timestamp meets the criteria of push_newest: strictly newest if AllowDuplicateTimes is false, as new as newest if AllowDuplicateTimes is true. More...
|
|
const_iterator | upper_bound (timestamp_type const &tv) const |
| Wrapper around std::upper_bound: returns iterator to first element newer than timestamp given or end() if none. More...
|
|
const_iterator | lower_bound (timestamp_type const &tv) const |
| Wrapper around std::lower_bound: returns iterator to first element with timestamp equal or newer than timestamp given or end() if none. More...
|
|
const_iterator | closest_not_newer (timestamp_type const &tv) const |
| Return an iterator to the newest, last pair of timestamp and value that is not newer than the given timestamp. More...
|
|
subset_range_type | get_range_newer_than (timestamp_type const &tv) const |
| Returns a proxy object that can be treated as a range in a range-for loop to iterate over all elements strictly newer than the given timestamp. More...
|
|
size_type | pop_before (timestamp_type const &tv) |
| Remove all entries in history with timestamps strictly older than the given timestamp. More...
|
|
size_type | pop_after (timestamp_type const &tv) |
| Remove all entries in history with timestamps strictly newer than the given timestamp. More...
|
|
void | push_newest (osvr::util::time::TimeValue const &tv, value_type const &value) |
| Adds a new value to history. More...
|
|
|
static comparator_type | comparator () |
| Returns a comparison functor (comparing timestamps) for use with standard algorithms like lower_bound and upper_bound.
|
|
|
static const bool | AllowDuplicateTimes = AllowDuplicateTimes_ |
| Whether multiple entries with the same timestamp are permitted to be pushed. More...
|
|
template<typename ValueType, bool AllowDuplicateTimes_ = true>
class osvr::vbtracker::history::HistoryContainer< ValueType, AllowDuplicateTimes_ >
Stores values over time, in chronological order, in a deque for two-ended access.
§ closest_not_newer()
template<typename ValueType, bool AllowDuplicateTimes_ = true>
Return an iterator to the newest, last pair of timestamp and value that is not newer than the given timestamp.
If none meet this criteria, returns end().
This will return one element past where we want. It's OK if that's end(), but not if it's begin().
§ get_range_newer_than()
template<typename ValueType, bool AllowDuplicateTimes_ = true>
Returns a proxy object that can be treated as a range in a range-for loop to iterate over all elements strictly newer than the given timestamp.
(Uses upper_bound internally.)
§ is_valid_to_push_newest()
template<typename ValueType, bool AllowDuplicateTimes_ = true>
Returns true if the given timestamp meets the criteria of push_newest: strictly newest if AllowDuplicateTimes is false, as new as newest if AllowDuplicateTimes is true.
§ lower_bound()
template<typename ValueType, bool AllowDuplicateTimes_ = true>
Wrapper around std::lower_bound: returns iterator to first element with timestamp equal or newer than timestamp given or end() if none.
§ newest_timestamp()
template<typename ValueType, bool AllowDuplicateTimes_ = true>
Returns the newest timestamp in the container.
Caveat: throws an exception in an empty container - if you want to actually compare to see if you're at least as new as the newest, see is_as_new_as_newest(), if you want to see if your value is newer than all others, see is_strictly_newest(). Both of these contain special handling for empty containers.
§ pop_after()
template<typename ValueType, bool AllowDuplicateTimes_ = true>
Remove all entries in history with timestamps strictly newer than the given timestamp.
- Returns
- number of elements removed.
§ pop_before()
template<typename ValueType, bool AllowDuplicateTimes_ = true>
Remove all entries in history with timestamps strictly older than the given timestamp.
- Returns
- number of elements removed.
- Todo:
- is this right?
§ push_newest()
template<typename ValueType, bool AllowDuplicateTimes_ = true>
Adds a new value to history.
It must be newer (or equal time, based on template parameters) than the newest (or the history must be empty).
§ upper_bound()
template<typename ValueType, bool AllowDuplicateTimes_ = true>
Wrapper around std::upper_bound: returns iterator to first element newer than timestamp given or end() if none.
§ AllowDuplicateTimes
template<typename ValueType, bool AllowDuplicateTimes_ = true>
Whether multiple entries with the same timestamp are permitted to be pushed.
The documentation for this class was generated from the following file: