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

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

#include "distortos/StaticMessageQueue.hpp"

Inheritance diagram for distortos::StaticMessageQueue< T, QueueSize >:
[legend]
Collaboration diagram for distortos::StaticMessageQueue< T, QueueSize >:
[legend]

Public Member Functions

 StaticMessageQueue ()
 StaticMessageQueue's constructor. More...
 
- Public Member Functions inherited from distortos::MessageQueue< T >
 MessageQueue (EntryStorageUniquePointer &&entryStorageUniquePointer, ValueStorageUniquePointer &&valueStorageUniquePointer, const size_t maxElements)
 MessageQueue's constructor. More...
 
 ~MessageQueue ()
 MessageQueue's destructor. More...
 
template<typename... Args>
int emplace (const uint8_t priority, Args &&... args)
 Emplaces the element in the queue. More...
 
size_t getCapacity () const
 
int pop (uint8_t &priority, T &value)
 Pops oldest element with highest priority from the queue. More...
 
int push (const uint8_t priority, const T &value)
 Pushes the element to the queue. More...
 
int push (const uint8_t priority, T &&value)
 Pushes the element to the queue. More...
 
template<typename... Args>
int tryEmplace (const uint8_t priority, Args &&... args)
 Tries to emplace the element in the queue. More...
 
template<typename... Args>
int tryEmplaceFor (const TickClock::duration duration, const uint8_t priority, Args &&... args)
 Tries to emplace the element in the queue for a given duration of time. More...
 
template<typename Rep , typename Period , typename... Args>
int tryEmplaceFor (const std::chrono::duration< Rep, Period > duration, const uint8_t priority, Args &&... args)
 Tries to emplace the element in the queue for a given duration of time. More...
 
template<typename... Args>
int tryEmplaceUntil (const TickClock::time_point timePoint, const uint8_t priority, Args &&... args)
 Tries to emplace the element in the queue until a given time point. More...
 
template<typename Duration , typename... Args>
int tryEmplaceUntil (const std::chrono::time_point< TickClock, Duration > timePoint, const uint8_t priority, Args &&... args)
 Tries to emplace the element in the queue until a given time point. More...
 
int tryPop (uint8_t &priority, T &value)
 Tries to pop oldest element with highest priority from the queue. More...
 
int tryPopFor (const TickClock::duration duration, uint8_t &priority, T &value)
 Tries to pop 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, T &value)
 Tries to pop oldest element with highest priority from the queue for a given duration of time. More...
 
int tryPopUntil (const TickClock::time_point timePoint, uint8_t &priority, T &value)
 Tries to pop 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, T &value)
 Tries to pop oldest element with highest priority from the queue until a given time point. More...
 
int tryPush (const uint8_t priority, const T &value)
 Tries to push the element to the queue. More...
 
int tryPush (const uint8_t priority, T &&value)
 Tries to push the element to the queue. More...
 
int tryPushFor (const TickClock::duration duration, const uint8_t priority, const T &value)
 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 T &value)
 Tries to push the element to the queue for a given duration of time. More...
 
int tryPushFor (const TickClock::duration duration, const uint8_t priority, T &&value)
 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, T &&value)
 Tries to push the element to the queue for a given duration of time. More...
 
int tryPushUntil (const TickClock::time_point timePoint, const uint8_t priority, const T &value)
 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 T &value)
 Tries to push the element to the queue until a given time point. More...
 
int tryPushUntil (const TickClock::time_point timePoint, const uint8_t priority, T &&value)
 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, T &&value)
 Tries to push the element to the queue until a given time point. More...
 

Static Public Member Functions

static constexpr size_t getCapacity ()
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from distortos::MessageQueue< T >
using EntryStorage = internal::MessageQueueBase::EntryStorage
 type of uninitialized storage for Entry with link More...
 
using ValueStorage = internal::MessageQueueBase::ValueStorage< T >
 type of uninitialized storage for value More...
 
using ValueType = T
 type of data in queue More...
 
using EntryStorageUniquePointer = internal::MessageQueueBase::EntryStorageUniquePointer
 import EntryStorageUniquePointer type from internal::MessageQueueBase class More...
 
using ValueStorageUniquePointer = std::unique_ptr< ValueStorage[], internal::MessageQueueBase::ValueStorageUniquePointer::deleter_type >
 unique_ptr (with deleter) to ValueStorage[] More...
 

Detailed Description

template<typename T, size_t QueueSize>
class distortos::StaticMessageQueue< T, QueueSize >

StaticMessageQueue class is a variant of MessageQueue that has automatic storage for queue's contents.

Template Parameters
Tis the type of data in queue
QueueSizeis the maximum number of elements in queue

Constructor & Destructor Documentation

◆ StaticMessageQueue()

template<typename T , size_t QueueSize>
distortos::StaticMessageQueue< T, QueueSize >::StaticMessageQueue ( )
inlineexplicit

StaticMessageQueue's constructor.

Member Function Documentation

◆ getCapacity()

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

Member Data Documentation

◆ entryStorage_

template<typename T , size_t QueueSize>
std::array<EntryStorage, QueueSize> distortos::StaticMessageQueue< T, QueueSize >::entryStorage_
private

storage for queue's entries

◆ valueStorage_

template<typename T , size_t QueueSize>
std::array<ValueStorage, QueueSize> distortos::StaticMessageQueue< T, QueueSize >::valueStorage_
private

storage for queue's contents


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