spinner.h
Go to the documentation of this file.
1 #include "sick_scan/sick_scan_base.h" /* Base definitions included in all header files, added by add_sick_scan_base_header.py. Do not edit this line. */
2 /*
3  * Copyright (C) 2009, Willow Garage, Inc.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * * Redistributions of source code must retain the above copyright notice,
8  * this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the names of Stanford University or Willow Garage, Inc. nor the names of its
13  * contributors may be used to endorse or promote products derived from
14  * this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26  * POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef ROSCPP_SPINNER_H
30 #define ROSCPP_SPINNER_H
31 
32 #include "ros/types.h"
33 #include "common.h"
34 
35 #include <memory>
36 
37 namespace roswrap
38 {
39 class NodeHandle;
40 class CallbackQueue;
41 
46 {
47 public:
48  virtual ~Spinner() {}
49 
53  virtual void spin(CallbackQueue* queue = 0) = 0;
54 };
55 
60 {
61 public:
62  virtual void spin(CallbackQueue* queue = 0);
63 };
64 
69 {
70 public:
75  MultiThreadedSpinner(uint32_t thread_count = 0);
76 
77  virtual void spin(CallbackQueue* queue = 0);
78 
79 private:
80  uint32_t thread_count_;
81 };
82 
83 class AsyncSpinnerImpl;
84 typedef std::shared_ptr<AsyncSpinnerImpl> AsyncSpinnerImplPtr;
85 
95 {
96 public:
101  AsyncSpinner(uint32_t thread_count);
102 
108  AsyncSpinner(uint32_t thread_count, CallbackQueue* queue);
109 
110 
111 
119  // TODO: deprecate in L-turtle
120  bool canStart();
124  void start();
128  void stop();
129 
130 private:
132 };
133 
134 }
135 
136 #endif // ROSCPP_SPIN_POLICY_H
roswrap::MultiThreadedSpinner
Spinner which spins in multiple threads.
Definition: spinner.h:68
roswrap::spin
ROSCPP_DECL void spin()
Enter simple event loop.
Definition: rossimu.cpp:260
roswrap::MultiThreadedSpinner::thread_count_
uint32_t thread_count_
Definition: spinner.h:80
roswrap::AsyncSpinner
AsyncSpinner is a spinner that does not conform to the abstract Spinner interface....
Definition: spinner.h:94
roswrap::AsyncSpinnerImplPtr
std::shared_ptr< AsyncSpinnerImpl > AsyncSpinnerImplPtr
Definition: spinner.h:83
roswrap::SingleThreadedSpinner::spin
virtual void spin(CallbackQueue *queue=0)
Spin on a callback queue (defaults to the global one). Blocks until roscpp has been shutdown.
roswrap::Spinner::~Spinner
virtual ~Spinner()
Definition: spinner.h:48
roswrap::CallbackQueue
This is the default implementation of the ros::CallbackQueueInterface.
Definition: callback_queue.h:58
roswrap
Definition: param_modi.cpp:41
roswrap::AsyncSpinner::impl_
AsyncSpinnerImplPtr impl_
Definition: spinner.h:131
common.h
roswrap::Spinner
Abstract interface for classes which spin on a callback queue.
Definition: spinner.h:45
sick_scan_base.h
ROSCPP_DECL
#define ROSCPP_DECL
Definition: roswrap/src/cfgsimu/sick_scan/ros/common.h:63
roswrap::SingleThreadedSpinner
Spinner which runs in a single thread.
Definition: spinner.h:59
roswrap::start
ROSCPP_DECL void start()
Actually starts the internals of the node (spins up threads, starts the network polling and xmlrpc lo...


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