include
ros
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
{
42
TimerOptions
()
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
62
Duration
period
;
63
TimerCallback
callback
;
64
65
CallbackQueueInterface
*
callback_queue
;
66
75
VoidConstPtr
tracked_object
;
76
77
bool
oneshot
;
78
bool
autostart
;
79
};
80
81
82
}
83
84
#endif
85
ros::TimerOptions::callback_queue
CallbackQueueInterface * callback_queue
Queue to add callbacks to. If NULL, the global callback queue will be used.
Definition:
timer_options.h:65
ros::TimerCallback
boost::function< void(const TimerEvent &)> TimerCallback
Definition:
forwards.h:147
boost::shared_ptr< void const >
ros::TimerOptions
Encapsulates all options available for starting a timer.
Definition:
timer_options.h:40
forwards.h
ros
ros::TimerOptions::callback
TimerCallback callback
The callback to call.
Definition:
timer_options.h:63
ros::TimerOptions::autostart
bool autostart
Definition:
timer_options.h:78
ros::TimerOptions::tracked_object
VoidConstPtr tracked_object
Definition:
timer_options.h:75
ros::TimerOptions::TimerOptions
TimerOptions()
Definition:
timer_options.h:42
ros::TimerOptions::period
Duration period
The period to call the callback at.
Definition:
timer_options.h:62
ros::TimerOptions::TimerOptions
TimerOptions(Duration _period, const TimerCallback &_callback, CallbackQueueInterface *_queue, bool oneshot=false, bool autostart=true)
Definition:
timer_options.h:53
ros::Duration
ros::TimerOptions::oneshot
bool oneshot
Definition:
timer_options.h:77
ros::CallbackQueueInterface
Abstract interface for a queue used to handle all callbacks within roscpp.
Definition:
callback_queue_interface.h:82
roscpp
Author(s): Morgan Quigley, Josh Faust, Brian Gerkey, Troy Straszheim, Dirk Thomas
, Jacob Perron
autogenerated on Sat Sep 14 2024 02:59:36