SMACC2
Loading...
Searching...
No Matches
smacc2_client_library
cl_ros2_timer
include
cl_ros2_timer
cl_ros2_timer.hpp
Go to the documentation of this file.
1
// Copyright 2025 Robosoft Inc.
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
#pragma once
16
17
#include <chrono>
18
#include <optional>
19
#include <
smacc2/smacc.hpp
>
20
21
#include <
cl_ros2_timer/components/cp_timer_listener_1.hpp
>
22
#include <
smacc2/client_core_components/cp_ros2_timer.hpp
>
23
24
namespace
cl_ros2_timer
25
{
26
template
<
typename
TSource,
typename
TOrthogonal>
27
struct
EvTimer
:
sc::event
<EvTimer<TSource, TOrthogonal>>
28
{
29
};
30
31
class
ClRos2Timer
:
public
smacc2::ISmaccClient
32
{
33
public
:
34
ClRos2Timer
(rclcpp::Duration duration,
bool
oneshot =
false
);
35
36
virtual
~ClRos2Timer
();
37
38
// Component-based initialization
39
template
<
typename
TOrthogonal,
typename
TClient>
40
void
onComponentInitialization
()
41
{
42
// Create the core timer component
43
this->
createComponent<smacc2::client_core_components::CpRos2Timer, TOrthogonal, ClRos2Timer>
(
44
duration_
,
oneshot_
);
45
46
// Create the timer listener component that requires CpRos2Timer
47
this->
createComponent<cl_ros2_timer::components::CpTimerListener1, TOrthogonal, ClRos2Timer>
();
48
}
49
50
private
:
51
rclcpp::Duration
duration_
;
52
bool
oneshot_
;
53
};
54
}
// namespace cl_ros2_timer
boost::statechart::event
cl_ros2_timer::ClRos2Timer
Definition
cl_ros2_timer.hpp:32
cl_ros2_timer::ClRos2Timer::duration_
rclcpp::Duration duration_
Definition
cl_ros2_timer.hpp:51
cl_ros2_timer::ClRos2Timer::onComponentInitialization
void onComponentInitialization()
Definition
cl_ros2_timer.hpp:40
cl_ros2_timer::ClRos2Timer::~ClRos2Timer
virtual ~ClRos2Timer()
Definition
cl_ros2_timer.cpp:24
cl_ros2_timer::ClRos2Timer::ClRos2Timer
ClRos2Timer(rclcpp::Duration duration, bool oneshot=false)
Definition
cl_ros2_timer.cpp:19
cl_ros2_timer::ClRos2Timer::oneshot_
bool oneshot_
Definition
cl_ros2_timer.hpp:52
smacc2::ISmaccClient
Definition
smacc_client.hpp:45
smacc2::ISmaccClient::createComponent
SmaccComponentType * createComponent(TArgs... targs)
Definition
smacc_client_impl.hpp:133
cp_ros2_timer.hpp
cp_timer_listener_1.hpp
cl_ros2_timer
Definition
cl_ros2_timer.hpp:25
smacc.hpp
cl_ros2_timer::EvTimer
Definition
cp_timer_listener_1.hpp:24
Generated by
1.12.0