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
flag_class Class Reference

A class to facilitate checking that member functions of different types have been successfully submitted. More...

Collaboration diagram for flag_class:

Public Member Functions

 flag_class (BS::thread_pool &pool_)
 
void set_flag_no_args ()
 
void set_flag_one_arg (const bool arg)
 
bool set_flag_no_args_return ()
 
bool set_flag_one_arg_return (const bool arg)
 
bool get_flag () const
 
void detach_test_flag_no_args ()
 
void detach_test_flag_one_arg ()
 
void submit_test_flag_no_args ()
 
void submit_test_flag_one_arg ()
 
void submit_test_flag_no_args_return ()
 
void submit_test_flag_one_arg_return ()
 

Private Attributes

bool flag = false
 
BS::thread_poolpool
 

Detailed Description

A class to facilitate checking that member functions of different types have been successfully submitted.

Constructor & Destructor Documentation

◆ flag_class()

flag_class::flag_class ( BS::thread_pool pool_)
inlineexplicit
699: pool(&pool_) {}

Member Function Documentation

◆ set_flag_no_args()

void flag_class::set_flag_no_args ( )
inline
702 {
703 flag = true;
704 }

◆ set_flag_one_arg()

void flag_class::set_flag_one_arg ( const bool  arg)
inline
707 {
708 flag = arg;
709 }

◆ set_flag_no_args_return()

bool flag_class::set_flag_no_args_return ( )
inline
712 {
713 return (flag = true);
714 }

◆ set_flag_one_arg_return()

bool flag_class::set_flag_one_arg_return ( const bool  arg)
inline
717 {
718 return (flag = arg);
719 }

◆ get_flag()

bool flag_class::get_flag ( ) const
inline
722 {
723 return flag;
724 }

◆ detach_test_flag_no_args()

void flag_class::detach_test_flag_no_args ( )
inline
727 {
728 pool->detach_task(
729 [this]
730 {
731 set_flag_no_args();
732 });
733 pool->wait();
734 check(get_flag());
735 }
void check(const bool condition)
Check if a condition is met, report the result, and keep count of the total number of successes and f...
Definition BS_thread_pool_test.cpp:156
void wait()
Wait for tasks to be completed. Normally, this function waits for all tasks, both those that are curr...
Definition BS_thread_pool.hpp:761
void detach_task(F &&task BS_THREAD_POOL_PRIORITY_INPUT)
Submit a function with no arguments and no return value into the task queue, with the specified prior...
Definition BS_thread_pool.hpp:459

◆ detach_test_flag_one_arg()

void flag_class::detach_test_flag_one_arg ( )
inline
738 {
739 pool->detach_task(
740 [this]
741 {
742 set_flag_one_arg(true);
743 });
744 pool->wait();
745 check(get_flag());
746 }

◆ submit_test_flag_no_args()

void flag_class::submit_test_flag_no_args ( )
inline
749 {
750 pool->submit_task(
751 [this]
752 {
753 set_flag_no_args();
754 })
755 .wait();
756 check(get_flag());
757 }
std::future< R > submit_task(F &&task BS_THREAD_POOL_PRIORITY_INPUT)
Submit a function with no arguments into the task queue, with the specified priority....
Definition BS_thread_pool.hpp:605

◆ submit_test_flag_one_arg()

void flag_class::submit_test_flag_one_arg ( )
inline
760 {
761 pool->submit_task(
762 [this]
763 {
764 set_flag_one_arg(true);
765 })
766 .wait();
767 check(get_flag());
768 }

◆ submit_test_flag_no_args_return()

void flag_class::submit_test_flag_no_args_return ( )
inline
771 {
772 std::future<bool> flag_future = pool->submit_task(
773 [this]
774 {
775 return set_flag_no_args_return();
776 });
777 check(flag_future.get() && get_flag());
778 }

◆ submit_test_flag_one_arg_return()

void flag_class::submit_test_flag_one_arg_return ( )
inline
781 {
782 std::future<bool> flag_future = pool->submit_task(
783 [this]
784 {
785 return set_flag_one_arg_return(true);
786 });
787 check(flag_future.get() && get_flag());
788 }

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