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::this_thread::thread_info_index Class Reference

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
 

Detailed Description

A helper class to store information about the index of the current thread.

Member Function Documentation

◆ operator()()

optional_index BS::this_thread::thread_info_index::operator() ( ) const
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.

Returns
An 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.
115 {
116 return index;
117 }
optional_index index
The index of the current thread.
Definition BS_thread_pool.hpp:123

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