A helper class to find the values that cover a given timestamp from a data stream.
More...
#include <interpolation_helper.hpp>
|
|
using | StampedValue = std::pair< double, Value > |
| |
|
| | InterpolationHelper (InterpolationHelperSearchMode search_mode=InterpolationHelperSearchMode::LINEAR) |
| | Constructor.
|
| |
|
bool | empty () const |
| | Check if it's emptry.
|
| |
|
int | size () const |
| | Number of queued values.
|
| |
|
double | leftmost_time () const |
| | Oldest timestamp in the queue.
|
| |
|
double | rightmost_time () const |
| | Newest timestamp in the queue.
|
| |
| void | add (double stamp, const Value &value) |
| | Add a new value.
|
| |
|
void | add (const std::pair< double, Value > &stamped_value) |
| | Add a new value.
|
| |
| InterpolationHelperResult | find (const double stamp, StampedValue *left_ptr, StampedValue *right_ptr, int *remove_cursor_ptr) const |
| | Find the values that cover the target timestamp.
|
| |
| void | erase (int remove_cursor) |
| | Erase values older than the given cursor.
|
| |
template<typename Value>
class glim::InterpolationHelper< Value >
A helper class to find the values that cover a given timestamp from a data stream.
◆ InterpolationHelper()
template<typename Value >
| glim::InterpolationHelper< Value >::InterpolationHelper |
( |
InterpolationHelperSearchMode |
search_mode = InterpolationHelperSearchMode::LINEAR | ) |
|
|
inline |
◆ add()
template<typename Value >
Add a new value.
- Parameters
-
| stamp | Timestamp |
| value | Value |
◆ erase()
template<typename Value >
Erase values older than the given cursor.
- Parameters
-
| remove_cursor | Cursor index |
◆ find()
template<typename Value >
| InterpolationHelperResult glim::InterpolationHelper< Value >::find |
( |
const double |
stamp, |
|
|
StampedValue * |
left_ptr, |
|
|
StampedValue * |
right_ptr, |
|
|
int * |
remove_cursor_ptr |
|
) |
| const |
|
inline |
Find the values that cover the target timestamp.
- Parameters
-
| stamp | Target timestamp |
| left_ptr | [out] The closest value that is older than the target timestamp (nullptr if not needed) |
| right_ptr | [out] The closest value that is newer than the target timestamp (nullptr if not needed) |
| remove_cursor_ptr | [out] The index of the value that is older than the left_ptr (nullptr if not needed) |
- Returns
- Seach result status
The documentation for this class was generated from the following file: