Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
BS::signaller Class Reference

A utility class to allow simple signalling between threads. More...

#include <BS_thread_pool_utils.hpp>

Public Member Functions

 signaller ()
 Construct a new signaller.
 
 signaller (const signaller &)=delete
 
signalleroperator= (const signaller &)=delete
 
 signaller (signaller &&)=default
 
signalleroperator= (signaller &&)=default
 
void ready ()
 Inform any waiting threads that the signaller is ready.
 
void wait ()
 Wait until the signaller is ready.
 

Private Attributes

std::promise< void > promise
 A promise used to set the state of the signaller.
 
std::shared_future< void > future
 A future used to wait for the signaller.
 

Detailed Description

A utility class to allow simple signalling between threads.

Constructor & Destructor Documentation

◆ signaller()

BS::signaller::signaller ( )
inline

Construct a new signaller.

40: promise(), future(promise.get_future()) {}
std::shared_future< void > future
A future used to wait for the signaller.
Definition BS_thread_pool_utils.hpp:75
std::promise< void > promise
A promise used to set the state of the signaller.
Definition BS_thread_pool_utils.hpp:70

Member Function Documentation

◆ ready()

void BS::signaller::ready ( )
inline

Inform any waiting threads that the signaller is ready.

54 {
55 promise.set_value();
56 }
Here is the caller graph for this function:

◆ wait()

void BS::signaller::wait ( )
inline

Wait until the signaller is ready.

62 {
63 future.wait();
64 }
Here is the caller graph for this function:

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