timer_options.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009, Willow Garage, Inc.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  * * Redistributions of source code must retain the above copyright notice,
7  * this list of conditions and the following disclaimer.
8  * * Redistributions in binary form must reproduce the above copyright
9  * notice, this list of conditions and the following disclaimer in the
10  * documentation and/or other materials provided with the distribution.
11  * * Neither the names of Stanford University or Willow Garage, Inc. nor the names of its
12  * contributors may be used to endorse or promote products derived from
13  * this software without specific prior written permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25  * POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 #ifndef ROSCPP_TIMER_OPTIONS_H
29 #define ROSCPP_TIMER_OPTIONS_H
30 
31 #include "common.h"
32 #include "ros/forwards.h"
33 
34 namespace ros
35 {
36 
40 struct ROSCPP_DECL TimerOptions
41 {
43  : period(0.1)
44  , callback_queue(0)
45  , oneshot(false)
46  , autostart(true)
47  { }
48 
49  /*
50  * \brief Constructor
51  * \param
52  */
53  TimerOptions(Duration _period, const TimerCallback& _callback,
54  CallbackQueueInterface* _queue, bool oneshot = false, bool autostart = true)
55  : period(_period)
56  , callback(_callback)
57  , callback_queue(_queue)
58  , oneshot(oneshot)
59  , autostart(autostart)
60  { }
61 
64 
66 
76 
77  bool oneshot;
78  bool autostart;
79 };
80 
81 
82 }
83 
84 #endif
85 
boost::function< void(const TimerEvent &)> TimerCallback
Definition: forwards.h:144
CallbackQueueInterface * callback_queue
Queue to add callbacks to. If NULL, the global callback queue will be used.
Definition: timer_options.h:65
VoidConstPtr tracked_object
Definition: timer_options.h:75
Abstract interface for a queue used to handle all callbacks within roscpp.
TimerCallback callback
The callback to call.
Definition: timer_options.h:63
Encapsulates all options available for starting a timer.
Definition: timer_options.h:40
TimerOptions(Duration _period, const TimerCallback &_callback, CallbackQueueInterface *_queue, bool oneshot=false, bool autostart=true)
Definition: timer_options.h:53
Duration period
The period to call the callback at.
Definition: timer_options.h:62


roscpp
Author(s): Morgan Quigley, Josh Faust, Brian Gerkey, Troy Straszheim, Dirk Thomas
autogenerated on Mon Nov 2 2020 03:52:26