ROS 2 rclcpp + rcl - rolling
rolling-e7363f10
ROS 2 C++ Client Library with ROS Client Library
rcl
src
rcl
timer_impl.h
1
// Copyright 2025 cellumation GmbH
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
#ifndef RCL__TIMER_IMPL_H_
16
#define RCL__TIMER_IMPL_H_
17
18
#include <stdbool.h>
19
20
#include "
rcl/allocator.h
"
21
#include "
rcl/time.h
"
22
#include "
rcl/timer.h
"
23
#include "rcutils/stdatomic_helper.h"
24
25
struct
rcl_timer_impl_s
26
{
27
// The clock providing time.
28
rcl_clock_t
* clock;
29
// The associated context.
30
rcl_context_t
* context;
31
// A guard condition used to wake the associated wait set, either when
32
// ROSTime causes the timer to expire or when the timer is reset.
33
rcl_guard_condition_t
guard_condition;
34
// The user supplied callback.
35
atomic_uintptr_t callback;
36
// optionally user supplied data which will be passed into the callback
37
atomic_uintptr_t callback_data;
38
39
// This is a duration in nanoseconds, which is initialized as int64_t
40
// to be used for internal time calculation.
41
atomic_int_least64_t period;
42
// This is a time in nanoseconds since an unspecified time.
43
atomic_int_least64_t last_call_time;
44
// This is a time in nanoseconds since an unspecified time.
45
atomic_int_least64_t next_call_time;
46
// Credit for time elapsed before ROS time is activated or deactivated.
47
atomic_int_least64_t time_credit;
48
// A flag which indicates if the timer is canceled.
49
atomic_bool canceled;
50
// The user supplied allocator.
51
rcl_allocator_t
allocator;
52
// The user supplied on reset callback data.
53
rcl_timer_on_reset_callback_data_t
reset_callback_data;
54
bool
in_use_by_waitset;
55
};
56
#endif
// RCL__TIMER_IMPL_H_
allocator.h
rcl_allocator_t
rcutils_allocator_t rcl_allocator_t
Encapsulation of an allocator.
Definition:
allocator.h:31
rcl_clock_s
Encapsulation of a time source.
Definition:
time.h:141
rcl_context_s
Encapsulates the non-global state of an init/shutdown cycle.
Definition:
context.h:117
rcl_guard_condition_s
Handle for a rcl guard condition.
Definition:
guard_condition.h:38
rcl_timer_impl_s
Definition:
timer_impl.h:26
rcl_timer_on_reset_callback_data_s
Structure which encapsulates the on reset callback data.
Definition:
timer.h:49
time.h
timer.h
Generated by
1.9.1