![]() |
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.
|
A helper class to store information about the index of the current thread. More...
#include <BS_thread_pool.hpp>
Public Member Functions | |
optional_index | operator() () const |
Get the index of the current thread. If this thread belongs to a BS::thread_pool object, it will have an index from 0 to BS::thread_pool::get_thread_count() - 1 . Otherwise, for example if this thread is the main thread or an independent std::thread , std::nullopt will be returned. | |
Private Attributes | |
optional_index | index = std::nullopt |
The index of the current thread. | |
Friends | |
class | BS::thread_pool |
A helper class to store information about the index of the current thread.
|
inline |
Get the index of the current thread. If this thread belongs to a BS::thread_pool
object, it will have an index from 0 to BS::thread_pool::get_thread_count() - 1
. Otherwise, for example if this thread is the main thread or an independent std::thread
, std::nullopt
will be returned.
std::optional
object, optionally containing a thread index. Unless you are 100% sure this thread is in a pool, first use std::optional::has_value()
to check if it contains a value, and if so, use std::optional::value()
to obtain that value.