Skip to content

Commit 1a592d6

Browse files
committed
(fix) uncrustify
1 parent 71a70f6 commit 1a592d6

18 files changed

+415
-386
lines changed

rclcpp_lifecycle/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,9 @@ endmacro()
6565

6666
call_for_each_rmw_implementation(targets GENERATE_DEFAULT)
6767

68+
if(BUILD_TESTING)
69+
find_package(ament_lint_auto REQUIRED)
70+
ament_lint_auto_find_test_dependencies()
71+
endif()
72+
6873
ament_package()

rclcpp_lifecycle/include/rcl_lifecycle/default_state_machine.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef RCL__DEFAULT_STATE_MACHINE_H_
16-
#define RCL__DEFAULT_STATE_MACHINE_H_
15+
#ifndef RCL_LIFECYCLE__DEFAULT_STATE_MACHINE_H_
16+
#define RCL_LIFECYCLE__DEFAULT_STATE_MACHINE_H_
1717

1818
#include <rcl_lifecycle/visibility_control.h>
1919

@@ -39,4 +39,4 @@ const rcl_state_t LIFECYCLE_EXPORT rcl_state_errorprocessing = {"errorprocessing
3939
}
4040
#endif // extern "C"
4141

42-
#endif // RCL__DEFAULT_STATE_MACHINE_H_
42+
#endif // RCL_LIFECYCLE__DEFAULT_STATE_MACHINE_H_

rclcpp_lifecycle/include/rcl_lifecycle/lifecycle_state.h

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef RCL__LIFECYCLE_STATE_H_
16-
#define RCL__LIFECYCLE_STATE_H_
15+
#ifndef RCL_LIFECYCLE__LIFECYCLE_STATE_H_
16+
#define RCL_LIFECYCLE__LIFECYCLE_STATE_H_
1717

1818
#if __cplusplus
1919
extern "C"
@@ -36,7 +36,7 @@ typedef int bool;
3636
*/
3737
typedef struct LIFECYCLE_EXPORT _rcl_state_t
3838
{
39-
const char* label;
39+
const char * label;
4040
unsigned int index;
4141
} rcl_state_t;
4242

@@ -50,9 +50,9 @@ typedef struct LIFECYCLE_EXPORT _rcl_state_t
5050
typedef struct LIFECYCLE_EXPORT _rcl_state_transition_t
5151
{
5252
rcl_state_t transition_state;
53-
void* callback;
54-
rcl_state_t* start;
55-
rcl_state_t* goal;
53+
void * callback;
54+
rcl_state_t * start;
55+
rcl_state_t * goal;
5656
} rcl_state_transition_t;
5757

5858
/**
@@ -65,7 +65,7 @@ typedef struct LIFECYCLE_EXPORT _rcl_state_transition_t
6565
*/
6666
typedef struct LIFECYCLE_EXPORT _rcl_state_machine_t
6767
{
68-
const rcl_state_t* current_state;
68+
const rcl_state_t * current_state;
6969
rcl_transition_map_t transition_map;
7070
} rcl_state_machine_t;
7171

@@ -79,22 +79,26 @@ typedef struct LIFECYCLE_EXPORT _rcl_state_machine_t
7979
* NULL if not available
8080
*/
8181
LIFECYCLE_EXPORT
82-
const rcl_state_transition_t*
83-
rcl_is_valid_transition_by_index(rcl_state_machine_t* state_machine, unsigned int transition_index);
82+
const rcl_state_transition_t *
83+
rcl_is_valid_transition_by_index(rcl_state_machine_t * state_machine,
84+
unsigned int transition_index);
8485
LIFECYCLE_EXPORT
85-
const rcl_state_transition_t*
86-
rcl_is_valid_transition_by_label(rcl_state_machine_t* state_machine, const char* transition_label);
86+
const rcl_state_transition_t *
87+
rcl_is_valid_transition_by_label(rcl_state_machine_t * state_machine,
88+
const char * transition_label);
8789

8890
LIFECYCLE_EXPORT
89-
const rcl_state_transition_t*
90-
rcl_get_registered_transition_by_index(rcl_state_machine_t* state_machine, unsigned int transition_state_index);
91+
const rcl_state_transition_t *
92+
rcl_get_registered_transition_by_index(rcl_state_machine_t * state_machine,
93+
unsigned int transition_state_index);
9194
LIFECYCLE_EXPORT
92-
const rcl_state_transition_t*
93-
rcl_get_registered_transition_by_label(rcl_state_machine_t* state_machine, const char* transition_state_label);
95+
const rcl_state_transition_t *
96+
rcl_get_registered_transition_by_label(rcl_state_machine_t * state_machine,
97+
const char * transition_state_label);
9498

9599
LIFECYCLE_EXPORT
96100
rcl_state_t
97-
rcl_create_state(unsigned int state, char* label);
101+
rcl_create_state(unsigned int state, char * label);
98102

99103
LIFECYCLE_EXPORT
100104
rcl_state_transition_t
@@ -106,14 +110,16 @@ rcl_get_default_state_machine();
106110

