Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename rcljava_common cpp headers to have .hpp suffix #93

Merged
merged 10 commits into from
Mar 18, 2020

Conversation

jacobperron
Copy link
Contributor

@jacobperron jacobperron commented Mar 9, 2020

Builds on top of (and depends on) #76. Opening for visibility.

Resolve a cppcheck error by changing the suffix of rcljava_common headers to .hpp. Before, cppcheck was assuming that the code was C, rather than C++.

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>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
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>
…types

For example, 'example_interfaces/srv/AddTwoInts_Request' should be mangled to 'example_1interfaces_srv_AddTwoInts_1Request'.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
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>
@jacobperron jacobperron added the bug label Mar 9, 2020
@jacobperron jacobperron changed the title Rename rcljava_comomn cpp headers to have .hpp suffix Rename rcljava_common cpp headers to have .hpp suffix Mar 9, 2020
@jacobperron jacobperron self-assigned this Mar 10, 2020
@jacobperron jacobperron mentioned this pull request Mar 10, 2020
25 tasks
Copy link
Member

@esteve esteve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jacobperron thanks!

@esteve esteve merged commit 941af4d into dashing Mar 18, 2020
@esteve esteve deleted the jacob/fix_cppcheck_error branch March 18, 2020 15:41
jacobperron added a commit that referenced this pull request May 17, 2021
* 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>
jacobperron added a commit that referenced this pull request May 17, 2021
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants