zpp
Zephyr C++20 Framework
zpp::condition_variable Class Reference

A condition variable class. More...

#include <condition_variable.hpp>

Inheritance diagram for zpp::condition_variable:
[legend]
Collaboration diagram for zpp::condition_variable:
[legend]

Public Member Functions

 condition_variable () noexcept
 Default constructor. More...
 
constexpr auto native_handle () noexcept -> native_pointer
 get the native zephyr condition variable handle. More...
 
constexpr auto native_handle () const noexcept -> native_const_pointer
 get the native zephyr condition variable handle. More...
 
 condition_variable (const condition_variable &)=delete
 
 condition_variable (condition_variable &&)=delete
 
condition_variableoperator= (const condition_variable &)=delete
 
condition_variableoperator= (condition_variable &&)=delete
 
- Public Member Functions inherited from zpp::condition_variable_base< condition_variable >
 condition_variable_base (const condition_variable_base &)=delete
 
 condition_variable_base (condition_variable_base &&)=delete
 
auto notify_one () noexcept
 Notify one waiter. More...
 
auto notify_all () noexcept
 Notify all waiters. More...
 
auto wait (T_Mutex &m) noexcept
 wait for ever until the variable is signaled. More...
 
auto wait (T_Mutex &m, T_Predecate pred) noexcept
 wait for ever until the variable is signaled. More...
 
auto try_wait_for (T_Mutex &m, const std::chrono::duration< T_Rep, T_Period > &timeout) noexcept
 Try waiting with a timeout to see if the variable is signaled. More...
 
auto try_wait_for (T_Mutex &m, const std::chrono::duration< T_Rep, T_Period > &timeout, T_Predecate pred) noexcept
 Try waiting with a timeout to see if the variable is signaled. More...
 
auto native_handle () noexcept -> native_pointer
 get the native zephyr k_condvar pointer. More...
 
auto native_handle () const noexcept -> native_const_pointer
 get the native zephyr k_condvar pointer. More...
 
condition_variable_baseoperator= (const condition_variable_base &)=delete
 
condition_variable_baseoperator= (condition_variable_base &&)=delete
 

Additional Inherited Members

- Public Types inherited from zpp::condition_variable_base< condition_variable >
using native_type = struct k_condvar
 
using native_pointer = native_type *
 
using native_const_pointer = native_type const *
 
- Protected Member Functions inherited from zpp::condition_variable_base< condition_variable >
constexpr condition_variable_base () noexcept=default
 Protected default constructor so only derived classes can be created. More...
 

Detailed Description

A condition variable class.

Definition at line 233 of file condition_variable.hpp.

Constructor & Destructor Documentation

◆ condition_variable() [1/3]

zpp::condition_variable::condition_variable ( )
inlinenoexcept

Default constructor.

Definition at line 239 of file condition_variable.hpp.

240  {
241  k_condvar_init(&m_condvar);
242  }

◆ condition_variable() [2/3]

zpp::condition_variable::condition_variable ( const condition_variable )
delete

◆ condition_variable() [3/3]

zpp::condition_variable::condition_variable ( condition_variable &&  )
delete

Member Function Documentation

◆ native_handle() [1/2]

constexpr auto zpp::condition_variable::native_handle ( ) const -> native_const_pointer
inlineconstexprnoexcept

get the native zephyr condition variable handle.

Returns
A pointer to the zephyr k_condvar pointer.

Definition at line 258 of file condition_variable.hpp.

259  {
260  return &m_condvar;
261  }

◆ native_handle() [2/2]

constexpr auto zpp::condition_variable::native_handle ( ) -> native_pointer
inlineconstexprnoexcept

get the native zephyr condition variable handle.

Returns
A pointer to the zephyr k_condvar pointer.

Definition at line 249 of file condition_variable.hpp.

250  {
251  return &m_condvar;
252  }

◆ operator=() [1/2]

condition_variable& zpp::condition_variable::operator= ( condition_variable &&  )
delete

◆ operator=() [2/2]

condition_variable& zpp::condition_variable::operator= ( const condition_variable )
delete

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