zpp
Zephyr C++20 Framework
|
Fifo CRTP base class. More...
#include <fifo.hpp>
Public Types | |
using | native_type = struct k_fifo |
using | native_pointer = native_type * |
using | native_const_pointer = native_type const * |
using | item_type = T_BaseItemType |
using | item_pointer = item_type * |
using | item_const_pointer = item_type const * |
Public Member Functions | |
constexpr auto | native_handle () noexcept -> native_pointer |
get the Zephyr native fifo handle More... | |
constexpr auto | native_handle () const noexcept -> native_const_pointer |
get the Zephyr native fifo handle More... | |
void | cancel_wait () noexcept |
force a waiting thread to return with a timeout error More... | |
void | push_back (item_pointer item) noexcept |
push an item on the back of the fifo More... | |
item_pointer | pop_front () noexcept |
pop item from fifo waiting for ever More... | |
item_pointer | try_pop_front () noexcept |
try to pop item from the fifo without waiting More... | |
template<class T_Rep , class T_Period > | |
item_pointer | try_pop_front_for (const std::chrono::duration< T_Rep, T_Period > &timeout) noexcept |
try to pop item from the fifo waiting a certain amount of time More... | |
item_pointer | front () noexcept |
get item at the front without removing it from the fifo More... | |
item_pointer | back () noexcept |
get item at the back without removing it from the fifo More... | |
bool | empty () noexcept |
check if the fifo is empty More... | |
fifo_base (const fifo_base &)=delete | |
fifo_base (fifo_base &&)=delete | |
fifo_base & | operator= (const fifo_base &)=delete |
fifo_base & | operator= (fifo_base &&)=delete |
Protected Member Functions | |
fifo_base () noexcept | |
default constructor, can only be called from derived types More... | |
Fifo CRTP base class.
T_BaseFifoType | the CRTP derived type |
T_BaseItemType | the item to store in this fifo |
using zpp::fifo_base< T_BaseFifoType, T_BaseItemType >::item_const_pointer = item_type const * |
using zpp::fifo_base< T_BaseFifoType, T_BaseItemType >::item_pointer = item_type* |
using zpp::fifo_base< T_BaseFifoType, T_BaseItemType >::item_type = T_BaseItemType |
using zpp::fifo_base< T_BaseFifoType, T_BaseItemType >::native_const_pointer = native_type const * |
using zpp::fifo_base< T_BaseFifoType, T_BaseItemType >::native_pointer = native_type * |
using zpp::fifo_base< T_BaseFifoType, T_BaseItemType >::native_type = struct k_fifo |
|
inlineprotectednoexcept |
|
delete |
|
delete |
|
inlinenoexcept |
get item at the back without removing it from the fifo
Definition at line 144 of file fifo.hpp.
References zpp::fifo_base< T_BaseFifoType, T_BaseItemType >::native_handle().
|
inlinenoexcept |
force a waiting thread to return with a timeout error
Definition at line 70 of file fifo.hpp.
References zpp::fifo_base< T_BaseFifoType, T_BaseItemType >::native_handle().
|
inlinenoexcept |
check if the fifo is empty
Definition at line 155 of file fifo.hpp.
References zpp::fifo_base< T_BaseFifoType, T_BaseItemType >::native_handle().
|
inlinenoexcept |
get item at the front without removing it from the fifo
Definition at line 133 of file fifo.hpp.
References zpp::fifo_base< T_BaseFifoType, T_BaseItemType >::native_handle().
|
inlineconstexprnoexcept |
get the Zephyr native fifo handle
Definition at line 62 of file fifo.hpp.
References zpp::fifo_base< T_BaseFifoType, T_BaseItemType >::native_handle().
|
inlineconstexprnoexcept |
get the Zephyr native fifo handle
Definition at line 52 of file fifo.hpp.
Referenced by zpp::fifo_base< T_BaseFifoType, T_BaseItemType >::back(), zpp::fifo_base< T_BaseFifoType, T_BaseItemType >::cancel_wait(), zpp::fifo_base< T_BaseFifoType, T_BaseItemType >::empty(), zpp::fifo_base< T_BaseFifoType, T_BaseItemType >::front(), zpp::fifo_base< T_BaseFifoType, T_BaseItemType >::native_handle(), zpp::fifo_base< T_BaseFifoType, T_BaseItemType >::pop_front(), zpp::fifo_base< T_BaseFifoType, T_BaseItemType >::push_back(), zpp::fifo_base< T_BaseFifoType, T_BaseItemType >::try_pop_front(), and zpp::fifo_base< T_BaseFifoType, T_BaseItemType >::try_pop_front_for().
|
delete |
|
delete |
|
inlinenoexcept |
pop item from fifo waiting for ever
Definition at line 91 of file fifo.hpp.
References zpp::fifo_base< T_BaseFifoType, T_BaseItemType >::native_handle().
|
inlinenoexcept |
push an item on the back of the fifo
item | Pointer to a item, the fifo does not take ownership |
Definition at line 80 of file fifo.hpp.
References zpp::fifo_base< T_BaseFifoType, T_BaseItemType >::native_handle().
|
inlinenoexcept |
try to pop item from the fifo without waiting
Definition at line 103 of file fifo.hpp.
References zpp::fifo_base< T_BaseFifoType, T_BaseItemType >::native_handle().
|
inlinenoexcept |
try to pop item from the fifo waiting a certain amount of time
timeout | The timeout before returning |
Definition at line 118 of file fifo.hpp.
References zpp::fifo_base< T_BaseFifoType, T_BaseItemType >::native_handle().