zpp
Zephyr C++20 Framework
zpp::fifo< T_ItemType > Class Template Reference

fifo that manages a k_fifo object More...

#include <fifo.hpp>

Inheritance diagram for zpp::fifo< T_ItemType >:
[legend]
Collaboration diagram for zpp::fifo< T_ItemType >:
[legend]

Public Member Functions

 fifo () noexcept
 create new fifo More...
 
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...
 
 fifo (const fifo &)=delete
 
 fifo (fifo &&)=delete
 
fifooperator= (const fifo &)=delete
 
fifooperator= (fifo &&)=delete
 
- Public Member Functions inherited from zpp::fifo_base< fifo, T_ItemType >
 fifo_base (const fifo_base &)=delete
 
 fifo_base (fifo_base &&)=delete
 
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...
 
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_baseoperator= (const fifo_base &)=delete
 
fifo_baseoperator= (fifo_base &&)=delete
 

Additional Inherited Members

- Public Types inherited from zpp::fifo_base< fifo, T_ItemType >
using native_type = struct k_fifo
 
using native_pointer = native_type *
 
using native_const_pointer = native_type const *
 
using item_type = T_ItemType
 
using item_pointer = item_type *
 
using item_const_pointer = item_type const *
 
- Protected Member Functions inherited from zpp::fifo_base< fifo, T_ItemType >
 fifo_base () noexcept
 default constructor, can only be called from derived types More...
 

Detailed Description

template<typename T_ItemType>
class zpp::fifo< T_ItemType >

fifo that manages a k_fifo object

Definition at line 175 of file fifo.hpp.

Constructor & Destructor Documentation

◆ fifo() [1/3]

template<typename T_ItemType >
zpp::fifo< T_ItemType >::fifo ( )
inlinenoexcept

create new fifo

Definition at line 184 of file fifo.hpp.

185  {
186  k_fifo_init(&m_fifo);
187  }

◆ fifo() [2/3]

template<typename T_ItemType >
zpp::fifo< T_ItemType >::fifo ( const fifo< T_ItemType > &  )
delete

◆ fifo() [3/3]

template<typename T_ItemType >
zpp::fifo< T_ItemType >::fifo ( fifo< T_ItemType > &&  )
delete

Member Function Documentation

◆ native_handle() [1/2]

template<typename T_ItemType >
constexpr auto zpp::fifo< T_ItemType >::native_handle ( ) const -> native_const_pointer
inlineconstexprnoexcept

get the Zephyr native fifo handle

Returns
pointer to a k_fifo

Definition at line 204 of file fifo.hpp.

205  {
206  return &m_fifo;
207  }

◆ native_handle() [2/2]

template<typename T_ItemType >
constexpr auto zpp::fifo< T_ItemType >::native_handle ( ) -> native_pointer
inlineconstexprnoexcept

get the Zephyr native fifo handle

Returns
pointer to a k_fifo

Definition at line 194 of file fifo.hpp.

195  {
196  return &m_fifo;
197  }

◆ operator=() [1/2]

template<typename T_ItemType >
fifo& zpp::fifo< T_ItemType >::operator= ( const fifo< T_ItemType > &  )
delete

◆ operator=() [2/2]

template<typename T_ItemType >
fifo& zpp::fifo< T_ItemType >::operator= ( fifo< T_ItemType > &&  )
delete

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