107111
LIFECYCLE_EXPORT
108112
void
109-
rcl_register_callback(rcl_state_machine_t* state_machine, unsigned int state_index, unsigned int transition_index, bool(*fcn)(void));
113+
rcl_register_callback(rcl_state_machine_t * state_machine,
114+
unsigned int state_index, unsigned int transition_index, bool (* fcn)(void));
110115

111116
LIFECYCLE_EXPORT
112117
bool
113-
rcl_invoke_transition(rcl_state_machine_t* state_machine, rcl_state_t transition_index);
118+
rcl_invoke_transition(rcl_state_machine_t * state_machine,
119+
rcl_state_t transition_index);
114120

115121
#if __cplusplus
116122
}
117123
#endif // extern "C"
118124

119-
#endif // RCL__LIFECYCLE_STATE_H
125+
#endif // RCL_LIFECYCLE__LIFECYCLE_STATE_H_

rclcpp_lifecycle/include/rcl_lifecycle/transition_map.h

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// limitations under the License.
1414

1515

16-
#ifndef RCL__TRANSITION_MAP_H_
17-
#define RCL__TRANSITION_MAP_H_
16+
#ifndef RCL_LIFECYCLE__TRANSITION_MAP_H_
17+
#define RCL_LIFECYCLE__TRANSITION_MAP_H_
1818

1919
#if __cplusplus
2020
extern "C"
@@ -32,7 +32,7 @@ typedef struct _rcl_state_transition_t rcl_state_transition_t;
3232
*/
3333
typedef struct LIFECYCLE_EXPORT _transition_array
3434
{
35-
rcl_state_transition_t* transitions;
35+
rcl_state_transition_t * transitions;
3636
unsigned int size;
3737
} rcl_transition_array_t;
3838

@@ -42,17 +42,18 @@ typedef struct LIFECYCLE_EXPORT _transition_array
4242
*/
4343
typedef struct LIFECYCLE_EXPORT _map
4444
{
45-
//rcl_state_t* state_index;
46-
// associative array between primary state and their respective transitions
45+
// associative array between primary state
46+
// and their respective transitions
4747
// 1 ps -> 1 transition_array
48-
rcl_state_t* primary_states;
49-
rcl_transition_array_t* transition_arrays;
48+
rcl_state_t * primary_states;
49+
rcl_transition_array_t * transition_arrays;
5050
unsigned int size;
5151
} rcl_transition_map_t;
5252

5353
LIFECYCLE_EXPORT
5454
void
55-
rcl_register_primary_state(rcl_transition_map_t* m, rcl_state_t primary_state);
55+
rcl_register_primary_state(rcl_transition_map_t * m,
56+
rcl_state_t primary_state);
5657

5758
/**
5859
* @brief appends a transition in a map
@@ -61,7 +62,8 @@ rcl_register_primary_state(rcl_transition_map_t* m, rcl_state_t primary_state);
6162
*/
6263
LIFECYCLE_EXPORT
6364
void
64-
rcl_register_transition_by_state(rcl_transition_map_t* m, rcl_state_t start, rcl_state_t goal, rcl_state_transition_t transition);
65+
rcl_register_transition_by_state(rcl_transition_map_t * m,
66+
rcl_state_t start, rcl_state_t goal, rcl_state_transition_t transition);
6567

6668
/**
6769
* @brief appends a transition in a map
@@ -70,7 +72,8 @@ rcl_register_transition_by_state(rcl_transition_map_t* m, rcl_state_t start, rcl
7072
*/
7173
LIFECYCLE_EXPORT
7274
void
73-
rcl_register_transition_by_label(rcl_transition_map_t* m, const char* start_label, const char* goal_label, rcl_state_transition_t transition);
75+
rcl_register_transition_by_label(rcl_transition_map_t * m,
76+
const char * start_label, const char * goal_label, rcl_state_transition_t transition);
7477

7578
/**
7679
* @brief appends a transition in a map
@@ -79,50 +82,55 @@ rcl_register_transition_by_label(rcl_transition_map_t* m, const char* start_labe
7982
*/
8083
LIFECYCLE_EXPORT
8184
void
82-
rcl_register_transition_by_index(rcl_transition_map_t* m, unsigned int start_index, unsigned int goal_index, rcl_state_transition_t transition);
85+
rcl_register_transition_by_index(rcl_transition_map_t * m,
86+
unsigned int start_index, unsigned int goal_index, rcl_state_transition_t transition);
8387

8488
/**
8589
* @brief gets the registered primary state based on a label
8690
* @return primary state pointer, NULL if not found
8791
*/
8892
LIFECYCLE_EXPORT
89-
rcl_state_t*
90-
rcl_get_primary_state_by_label(rcl_transition_map_t* m, const char* label);
93+
rcl_state_t *
94+
rcl_get_primary_state_by_label(rcl_transition_map_t * m,
95+
const char * label);
9196
/**
9297
* @brief gets the registered primary state based on a index
9398
* @return primary state pointer, NULL if not found
9499
*/
95100
LIFECYCLE_EXPORT
96-
rcl_state_t*
97-
rcl_get_primary_state_by_index(rcl_transition_map_t* m, unsigned int index);
101+
rcl_state_t *
102+
rcl_get_primary_state_by_index(rcl_transition_map_t * m,
103+
unsigned int index);
98104

