Thunderbots Project
Loading...
Searching...
No Matches
first_in_first_out_threaded_observer.h
1#pragma once
2
3#include <optional>
4
5#include "software/multithreading/threaded_observer.hpp"
6
15template <typename T>
17{
18 public:
20
27 explicit FirstInFirstOutThreadedObserver<T>(size_t buffer_size,
28 bool log_buffer_full = true)
29 : ThreadedObserver<T>(buffer_size, log_buffer_full){};
30 std::optional<T> getNextValue(const Duration& max_wait_time) final override;
31};
32
33template <typename T>
35 const Duration& max_wait_time)
36{
37 return this->popLeastRecentlyReceivedValue(max_wait_time);
38}
Definition duration.h:12
Definition first_in_first_out_threaded_observer.h:17
std::optional< T > getNextValue(const Duration &max_wait_time) final override
Definition first_in_first_out_threaded_observer.h:34
FirstInFirstOutThreadedObserver(size_t buffer_size, bool log_buffer_full=true)
Definition first_in_first_out_threaded_observer.h:27
Definition threaded_observer.hpp:18