Skip to content

Commit 941af4d

Browse files
jacobperronesteve
andauthored
Rename rcljava_common cpp headers to have .hpp suffix (#93)
* Fix service and action interface generation Before, we were not generating code for the messages and services that make up service and action interfaces. Due to issues with duplicate definitions caused by instantiating the msg.cpp.em template multiple times, I've opted to generate separate files for each service, action, and the interfaces that they are made of. This is similar to what we are doing with the generated Java code. I've added a test confirming that generated service code can be used. Adding a test for actions is difficult at the moment due to a circular dependency with action_msgs. Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Add missing header include Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Rename top level generated cpp file This avoids name clashing with other generated files. Similar to what we do with generated Java files. Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Fix JNI name mangling function so it works for service and action subtypes For example, 'example_interfaces/srv/AddTwoInts_Request' should be mangled to 'example_1interfaces_srv_AddTwoInts_1Request'. Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Remove vestigal references to jni_package_name Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Add comment about action and service headers Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Simplify include logic Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Rename cpp headers to have .hpp suffix Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Update files to reflect new header suffix This resolves a cppcheck linter error complaining about "is invalid C code". Changing the suffix causes cppcheck to treat the files as C++ code. Signed-off-by: Jacob Perron <jacob@openrobotics.org> Co-authored-by: Esteve Fernandez <esteve@apache.org>
1 parent bf1e4b6 commit 941af4d

16 files changed

+34
-34
lines changed

rcljava/src/main/cpp/org_ros2_rcljava_RCLJava.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
#include "rmw/rmw.h"
2626
#include "rosidl_generator_c/message_type_support_struct.h"
2727

28-
#include "rcljava_common/exceptions.h"
29-
#include "rcljava_common/signatures.h"
28+
#include "rcljava_common/exceptions.hpp"
29+
#include "rcljava_common/signatures.hpp"
3030

3131
#include "org_ros2_rcljava_RCLJava.h"
3232

rcljava/src/main/cpp/org_ros2_rcljava_Time.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "rcl/error_handling.h"
2020
#include "rcl/rcl.h"
2121

22-
#include "rcljava_common/exceptions.h"
22+
#include "rcljava_common/exceptions.hpp"
2323

2424
#include "org_ros2_rcljava_Time.h"
2525

rcljava/src/main/cpp/org_ros2_rcljava_client_ClientImpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
#include "rmw/rmw.h"
2525
#include "rosidl_generator_c/message_type_support_struct.h"
2626

27-
#include "rcljava_common/exceptions.h"
28-
#include "rcljava_common/signatures.h"
27+
#include "rcljava_common/exceptions.hpp"
28+
#include "rcljava_common/signatures.hpp"
2929

3030
#include "org_ros2_rcljava_client_ClientImpl.h"
3131

rcljava/src/main/cpp/org_ros2_rcljava_contexts_ContextImpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
#include "rcl/error_handling.h"
2121
#include "rcl/init.h"
2222

23-
#include "rcljava_common/exceptions.h"
24-
#include "rcljava_common/signatures.h"
23+
#include "rcljava_common/exceptions.hpp"
24+
#include "rcljava_common/signatures.hpp"
2525

2626
#include "org_ros2_rcljava_contexts_ContextImpl.h"
2727

rcljava/src/main/cpp/org_ros2_rcljava_executors_BaseExecutor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
#include "rmw/rmw.h"
2626
#include "rosidl_generator_c/message_type_support_struct.h"
2727

28-
#include "rcljava_common/exceptions.h"
29-
#include "rcljava_common/signatures.h"
28+
#include "rcljava_common/exceptions.hpp"
29+
#include "rcljava_common/signatures.hpp"
3030

3131
#include "org_ros2_rcljava_executors_BaseExecutor.h"
3232

rcljava/src/main/cpp/org_ros2_rcljava_node_NodeImpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
#include "rmw/rmw.h"
2525
#include "rosidl_generator_c/message_type_support_struct.h"
2626

27-
#include "rcljava_common/exceptions.h"
28-
#include "rcljava_common/signatures.h"
27+
#include "rcljava_common/exceptions.hpp"
28+
#include "rcljava_common/signatures.hpp"
2929

3030
#include "org_ros2_rcljava_node_NodeImpl.h"
3131

rcljava/src/main/cpp/org_ros2_rcljava_publisher_PublisherImpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
#include "rcl/rcl.h"
2525
#include "rmw/rmw.h"
2626

27-
#include "rcljava_common/exceptions.h"
28-
#include "rcljava_common/signatures.h"
27+
#include "rcljava_common/exceptions.hpp"
28+
#include "rcljava_common/signatures.hpp"
2929

3030
#include "org_ros2_rcljava_publisher_PublisherImpl.h"
3131

rcljava/src/main/cpp/org_ros2_rcljava_service_ServiceImpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
#include "rmw/rmw.h"
2525
#include "rosidl_generator_c/message_type_support_struct.h"
2626

27-
#include "rcljava_common/exceptions.h"
28-
#include "rcljava_common/signatures.h"
27+
#include "rcljava_common/exceptions.hpp"
28+
#include "rcljava_common/signatures.hpp"
2929

3030
#include "org_ros2_rcljava_service_ServiceImpl.h"
3131

rcljava/src/main/cpp/org_ros2_rcljava_subscription_SubscriptionImpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
#include "rmw/rmw.h"
2525
#include "rosidl_generator_c/message_type_support_struct.h"
2626

27-
#include "rcljava_common/exceptions.h"
28-
#include "rcljava_common/signatures.h"
27+
#include "rcljava_common/exceptions.hpp"
28+
#include "rcljava_common/signatures.hpp"
2929

3030
#include "org_ros2_rcljava_subscription_SubscriptionImpl.h"
3131

rcljava/src/main/cpp/org_ros2_rcljava_time_Clock.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
#include "rcl/error_handling.h"
2121
#include "rcl/time.h"
2222

23-
#include "rcljava_common/exceptions.h"
24-
#include "rcljava_common/signatures.h"
23+
#include "rcljava_common/exceptions.hpp"
24+
#include "rcljava_common/signatures.hpp"
2525

2626
#include "org_ros2_rcljava_time_Clock.h"
2727

0 commit comments

Comments
 (0)