oveRTOS C++ API
C++20 RAII wrappers for the oveRTOS C API
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ove::Event Class Reference

RAII wrapper around an oveRTOS binary event flag. More...

#include <sync.hpp>

Public Member Functions

 Event ()
 Constructs and initialises the event in the unsignalled state.
 
 ~Event ()
 Destroys the event, releasing the underlying kernel resource.
 
 Event (const Event &)=delete
 
Eventoperator= (const Event &)=delete
 
 Event (Event &&other) noexcept
 Move constructor — transfers ownership of the kernel handle.
 
Eventoperator= (Event &&other) noexcept
 Move-assignment operator — transfers ownership of the kernel handle.
 
int wait (uint32_t timeout_ms=OVE_WAIT_FOREVER)
 Blocks the calling task until the event is signalled or the timeout expires.
 
void signal ()
 Signals the event from task context, waking any blocked waiter.
 
void signal_from_isr ()
 Signals the event from an ISR context, waking any blocked waiter.
 
bool valid () const
 Returns true if the underlying kernel handle is non-null.
 
ove_event_t handle () const
 Returns the raw oveRTOS event handle.
 

Detailed Description

RAII wrapper around an oveRTOS binary event flag.

An Event is a lightweight synchronisation primitive for signalling a single occurrence from one task (or ISR) to another. The event is in an unsignalled state after construction; signal() or signal_from_isr() wakes any task blocked in wait().

Note
Not copyable. Move-only when heap allocation is enabled.

Constructor & Destructor Documentation

◆ Event() [1/2]

ove::Event::Event ( )
inline

Constructs and initialises the event in the unsignalled state.

Asserts at startup if initialisation fails.

◆ Event() [2/2]

ove::Event::Event ( Event &&  other)
inlinenoexcept

Move constructor — transfers ownership of the kernel handle.

Parameters
otherThe source; its handle is set to null after the move.

Member Function Documentation

◆ operator=()

Event & ove::Event::operator= ( Event &&  other)
inlinenoexcept

Move-assignment operator — transfers ownership of the kernel handle.

Parameters
otherThe source; its handle is set to null after the move.
Returns
Reference to this object.

◆ wait()

int ove::Event::wait ( uint32_t  timeout_ms = OVE_WAIT_FOREVER)
inline

Blocks the calling task until the event is signalled or the timeout expires.

Parameters
[in]timeout_msMaximum time to wait in milliseconds; use OVE_WAIT_FOREVER to block indefinitely.
Returns
OVE_OK on success, or a negative error code on timeout/failure.

◆ signal_from_isr()

void ove::Event::signal_from_isr ( )
inline

Signals the event from an ISR context, waking any blocked waiter.

Must only be called from an interrupt service routine.

◆ valid()

bool ove::Event::valid ( ) const
inline

Returns true if the underlying kernel handle is non-null.

Returns
true when the event was successfully initialised.

◆ handle()

ove_event_t ove::Event::handle ( ) const
inline

Returns the raw oveRTOS event handle.

Returns
The opaque ove_event_t handle.

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