Goby3
3.1.5a
2024.05.23
|
Thread that simply publishes an empty message on its loop interval to TimerThread::group. More...
#include <goby/middleware/application/multi_thread.h>
Public Member Functions | |
TimerThread (const boost::units::quantity< boost::units::si::frequency > &freq) | |
Public Member Functions inherited from goby::middleware::Thread< boost::units::quantity< boost::units::si::frequency >, InterThreadTransporter > | |
Thread (const boost::units::quantity< boost::units::si::frequency > &cfg, InterThreadTransporter *transporter, int index) | |
Construct a thread with a given configuration, underlying transporter, and index (for multiple instantiations), but without any loop() frequency. More... | |
Thread (const boost::units::quantity< boost::units::si::frequency > &cfg, InterThreadTransporter *transporter, double loop_freq_hertz=0, int index=-1) | |
Construct a thread with all possible metadata (using double to specify frequency in Hertz) More... | |
Thread (const boost::units::quantity< boost::units::si::frequency > &cfg, InterThreadTransporter *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) More... | |
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. More... | |
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) |
Static Public Attributes | |
static constexpr goby::middleware::Group | expire_group |
Static Public Attributes inherited from goby::middleware::Thread< boost::units::quantity< boost::units::si::frequency >, InterThreadTransporter > | |
static constexpr goby::middleware::Group | shutdown_group_ |
static constexpr goby::middleware::Group | joinable_group_ |
Friends | |
class | coroner::Thread< TimerThread< i > > |
Thread that simply publishes an empty message on its loop interval to TimerThread::group.
This can be launched to provide a simple timer by subscribing to TimerThread::group.
For example, to create timer that expires every two seconds:
Definition at line 62 of file multi_thread.h.
|
inline |
Definition at line 75 of file multi_thread.h.
|
friend |
Definition at line 69 of file multi_thread.h.
|
staticconstexpr |
Definition at line 72 of file multi_thread.h.