14 #ifndef INCLUDE_DISTORTOS_FIFOQUEUE_HPP_
15 #define INCLUDE_DISTORTOS_FIFOQUEUE_HPP_
17 #include "distortos/scheduler/FifoQueueBase.hpp"
36 using Storage = scheduler::FifoQueueBase::Storage<T>;
46 fifoQueueBase_{storage, maxElements, scheduler::FifoQueueBase::TypeTag<T>{}}
66 return fifoQueueBase_.pop(value);
81 int push(
const T& value)
83 return fifoQueueBase_.push(value);
101 return fifoQueueBase_.push(std::move(value));
119 return fifoQueueBase_.tryPop(value);
136 int tryPopFor(
const TickClock::duration duration, T& value)
138 return fifoQueueBase_.tryPopFor(duration, value);
155 template<
typename Rep,
typename Period>
156 int tryPopFor(
const std::chrono::duration<Rep, Period> duration, T& value)
158 return tryPopFor(std::chrono::duration_cast<TickClock::duration>(duration), value);
175 int tryPopUntil(
const TickClock::time_point timePoint, T& value)
177 return fifoQueueBase_.tryPopUntil(timePoint, value);
192 int tryPush(
const T& value)
194 return fifoQueueBase_.tryPush(value);
210 int tryPush(T&& value)
212 return fifoQueueBase_.tryPush(std::move(value));
228 int tryPushFor(
const TickClock::duration duration,
const T& value)
230 return fifoQueueBase_.tryPushFor(duration, value);
247 int tryPushFor(
const TickClock::duration duration, T&& value)
249 return fifoQueueBase_.tryPushFor(duration, std::move(value));
265 int tryPushUntil(
const TickClock::time_point timePoint,
const T& value)
267 return fifoQueueBase_.tryPushUntil(timePoint, value);
284 int tryPushUntil(
const TickClock::time_point timePoint, T&& value)
286 return fifoQueueBase_.tryPushUntil(timePoint, std::move(value));
292 scheduler::FifoQueueBase fifoQueueBase_;
297 #endif // INCLUDE_DISTORTOS_FIFOQUEUE_HPP_
FifoQueue(Storage *const storage, const size_t maxElements)
FifoQueue's constructor.
Definition: FifoQueue.hpp:45
FifoQueue class is a simple FIFO queue for thread-thread, thread-interrupt or interrupt-interrupt com...
Definition: FifoQueue.hpp:31
Definition: FifoQueue.hpp:19
scheduler::FifoQueueBase::Storage< T > Storage
type of uninitialized storage for data
Definition: FifoQueue.hpp:36