distortos  v0.5.0
object-oriented C++ RTOS for microcontrollers
distortos::StaticRawFifoQueue2< ElementSize, QueueSize > Class Template Reference

StaticRawFifoQueue2 class is a variant of RawFifoQueue that has automatic storage for queue's contents. More...

#include <StaticRawFifoQueue.hpp>

Inheritance diagram for distortos::StaticRawFifoQueue2< ElementSize, QueueSize >:
[legend]
Collaboration diagram for distortos::StaticRawFifoQueue2< ElementSize, QueueSize >:
[legend]

Public Member Functions

 StaticRawFifoQueue2 ()
 StaticRawFifoQueue2's constructor. More...
 
- Public Member Functions inherited from distortos::RawFifoQueue
 RawFifoQueue (StorageUniquePointer &&storageUniquePointer, size_t elementSize, size_t maxElements)
 RawFifoQueue's constructor. More...
 
int pop (void *buffer, size_t size)
 Pops the oldest (first) element from the queue. More...
 
template<typename T >
int pop (T &buffer)
 Pops the oldest (first) element from the queue. More...
 
int push (const void *data, size_t size)
 Pushes the element to the queue. More...
 
template<typename T >
int push (const T &data)
 Pushes the element to the queue. More...
 
int tryPop (void *buffer, size_t size)
 Tries to pop the oldest (first) element from the queue. More...
 
template<typename T >
int tryPop (T &buffer)
 Tries to pop the oldest (first) element from the queue. More...
 
int tryPopFor (TickClock::duration duration, void *buffer, size_t size)
 Tries to pop the oldest (first) element from the queue for a given duration of time. More...
 
template<typename Rep , typename Period >
int tryPopFor (const std::chrono::duration< Rep, Period > duration, void *const buffer, const size_t size)
 Tries to pop the oldest (first) element from the queue for a given duration of time. More...
 
template<typename Rep , typename Period , typename T >
int tryPopFor (const std::chrono::duration< Rep, Period > duration, T &buffer)
 Tries to pop the oldest (first) element from the queue for a given duration of time. More...
 
int tryPopUntil (TickClock::time_point timePoint, void *buffer, size_t size)
 Tries to pop the oldest (first) element from the queue until a given time point. More...
 
template<typename Duration >
int tryPopUntil (const std::chrono::time_point< TickClock, Duration > timePoint, void *const buffer, const size_t size)
 Tries to pop the oldest (first) element from the queue until a given time point. More...
 
template<typename Duration , typename T >
int tryPopUntil (const std::chrono::time_point< TickClock, Duration > timePoint, T &buffer)
 Tries to pop the oldest (first) element from the queue until a given time point. More...
 
int tryPush (const void *data, size_t size)
 Tries to push the element to the queue. More...
 
template<typename T >
int tryPush (const T &data)
 Tries to push the element to the queue. More...
 
int tryPushFor (TickClock::duration duration, const void *data, size_t size)
 Tries to push the element to the queue for a given duration of time. More...
 
template<typename Rep , typename Period >
int tryPushFor (const std::chrono::duration< Rep, Period > duration, const void *const data, const size_t size)
 Tries to push the element to the queue for a given duration of time. More...
 
template<typename Rep , typename Period , typename T >
int tryPushFor (const std::chrono::duration< Rep, Period > duration, const T &data)
 Tries to push the element to the queue for a given duration of time. More...
 
int tryPushUntil (TickClock::time_point timePoint, const void *data, size_t size)
 Tries to push the element to the queue until a given time point. More...
 
template<typename Duration >
int tryPushUntil (const std::chrono::time_point< TickClock, Duration > timePoint, const void *const data, const size_t size)
 Tries to push the element to the queue until a given time point. More...
 
template<typename Duration , typename T >
int tryPushUntil (const std::chrono::time_point< TickClock, Duration > timePoint, const T &data)
 Tries to push the element to the queue until a given time point. More...
 

Private Attributes

std::array< uint8_t, ElementSize *QueueSize > storage_
 storage for queue's contents More...
 

Additional Inherited Members

- Public Types inherited from distortos::RawFifoQueue
using StorageUniquePointer = internal::FifoQueueBase::StorageUniquePointer
 unique_ptr (with deleter) to storage More...
 

Detailed Description

template<size_t ElementSize, size_t QueueSize>
class distortos::StaticRawFifoQueue2< ElementSize, QueueSize >

StaticRawFifoQueue2 class is a variant of RawFifoQueue that has automatic storage for queue's contents.

This class is a replacement for StaticRawFifoQueue and StaticRawFifoQueueFromSize. To use this new API modify your code in following way:

Transition schedule:

  1. v0.5.0 - StaticRawFifoQueue<T, QueueSize> and StaticRawFifoQueueFromSize<ElementSize, QueueSize> are converted to deprecated aliases to StaticRawFifoQueue2<ElementSize, QueueSize>;
  2. v0.6.0 - "old" StaticRawFifoQueue<T, QueueSize> and StaticRawFifoQueueFromSize<ElementSize, QueueSize> aliases are removed, StaticRawFifoQueue2<ElementSize, QueueSize> is renamed to StaticRawFifoQueue<ElementSize, QueueSize>, deprecated StaticRawFifoQueue2<ElementSize, QueueSize> alias is added;
  3. v0.7.0 - deprecated StaticRawFifoQueue2<ElementSize, QueueSize> alias is removed;
Template Parameters
ElementSizeis the size of single queue element, bytes
QueueSizeis the maximum number of elements in queue

Constructor & Destructor Documentation

◆ StaticRawFifoQueue2()

template<size_t ElementSize, size_t QueueSize>
distortos::StaticRawFifoQueue2< ElementSize, QueueSize >::StaticRawFifoQueue2 ( )
inlineexplicit

StaticRawFifoQueue2's constructor.

Member Data Documentation

◆ storage_

template<size_t ElementSize, size_t QueueSize>
std::array<uint8_t, ElementSize * QueueSize> distortos::StaticRawFifoQueue2< ElementSize, QueueSize >::storage_
private

storage for queue's contents


The documentation for this class was generated from the following file: