Base class for building multithreaded Goby tests that do not have perform any interprocess (or outer) communications, but only communicate internally via the InterThreadTransporter. The only difference with this class and MultiThreadStandaloneApplication is that the interprocess() and intervehicle() methods are implemented here (as dummy calls to interthread()) to allow this to be a drop-in replacement for testing interthread comms on existing MultiThreadApplication subclasses.
More...
#include <goby/middleware/application/multi_thread.h>
|
| MultiThreadTest (boost::units::quantity< boost::units::si::frequency > loop_freq=0 *boost::units::si::hertz) |
| Construct the test running at the given frequency.
|
|
virtual | ~MultiThreadTest () |
|
Public Member Functions inherited from goby::middleware::MultiThreadStandaloneApplication< Config > |
| MultiThreadStandaloneApplication (double loop_freq_hertz=0) |
| Construct the application calling loop() at the given frequency (double overload)
|
|
| MultiThreadStandaloneApplication (boost::units::quantity< boost::units::si::frequency > loop_freq) |
| Construct the application calling loop() at the given frequency (boost::units overload)
|
|
virtual | ~MultiThreadStandaloneApplication () |
|
void | launch_thread () |
|
void | launch_thread (int index) |
|
void | launch_thread (const ThreadConfig &cfg) |
|
void | launch_thread (int index, const ThreadConfig &cfg) |
|
void | launch_thread_without_cfg () |
|
void | launch_thread_without_cfg (int index) |
|
void | join_thread (int index=-1) |
|
void | launch_timer (boost::units::quantity< boost::units::si::frequency > freq, std::function< void()> on_expire) |
|
void | join_timer () |
|
int | running_thread_count () |
|
| Application () |
|
virtual | ~Application () |
|
| Thread (const Config &cfg, TransporterType *transporter, int index) |
| Construct a thread with a given configuration, underlying transporter, and index (for multiple instantiations), but without any loop() frequency.
|
|
| Thread (const Config &cfg, TransporterType *transporter, double loop_freq_hertz=0, int index=-1) |
| Construct a thread with all possible metadata (using double to specify frequency in Hertz)
|
|
| Thread (const Config &cfg, TransporterType *transporter, boost::units::quantity< boost::units::si::frequency > loop_freq, int index=-1) |
| Construct a thread with all possible metadata (using boost::units to specify frequency)
|
|
virtual | ~Thread () |
|
void | run (std::atomic< bool > &alive) |
| Run the thread until the boolean reference passed is set false. This call blocks, and should be run in a std::thread by the caller.
|
|
int | index () const |
|
std::type_index | type_index () |
|
void | set_type_index (std::type_index type_i) |
|
std::string | name () |
|
void | set_name (const std::string &name) |
|
int | uid () |
|
void | set_uid (int uid) |
|
template<class Config>
class goby::middleware::MultiThreadTest< Config >
Base class for building multithreaded Goby tests that do not have perform any interprocess (or outer) communications, but only communicate internally via the InterThreadTransporter. The only difference with this class and MultiThreadStandaloneApplication is that the interprocess() and intervehicle() methods are implemented here (as dummy calls to interthread()) to allow this to be a drop-in replacement for testing interthread comms on existing MultiThreadApplication subclasses.
- Template Parameters
-
Definition at line 381 of file multi_thread.h.
◆ MultiThreadTest()
Construct the test running at the given frequency.
- Parameters
-
loop_freq | The frequency at which to attempt to call loop(), assuming the main thread isn't blocked handling transporter callbacks (e.g. subscribe callbacks). Zero or negative indicates loop() will never be called. |
Definition at line 390 of file multi_thread.h.
◆ ~MultiThreadTest()
◆ interprocess()
◆ intervehicle()
The documentation for this class was generated from the following file: