|
Thunderbots Project
|
#include <last_in_first_out_threaded_observer.h>


Public Member Functions | |
| LastInFirstOutThreadedObserver (size_t buffer_size) | |
| std::optional< T > | getNextValue (const Duration &max_wait_time) final |
Public Member Functions inherited from ThreadedObserver< T > | |
| ThreadedObserver (size_t buffer_size=Observer< T >::DEFAULT_BUFFER_SIZE, bool log_buffer_full=true) | |
| ThreadedObserver & | operator= (const ThreadedObserver &)=delete |
| ThreadedObserver (const ThreadedObserver &)=delete | |
Public Member Functions inherited from Observer< T, Clock > | |
| Observer (size_t buffer_size=DEFAULT_BUFFER_SIZE, bool log_buffer_full=true) | |
| virtual void | receiveValue (T val) |
| virtual double | getDataReceivedPerSecond () final |
Additional Inherited Members | |
Static Public Attributes inherited from Observer< T, Clock > | |
| static constexpr size_t | TIME_BUFFER_SIZE = 5 |
Protected Member Functions inherited from Observer< T, Clock > | |
| virtual std::optional< T > | popMostRecentlyReceivedValue (Duration max_wait_time) final |
| virtual std::optional< T > | popLeastRecentlyReceivedValue (Duration max_wait_time) final |
Static Protected Attributes inherited from Observer< T, Clock > | |
| static constexpr size_t | DEFAULT_BUFFER_SIZE = 1 |
The general usage of this class should be to extend it, then override onValueReceived with whatever custom functionality should occur when a new value is received. This class will call onValueReceived with objects in the internal buffer in a last in, first out order.
| T | The type of object this class is observing |
|
finalvirtual |
This function will return the next value from the internal buffer.
| max_wait_time | The maximum wait time for getting the value |
Reimplemented from ThreadedObserver< T >.