rclcpp_lifecycle
master
C++ ROS Lifecycle Library API
include
rclcpp_lifecycle
state.hpp
Go to the documentation of this file.
1
// Copyright 2016 Open Source Robotics Foundation, 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
#ifndef RCLCPP_LIFECYCLE__STATE_HPP_
16
#define RCLCPP_LIFECYCLE__STATE_HPP_
17
18
#include <string>
19
20
#include "
rclcpp_lifecycle/visibility_control.h
"
21
22
#include "rcutils/allocator.h"
23
24
// forward declare rcl_state_t
25
typedef
struct
rcl_lifecycle_state_t
rcl_lifecycle_state_t
;
26
27
namespace
rclcpp_lifecycle
28
{
29
31
34
class
State
35
{
36
public
:
37
RCLCPP_LIFECYCLE_PUBLIC
38
explicit
State
(rcutils_allocator_t allocator = rcutils_get_default_allocator());
39
41
46
RCLCPP_LIFECYCLE_PUBLIC
47
State
(
48
uint8_t
id
,
49
const
std::string
&
label
,
50
rcutils_allocator_t allocator = rcutils_get_default_allocator());
51
53
57
RCLCPP_LIFECYCLE_PUBLIC
58
explicit
State
(
59
const
rcl_lifecycle_state_t
* rcl_lifecycle_state_handle,
60
rcutils_allocator_t allocator = rcutils_get_default_allocator());
61
62
RCLCPP_LIFECYCLE_PUBLIC
63
State
(
const
State
& rhs);
64
65
RCLCPP_LIFECYCLE_PUBLIC
66
virtual
~State
();
67
68
RCLCPP_LIFECYCLE_PUBLIC
69
State
&
operator=
(
const
State
& rhs);
70
72
75
RCLCPP_LIFECYCLE_PUBLIC
76
uint8_t
77
id
()
const
;
78
80
83
RCLCPP_LIFECYCLE_PUBLIC
84
std::string
85
label
()
const
;
86
87
protected
:
88
RCLCPP_LIFECYCLE_PUBLIC
89
void
90
reset
() noexcept;
91
92
rcutils_allocator_t
allocator_
;
93
94
bool
owns_rcl_state_handle_
;
95
96
rcl_lifecycle_state_t
*
state_handle_
;
97
};
98
99
}
// namespace rclcpp_lifecycle
100
#endif // RCLCPP_LIFECYCLE__STATE_HPP_
std::string
rcl_lifecycle_state_t
rclcpp_lifecycle::State::id
uint8_t id() const
Return the id.
rclcpp_lifecycle::State::operator=
State & operator=(const State &rhs)
rclcpp_lifecycle::State::owns_rcl_state_handle_
bool owns_rcl_state_handle_
Definition:
state.hpp:94
rclcpp_lifecycle::State::State
State(rcutils_allocator_t allocator=rcutils_get_default_allocator())
rclcpp_lifecycle::State
Abstract class for the Lifecycle's states.
Definition:
state.hpp:34
rclcpp_lifecycle::State::allocator_
rcutils_allocator_t allocator_
Definition:
state.hpp:92
rclcpp_lifecycle
Definition:
lifecycle_node.hpp:92
rclcpp_lifecycle::State::state_handle_
rcl_lifecycle_state_t * state_handle_
Definition:
state.hpp:96
visibility_control.h
rclcpp_lifecycle::State::reset
void reset() noexcept
rclcpp_lifecycle::State::~State
virtual ~State()
RCLCPP_LIFECYCLE_PUBLIC
#define RCLCPP_LIFECYCLE_PUBLIC
Definition:
visibility_control.h:50
rclcpp_lifecycle::State::label
std::string label() const
Return the label.
Generated by
1.8.17