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

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

#include "distortos/StaticRawMessageQueue.hpp"

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

Public Member Functions

 StaticRawMessageQueue ()
 StaticRawMessageQueue's constructor. More...
 
- Public Member Functions inherited from distortos::RawMessageQueue
 RawMessageQueue (EntryStorageUniquePointer &&entryStorageUniquePointer, ValueStorageUniquePointer &&valueStorageUniquePointer, size_t elementSize, size_t maxElements)
 RawMessageQueue's constructor. More...
 
size_t getCapacity () const
 
size_t getElementSize () const
 
int pop (uint8_t &priority, void *buffer, size_t size)
 Pops oldest element with highest priority from the queue. More...
 
template<typename T >
int pop (uint8_t &priority, T &buffer)
 Pops oldest element with highest priority from the queue. More...
 
int push (uint8_t priority, const void *data, size_t size)
 Pushes the element to the queue. More...
 
template<typename T >
int push (const uint8_t priority, const T &data)
 Pushes the element to the queue. More...
 
int tryPop (uint8_t &priority, void *buffer, size_t size)
 Tries to pop the oldest element with highest priority from the queue. More...
 
template<typename T >
int tryPop (uint8_t &priority, T &buffer)
 Tries to pop the oldest element with highest priority from the queue. More...
 
int tryPopFor (TickClock::duration duration, uint8_t &priority, void *buffer, size_t size)
 Tries to pop the oldest element with highest priority from the queue for a given duration of time. More...
 
template<typename Rep , typename Period >
int tryPopFor (const std::chrono::duration< Rep, Period > duration, uint8_t &priority, void *const buffer, const size_t size)
 Tries to pop the oldest element with highest priority 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, uint8_t &priority, T &buffer)
 Tries to pop the oldest element with highest priority from the queue for a given duration of time. More...
 
int tryPopUntil (TickClock::time_point timePoint, uint8_t &priority, void *buffer, size_t size)
 Tries to pop the oldest element with highest priority from the queue until a given time point. More...
 
template<typename Duration >
int tryPopUntil (const std::chrono::time_point< TickClock, Duration > timePoint, uint8_t &priority, void *const buffer, const size_t size)
 Tries to pop the oldest element with highest priority from the queue until a given time point. More...
 
template<typename Duration , typename T >
int tryPopUntil (const std::chrono::time_point< TickClock, Duration > timePoint, uint8_t &priority, T &buffer)
 Tries to pop the oldest element with highest priority from the queue until a given time point. More...
 
int tryPush (uint8_t priority, const void *data, size_t size)
 Tries to push the element to the queue. More...
 
template<typename T >
int tryPush (const uint8_t priority, const T &data)
 Tries to push the element to the queue. More...
 
int tryPushFor (TickClock::duration duration, uint8_t priority, 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 uint8_t priority, 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 uint8_t priority, const T &data)
 Tries to push the element to the queue for a given duration of time. More...
 
int tryPushUntil (TickClock::time_point timePoint, uint8_t priority, 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 uint8_t priority, 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 uint8_t priority, const T &data)
 Tries to push the element to the queue until a given time point. More...
 

Static Public Member Functions

static constexpr size_t getCapacity ()
 
static constexpr size_t getElementSize ()
 

Private Attributes

std::array< EntryStorage, QueueSize > entryStorage_
 storage for queue's entries More...
 
std::array< uint8_t, ElementSize *QueueSize > valueStorage_
 storage for queue's contents More...
 

Additional Inherited Members

- Public Types inherited from distortos::RawMessageQueue
using EntryStorage = internal::MessageQueueBase::EntryStorage
 type of uninitialized storage for Entry with link More...
 
using EntryStorageUniquePointer = internal::MessageQueueBase::EntryStorageUniquePointer
 import EntryStorageUniquePointer type from internal::MessageQueueBase class More...
 
template<typename T >
using ValueStorage = internal::MessageQueueBase::ValueStorage< T >
 
using ValueStorageUniquePointer = internal::MessageQueueBase::ValueStorageUniquePointer
 unique_ptr (with deleter) to storage for value More...
 

Detailed Description

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

StaticRawMessageQueue class is a variant of RawMessageQueue that has automatic storage for queue's contents.

Template Parameters
ElementSizeis the size of single queue element, bytes
QueueSizeis the maximum number of elements in queue

Constructor & Destructor Documentation

◆ StaticRawMessageQueue()

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

StaticRawMessageQueue's constructor.

Member Function Documentation

◆ getCapacity()

template<size_t ElementSize, size_t QueueSize>
static constexpr size_t distortos::StaticRawMessageQueue< ElementSize, QueueSize >::getCapacity ( )
inlinestatic
Returns
maximum number of elements in queue

◆ getElementSize()

template<size_t ElementSize, size_t QueueSize>
static constexpr size_t distortos::StaticRawMessageQueue< ElementSize, QueueSize >::getElementSize ( )
inlinestatic
Returns
size of single queue element, bytes

Member Data Documentation

◆ entryStorage_

template<size_t ElementSize, size_t QueueSize>
std::array<EntryStorage, QueueSize> distortos::StaticRawMessageQueue< ElementSize, QueueSize >::entryStorage_
private

storage for queue's entries

◆ valueStorage_

template<size_t ElementSize, size_t QueueSize>
std::array<uint8_t, ElementSize * QueueSize> distortos::StaticRawMessageQueue< ElementSize, QueueSize >::valueStorage_
private

storage for queue's contents


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