AsyncSpinner is a spinner that does not conform to the abstract Spinner interface. Instead, it spins asynchronously when you call start(), and stops when either you call stop(), ros::shutdown() is called, or its destructor is called. More...
#include <spinner.h>
Public Member Functions | |
AsyncSpinner (uint32_t thread_count) | |
Simple constructor. Uses the global callback queue. | |
AsyncSpinner (uint32_t thread_count, CallbackQueue *queue) | |
Constructor with custom callback queue. | |
bool | canStart () |
Check if the spinner can be started. A spinner can't be started if another spinner is already running. | |
void | start () |
Start this spinner spinning asynchronously. | |
void | stop () |
Stop this spinner from running. | |
Private Attributes | |
AsyncSpinnerImplPtr | impl_ |
AsyncSpinner is a spinner that does not conform to the abstract Spinner interface. Instead, it spins asynchronously when you call start(), and stops when either you call stop(), ros::shutdown() is called, or its destructor is called.
AsyncSpinner is reference counted internally, so if you copy one it will continue spinning until all copies have destructed (or stop() has been called on one of them)
ros::AsyncSpinner::AsyncSpinner | ( | uint32_t | thread_count | ) |
Simple constructor. Uses the global callback queue.
thread_count | The number of threads to use. A value of 0 means to use the number of processor cores |
Definition at line 206 of file spinner.cpp.
ros::AsyncSpinner::AsyncSpinner | ( | uint32_t | thread_count, |
CallbackQueue * | queue | ||
) |
Constructor with custom callback queue.
thread_count | The number of threads to use. A value of 0 means to use the number of processor cores |
queue | The callback queue to operate on. A null value means to use the global queue |
Definition at line 211 of file spinner.cpp.
bool ros::AsyncSpinner::canStart | ( | ) |
Check if the spinner can be started. A spinner can't be started if another spinner is already running.
Definition at line 216 of file spinner.cpp.
void ros::AsyncSpinner::start | ( | ) |
Start this spinner spinning asynchronously.
Definition at line 221 of file spinner.cpp.
void ros::AsyncSpinner::stop | ( | ) |
Stop this spinner from running.
Definition at line 226 of file spinner.cpp.
AsyncSpinnerImplPtr ros::AsyncSpinner::impl_ [private] |