99105
/**
100106
* @brief gets all transitions based on a label
101107
* label is supposed to come from a rcl_state_t object
102108
*/
103109
LIFECYCLE_EXPORT
104-
rcl_transition_array_t*
105-
rcl_get_transitions_by_label(rcl_transition_map_t* m, const char* label);
110+
rcl_transition_array_t *
111+
rcl_get_transitions_by_label(rcl_transition_map_t * m,
112+
const char * label);
106113
/**
107114
* @brief gets all transitions based on a state
108115
* state is supposed to come from a rcl_state_t object
109116
*/
110117
LIFECYCLE_EXPORT
111-
rcl_transition_array_t*
112-
rcl_get_transitions_by_index(rcl_transition_map_t* m, unsigned int index);
118+
rcl_transition_array_t *
119+
rcl_get_transitions_by_index(rcl_transition_map_t * m,
120+
unsigned int index);
113121

114122
/**
115123
* @brief helper functions to print
116124
*/
117125
LIFECYCLE_EXPORT
118126
void
119-
rcl_print_transition_array(const rcl_transition_array_t* transition_array);
127+
rcl_print_transition_array(const rcl_transition_array_t * transition_array);
120128
LIFECYCLE_EXPORT
121129
void
122-
rcl_print_transition_map(const rcl_transition_map_t* m);
130+
rcl_print_transition_map(const rcl_transition_map_t * m);
123131

124132
#if __cplusplus
125133
}
126134
#endif
127135

128-
#endif // RCL__TRANSITION_MAP_H_
136+
#endif // RCL_LIFECYCLE__TRANSITION_MAP_H_

rclcpp_lifecycle/include/rcl_lifecycle/visibility_control.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef RCL__LIFECYCLE_VISIBILITY_CONTROL_H_
16-
#define RCL__LIFECYCLE_VISIBILITY_CONTROL_H_
15+
#ifndef RCL_LIFECYCLE__VISIBILITY_CONTROL_H_
16+
#define RCL_LIFECYCLE__VISIBILITY_CONTROL_H_
1717

1818
#ifdef _WIN32
19-
#define shared_EXPORTS 1
20-
#ifdef shared_EXPORTS
21-
#define LIFECYCLE_EXPORT __declspec(dllexport)
22-
#else
23-
#define LIFECYCLE_EXPORT __declspec(dllimport)
24-
#endif
19+
#define shared_EXPORTS 1
20+
#ifdef shared_EXPORTS
21+
#define LIFECYCLE_EXPORT __declspec(dllexport)
22+
#else
23+
#define LIFECYCLE_EXPORT __declspec(dllimport)
24+
#endif
2525
#else
26-
#define LIFECYCLE_EXPORT
26+
#define LIFECYCLE_EXPORT
2727
#endif
2828

29-
#endif
29+
#endif // RCL_LIFECYCLE__VISIBILITY_CONTROL_H_

rclcpp_lifecycle/include/rclcpp_lifecycle/lifecycle_executor.hpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef RCLCPP__LIFECYCLE_EXECUTOR_HPP_
16-
#define RCLCPP__LIFECYCLE_EXECUTOR_HPP_
15+
#ifndef RCLCPP_LIFECYCLE__LIFECYCLE_EXECUTOR_HPP_
16+
#define RCLCPP_LIFECYCLE__LIFECYCLE_EXECUTOR_HPP_
17+
18+
#include <memory>
1719

1820
#include "rclcpp/executors/single_threaded_executor.hpp"
1921
#include "rclcpp/type_traits/is_manageable_node.hpp"
@@ -26,21 +28,18 @@ namespace executors
2628

2729
class LifecycleExecutor : public single_threaded_executor::SingleThreadedExecutor
2830
{
29-
// using Node = rclcpp::node::Node;
30-
3131
public:
32-
33-
explicit LifecycleExecutor(const executor::ExecutorArgs & args = executor::create_default_executor_arguments())
34-
: SingleThreadedExecutor(args)
32+
explicit LifecycleExecutor(const executor::ExecutorArgs & args =
33+
executor::create_default_executor_arguments())
34+
: SingleThreadedExecutor(args)
3535
{}
3636

37-
//RCLCPP_PUBLIC
3837
template<class T, typename std::enable_if<is_manageable_node<T>::value>::type>
3938
void
4039
add_node(std::shared_ptr<T> node_ptr, bool notify = true);
4140
};
4241

43-
} // namespace executor
44-
} // namespace rclcpp
42+
} // namespace executors
43+
} // namespace rclcpp
4544

46-
#endif
45+
#endif // RCLCPP_LIFECYCLE__LIFECYCLE_EXECUTOR_HPP_

0 commit comments

Comments
 (0)