EventSignal Class Reference

Space-ng SDK: sol3::core::EventSignal Class Reference
Space-ng SDK
sol3::core::EventSignal Class Reference

#include <sol3/cpp/event_signal.h>

Public Member Functions

 EventSignal ()=default
 
 ~EventSignal ()=default
 
 EventSignal (EventSignal const &)=delete
 
EventSignaloperator= (EventSignal const &)=delete
 
 EventSignal (EventSignal &&)=delete
 
EventSignaloperator= (EventSignal &&)=delete
 
bool wait (std::chrono::milliseconds timeout_ms) const
 
void notify ()
 Notify all waiting threads of an event. More...
 

Detailed Description

Blocking signal for event notification. Multiple threads can wait() on the same event, and notify() wakes all.

Uses a sequence number to track events, allowing multiple threads to reliably detect the same event without race conditions.

Constructor & Destructor Documentation

◆ EventSignal() [1/3]

sol3::core::EventSignal::EventSignal ( )
default

◆ ~EventSignal()

sol3::core::EventSignal::~EventSignal ( )
default

◆ EventSignal() [2/3]

sol3::core::EventSignal::EventSignal ( EventSignal const &  )
delete

◆ EventSignal() [3/3]

sol3::core::EventSignal::EventSignal ( EventSignal &&  )
delete

Member Function Documentation

◆ notify()

void sol3::core::EventSignal::notify ( )
inline

Notify all waiting threads of an event.

◆ operator=() [1/2]

EventSignal& sol3::core::EventSignal::operator= ( EventSignal &&  )
delete

◆ operator=() [2/2]

EventSignal& sol3::core::EventSignal::operator= ( EventSignal const &  )
delete

◆ wait()

bool sol3::core::EventSignal::wait ( std::chrono::milliseconds  timeout_ms) const
inline

Wait for an event with timeout.

Parameters
timeout_msMaximum duration to wait for an event
Returns
true if an event occurred, false if timeout

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