Public Member Functions | Private Attributes | List of all members
roswrap::AsyncSpinner Class Reference

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. More...
 
 AsyncSpinner (uint32_t thread_count, CallbackQueue *queue)
 Constructor with custom callback queue. More...
 
bool canStart ()
 Check if the spinner can be started. The spinner shouldn't be started if another single-threaded spinner is already operating on the callback queue. More...
 
void start ()
 Start this spinner spinning asynchronously. More...
 
void stop ()
 Stop this spinner from running. More...
 

Private Attributes

AsyncSpinnerImplPtr impl_
 

Detailed Description

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)

Definition at line 94 of file spinner.h.

Constructor & Destructor Documentation

◆ AsyncSpinner() [1/2]

roswrap::AsyncSpinner::AsyncSpinner ( uint32_t  thread_count)

Simple constructor. Uses the global callback queue.

Parameters
thread_countThe number of threads to use. A value of 0 means to use the number of processor cores

◆ AsyncSpinner() [2/2]

roswrap::AsyncSpinner::AsyncSpinner ( uint32_t  thread_count,
CallbackQueue queue 
)

Constructor with custom callback queue.

Parameters
thread_countThe number of threads to use. A value of 0 means to use the number of processor cores
queueThe callback queue to operate on. A null value means to use the global queue

Member Function Documentation

◆ canStart()

bool roswrap::AsyncSpinner::canStart ( )

Check if the spinner can be started. The spinner shouldn't be started if another single-threaded spinner is already operating on the callback queue.

This function is not necessary anymore. start() will always try to start spinning and throw a std::runtime_error if it failed.

◆ start()

void roswrap::AsyncSpinner::start ( )

Start this spinner spinning asynchronously.

◆ stop()

void roswrap::AsyncSpinner::stop ( )

Stop this spinner from running.

Member Data Documentation

◆ impl_

AsyncSpinnerImplPtr roswrap::AsyncSpinner::impl_
private

Definition at line 131 of file spinner.h.


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


sick_scan_xd
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:15