Skip to content

Rename rcljava_common cpp headers to have .hpp suffix - #93

Merged
esteve merged 10 commits into
dashingfrom
jacob/fix_cppcheck_error
Mar 18, 2020
Merged

Rename rcljava_common cpp headers to have .hpp suffix#93
esteve merged 10 commits into
dashingfrom
jacob/fix_cppcheck_error

Conversation

@jacobperron

@jacobperronjacobperron commented Mar 9, 2020

Copy link
Copy Markdown
Contributor

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>
@jacobperronjacobperron changed the title Rename rcljava_comomn cpp headers to have .hpp suffixRename rcljava_common cpp headers to have .hpp suffixMar 9, 2020
@jacobperronjacobperron self-assigned this Mar 10, 2020
@jacobperronjacobperron mentioned this pull request Mar 10, 2020
25 tasks

@esteveesteve left a comment

Copy link
Copy Markdown
Member

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 dashingMar 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 freeto 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

@jacobperron@esteve