7 #ifndef ZPP_INCLUDE_ZPP_POLL_SIGNAL_HPP
8 #define ZPP_INCLUDE_ZPP_POLL_SIGNAL_HPP
12 #include <zephyr/kernel.h>
13 #include <zephyr/sys/__assert.h>
25 template<
typename T_PollSignal>
44 std::optional<int>
check() noexcept
46 unsigned int signaled{0};
100 return static_cast<const T_PollSignal*
>(
this)->
native_handle();
121 k_poll_signal_init(&m_signal);
167 __ASSERT_NO_MSG(m_signal_ptr !=
nullptr);
175 template<
typename T_PollSignal>
177 : m_signal_ptr(s.native_handle())
179 __ASSERT_NO_MSG(m_signal_ptr !=
nullptr);
190 __ASSERT_NO_MSG(m_signal_ptr !=
nullptr);
199 template<
typename T_PollSignal>
202 m_signal_ptr = s.native_handle();
203 __ASSERT_NO_MSG(m_signal_ptr !=
nullptr);
CRTP base class for poll_signals.
std::optional< int > check() noexcept
check if the signal was signaled
auto native_handle() const noexcept -> native_const_pointer
get the native k_poll_signal handle
poll_signal_base & operator=(const poll_signal_base &)=delete
native_type * native_pointer
poll_signal_base(poll_signal_base &&)=delete
void reset() noexcept
reset the state to non-signalled
poll_signal_base & operator=(poll_signal_base &&)=delete
native_type const * native_const_pointer
poll_signal_base() noexcept
default contructor only to be used by derived classes
auto native_handle() noexcept -> native_pointer
get the native k_poll_signal handle
struct k_poll_signal native_type
poll_signal_base(const poll_signal_base &)=delete
class wrapping a k_poll_signal
poll_signal_ref & operator=(native_pointer s) noexcept
create a wrapper around a k_poll_signal
auto native_handle() const noexcept -> native_const_pointer
get the native k_poll_signal handle
poll_signal_ref(native_pointer s) noexcept
create a wrapper around a k_poll_signal
poll_signal_ref(T_PollSignal &s) noexcept
create a wrapper around a k_poll_signal
auto native_handle() noexcept -> native_pointer
get the native k_poll_signal handle
poll_signal_ref & operator=(T_PollSignal &s) noexcept
create a wrapper around a k_poll_signal
class owning a k_poll_signal
auto native_handle() noexcept -> native_pointer
get the native k_poll_signal handle
poll_signal() noexcept
default constructor initializing the signal
auto native_handle() const noexcept -> native_const_pointer
get the native k_poll_signal handle
poll_signal(poll_signal &&)=delete
poll_signal & operator=(const poll_signal &)=delete
poll_signal & operator=(poll_signal &&)=delete
poll_signal(const poll_signal &)=delete