|
CPP-TOOLBOX
|
A vector-like container where elements expire after a certain time limit and can be retrieved by time. More...
#include <expiring_temporal_vector.hpp>
Public Types | |
| using | Clock = std::chrono::steady_clock |
| using | TimePoint = Clock::time_point |
Public Member Functions | |
| ExpiringTemporalVector (int time_limit_seconds) | |
| Constructor to initialize the expiring temporal vector with a time limit. | |
| void | push_back (const T &element) |
| Add an element to the vector with the current timestamp. | |
| std::vector< T > | get_elements () |
| Get all elements currently in the vector. | |
| std::vector< T > | get_elements_since (TimePoint time) |
| Get all elements with timestamps greater than or equal to the specified time. | |
| std::vector< T >::iterator | begin () |
| std::vector< T >::iterator | end () |
A vector-like container where elements expire after a certain time limit and can be retrieved by time.
| T | The type of elements stored in the container. |
| using ExpiringTemporalVector< T >::Clock = std::chrono::steady_clock |
| using ExpiringTemporalVector< T >::TimePoint = Clock::time_point |
|
explicit |
Constructor to initialize the expiring temporal vector with a time limit.
| time_limit | The time duration after which elements expire. |
| std::vector< T >::iterator ExpiringTemporalVector< T >::begin | ( | ) |
| std::vector< T >::iterator ExpiringTemporalVector< T >::end | ( | ) |
| std::vector< T > ExpiringTemporalVector< T >::get_elements | ( | ) |
Get all elements currently in the vector.
| std::vector< T > ExpiringTemporalVector< T >::get_elements_since | ( | TimePoint | time | ) |
Get all elements with timestamps greater than or equal to the specified time.
| time | The time point to compare against. |
| void ExpiringTemporalVector< T >::push_back | ( | const T & | element | ) |
Add an element to the vector with the current timestamp.
| element | The element to be added. |