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

fifo that references a k_fifo object More...

#include <fifo.hpp>

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

Public Member Functions

constexpr fifo_ref (native_pointer f) noexcept
 wrap k_fifo More...
 
template<template< class > class T_Fifo>
constexpr fifo_ref (T_Fifo< T_ItemType > &f) noexcept
 Reference another fifo object. More...
 
constexpr fifo_refoperator= (native_pointer f) noexcept
 Reference another fifo object. More...
 
template<template< class > class T_Fifo>
constexpr fifo_refoperator= (const T_Fifo< T_ItemType > &f) noexcept
 Reference another fifo object. 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_ref ()=delete
 
- Public Member Functions inherited from zpp::fifo_base< fifo_ref, 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_ref, 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_ref, T_ItemType >
 fifo_base () noexcept
 default constructor, can only be called from derived types More...
 

Detailed Description

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

fifo that references a k_fifo object

Definition at line 221 of file fifo.hpp.

Constructor & Destructor Documentation

◆ fifo_ref() [1/3]

template<typename T_ItemType >
constexpr zpp::fifo_ref< T_ItemType >::fifo_ref ( native_pointer  f)
inlineexplicitconstexprnoexcept

wrap k_fifo

Parameters
fthe k_fifo to reference
Warning
f must stay valid for the lifetime of this object

Definition at line 234 of file fifo.hpp.

235  : m_fifo_ptr(f)
236  {
237  __ASSERT_NO_MSG(m_fifo_ptr != nullptr);
238  }

◆ fifo_ref() [2/3]

template<typename T_ItemType >
template<template< class > class T_Fifo>
constexpr zpp::fifo_ref< T_ItemType >::fifo_ref ( T_Fifo< T_ItemType > &  f)
inlineexplicitconstexprnoexcept

Reference another fifo object.

Parameters
fthe object to reference
Warning
f must stay valid for the lifetime of this object

Definition at line 248 of file fifo.hpp.

249  : m_fifo_ptr(f.native_handle())
250  {
251  __ASSERT_NO_MSG(m_fifo_ptr != nullptr);
252  }

◆ fifo_ref() [3/3]

template<typename T_ItemType >
zpp::fifo_ref< T_ItemType >::fifo_ref ( )
delete

Member Function Documentation

◆ native_handle() [1/2]

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

get the Zephyr native fifo handle

Returns
pointer to a k_fifo

Definition at line 302 of file fifo.hpp.

303  {
304  return m_fifo_ptr;
305  }

◆ native_handle() [2/2]

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

get the Zephyr native fifo handle

Returns
pointer to a k_fifo

Definition at line 292 of file fifo.hpp.

293  {
294  return m_fifo_ptr;
295  }

Referenced by zpp::fifo_ref< T_ItemType >::operator=().

◆ operator=() [1/2]

template<typename T_ItemType >
template<template< class > class T_Fifo>
constexpr fifo_ref& zpp::fifo_ref< T_ItemType >::operator= ( const T_Fifo< T_ItemType > &  f)
inlineconstexprnoexcept

Reference another fifo object.

Parameters
fthe object to reference
Returns
*this
Warning
f must stay valid for the lifetime of this object

Definition at line 280 of file fifo.hpp.

281  {
282  m_fifo_ptr = f.native_handle();
283  __ASSERT_NO_MSG(m_fifo_ptr != nullptr);
284  return *this;
285  }

References zpp::fifo_ref< T_ItemType >::native_handle().

◆ operator=() [2/2]

template<typename T_ItemType >
constexpr fifo_ref& zpp::fifo_ref< T_ItemType >::operator= ( native_pointer  f)
inlineconstexprnoexcept

Reference another fifo object.

Parameters
fthe object to reference
Returns
*this
Warning
f must stay valid for the lifetime of this object

Definition at line 263 of file fifo.hpp.

264  {
265  m_fifo_ptr = f;
266  __ASSERT_NO_MSG(m_fifo_ptr != nullptr);
267  return *this;
268  }

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