Represents a thread of execution within the Goby middleware, interleaving periodic events (loop()) with asynchronous receipt of data. Most user code should inherit from SimpleThread, not from Thread directly.
More...
|
| | 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) |
| |
| double | loop_frequency_hertz () const |
| |
| decltype(loop_frequency_) | loop_frequency () const |
| |
| void | set_loop_frequency_hertz (double loop_freq_hertz) |
| |
| void | set_loop_frequency (boost::units::quantity< boost::units::si::frequency > loop_freq) |
| |
template<typename Config, typename TransporterType>
class goby::middleware::Thread< Config, TransporterType >
Represents a thread of execution within the Goby middleware, interleaving periodic events (loop()) with asynchronous receipt of data. Most user code should inherit from SimpleThread, not from Thread directly.
A Thread can represent the main thread of an application or a thread that was launched after startup.
- Template Parameters
-
| Config | Type of the configuration for thie code running in this Thread |
| TransporterType | Type of the underlying transporter used for publish/subscribe from this thread |
Definition at line 60 of file thread.h.
template<typename Config , typename TransporterType >
| goby::middleware::Thread< Config, TransporterType >::Thread |
( |
const Config & |
cfg, |
|
|
TransporterType * |
transporter, |
|
|
int |
index |
|
) |
| |
|
inline |
Construct a thread with a given configuration, underlying transporter, and index (for multiple instantiations), but without any loop() frequency.
- Parameters
-
| cfg | Data to configure the code running in this thread |
| transporter | Underlying transporter |
| index | Numeric index to identify this instantiation of the Thread (only necessary if multiple Threads of the same type are created) Note: loop() will never be called when using this constructor |
Definition at line 96 of file thread.h.