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

iox-1391 Move vocabulary types to separate module #1791

Merged

Conversation

mossmaurice
Copy link
Contributor

@mossmaurice mossmaurice commented Nov 16, 2022

Pre-Review Checklist for the PR Author

  1. Code follows the coding style of CONTRIBUTING.md
  2. Tests follow the best practice for testing
  3. Changelog updated in the unreleased section including API breaking changes
  4. Branch follows the naming format (iox-123-this-is-a-branch)
  5. Commits messages are according to this guideline
  6. Update the PR title
    • Follow the same conventions as for commit messages
    • Link to the relevant issue
  7. Relevant issues are linked
  8. Add sensible notes for the reviewer
  9. All checks have passed (except task-list-completed)
  10. All touched (C/C++) source code files from iceoryx_hoofs are added to ./clang-tidy-diff-scans.txt
  11. Assign PR to reviewer

Notes for Reviewer

  • Move optional, expected, variant and string to their own module vocabulary types
    • Remove cxx namespace for those four classes
  • Move is_cxx_string type trait out of the general type_traits.hpp into its own file

Checklist for the PR Reviewer

  • Commits are properly organized and messages are according to the guideline
  • Code according to our coding style and naming conventions
  • Unit tests have been written for new behavior
  • Public API changes are documented via doxygen
  • Copyright owner are updated in the changed files
  • All touched (C/C++) source code files from iceoryx_hoofs have been added to ./clang-tidy-diff-scans.txt
  • PR title describes the changes

Post-review Checklist for the PR Author

  1. All open points are addressed and tracked via issues

References

@mossmaurice mossmaurice added the refactoring Refactor code without adding features label Nov 16, 2022
@mossmaurice mossmaurice self-assigned this Nov 16, 2022
@mossmaurice mossmaurice force-pushed the iox-1391-move-vocabulary-types branch from aa126fe to ef4a63e Compare November 16, 2022 08:40
@codecov
Copy link

codecov bot commented Nov 16, 2022

Codecov Report

Merging #1791 (9a8f14d) into master (f2a4258) will decrease coverage by 0.01%.
The diff coverage is 78.18%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1791      +/-   ##
==========================================
- Coverage   75.63%   75.61%   -0.02%     
==========================================
  Files         375      375              
  Lines       14578    14569       -9     
  Branches     2064     2064              
==========================================
- Hits        11026    11017       -9     
+ Misses       2922     2921       -1     
- Partials      630      631       +1     
Flag Coverage Δ
unittests 75.28% <78.18%> (-0.02%) ⬇️
unittests_timing 15.36% <9.21%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...st/include/iceoryx_dust/internal/cli/arguments.inl 0.00% <0.00%> (ø)
...de/iceoryx_dust/internal/cli/option_definition.hpp 0.00% <ø> (ø)
...clude/iceoryx_dust/internal/cli/option_manager.inl 0.00% <0.00%> (ø)
.../include/iceoryx_dust/posix_wrapper/named_pipe.hpp 100.00% <ø> (ø)
...lude/iceoryx_dust/posix_wrapper/signal_watcher.hpp 0.00% <ø> (ø)
iceoryx_dust/source/cli/command_line_parser.cpp 0.00% <0.00%> (ø)
iceoryx_dust/source/cli/option_definition.cpp 0.00% <0.00%> (ø)
iceoryx_dust/source/cli/option_manager.cpp 0.00% <0.00%> (ø)
...ryx_hoofs/concurrent/resizeable_lockfree_queue.hpp 100.00% <ø> (ø)
...eoryx_hoofs/include/iceoryx_hoofs/cxx/helplets.hpp 96.66% <ø> (ø)
... and 159 more

@mossmaurice mossmaurice force-pushed the iox-1391-move-vocabulary-types branch 2 times, most recently from 097456a to b6b29f0 Compare November 16, 2022 09:27
@mossmaurice mossmaurice force-pushed the iox-1391-move-vocabulary-types branch from b6b29f0 to 2f01740 Compare November 16, 2022 13:53
@mossmaurice mossmaurice force-pushed the iox-1391-move-vocabulary-types branch 2 times, most recently from a19aebc to 1276091 Compare November 19, 2022 18:13
@mossmaurice mossmaurice force-pushed the iox-1391-move-vocabulary-types branch 4 times, most recently from 300b9a9 to 48f45f1 Compare December 20, 2022 17:17
@mossmaurice mossmaurice requested a review from dkroenke December 20, 2022 17:41
@mossmaurice mossmaurice force-pushed the iox-1391-move-vocabulary-types branch from eb6bf6f to 528df20 Compare January 2, 2023 11:31
@mossmaurice mossmaurice force-pushed the iox-1391-move-vocabulary-types branch from 2ab0936 to 431a94e Compare January 2, 2023 13:03
Signed-off-by: Simon Hoinkis <simon.hoinkis@apex.ai>
…string' to vocabulary module

Signed-off-by: Simon Hoinkis <simon.hoinkis@apex.ai>
…ected', 'variant' and 'string''

Signed-off-by: Simon Hoinkis <simon.hoinkis@apex.ai>
…hanges

Signed-off-by: Simon Hoinkis <simon.hoinkis@apex.ai>
…ectory

Signed-off-by: Simon Hoinkis <simon.hoinkis@apex.ai>
… fix some typos

Signed-off-by: Simon Hoinkis <simon.hoinkis@apex.ai>
…tform'

Signed-off-by: Simon Hoinkis <simon.hoinkis@apex.ai>
@elBoberido
Copy link
Member

Please fix the links to the expected and optional in how-optional-and-error-values-are-returned-in-iceoryx.md

Signed-off-by: Simon Hoinkis <simon.hoinkis@apex.ai>
@mossmaurice
Copy link
Contributor Author

@elBoberido

Please fix the links to the expected and optional in how-optional-and-error-values-are-returned-in-iceoryx.md

Good catch, done ✔️

@mossmaurice mossmaurice force-pushed the iox-1391-move-vocabulary-types branch from d972b3d to e3cff34 Compare January 10, 2023 20:18
…ary namespace and add implicit includes

Signed-off-by: Simon Hoinkis <simon.hoinkis@apex.ai>
Copy link
Contributor

@FerdinandSpitzschnueffler FerdinandSpitzschnueffler left a comment

Choose a reason for hiding this comment

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

Looks good but please update ./clang-tidy-diff-scans.txt.

…tidy scan

Signed-off-by: Simon Hoinkis <simon.hoinkis@apex.ai>
Copy link
Member

@elBoberido elBoberido left a comment

Choose a reason for hiding this comment

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

Half way through :)

Please do a git checkout master iceoryx_posh and make it compile. This ensures that all symbols are available via the legacy includes.

In general I think having only one base namespace makes the code more readable.

Copy link
Member

@elBoberido elBoberido left a comment

Choose a reason for hiding this comment

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

Second half done :)

@mossmaurice
Copy link
Contributor Author

mossmaurice commented Jan 11, 2023

@elBoberido Thanks for the hint!

Please do a git checkout master iceoryx_posh and make it compile. This ensures that all symbols are available via the legacy includes.

This revealed all the places in iceoryx_posh where we implicitly including one of those files 🤦 😁 I'll fix those on a separate PR.

Copy link
Member

@elBoberido elBoberido left a comment

Choose a reason for hiding this comment

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

Looks good. Almost there

namespace iox
{
/// @todo iox-#1593 Deprecate include
/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/expected.hpp' instead")]]
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering a bit when this deprecation warning would be shown. When the cxx namespace will be used? In this case the deprecation message would be wrong

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@elBoberido I tried this and had a look very early on when we started with #1391. This will only deprecated what is in exactly this very namespace definition and not everything in cxx :D

Copy link
Member

Choose a reason for hiding this comment

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

Okay, tried it out. Deprecating namespaces is a C++17 feature and would indeed print it everywhere where the namespace is used. I think we have to add this comment to the respective using directive :(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@elBoberido Odd, I tried that 🤔 According to cppref it's C++14: https://en.cppreference.com/w/cpp/language/attributes/deprecated

Copy link
Contributor Author

@mossmaurice mossmaurice Jan 11, 2023

Choose a reason for hiding this comment

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

Ah, I might know why it didn't work for you. I just put the comment above because it's so long.. IIRC you have to write:

namespace [[deprecated]] foo
{
  // bla..
}

Copy link
Member

Choose a reason for hiding this comment

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

I get this warning from my IDE Attributes on a namespace declaration are a C++17 extension [-Wc++17-extensions] and when compiling with clang but not with gcc

@elBoberido
Copy link
Member

Thinking about it, we could use this trick to ensure that we do not break the API. A CI job which builds posh 3.0 against hoofs master and examples 3.0 against posh + hoofs master.

…ing consistently in the docs, moving TypeInfo back and importing other related API calls

Signed-off-by: Simon Hoinkis <simon.hoinkis@apex.ai>
@mossmaurice mossmaurice force-pushed the iox-1391-move-vocabulary-types branch from acf7aa9 to 9a8f14d Compare January 11, 2023 23:16
@mossmaurice
Copy link
Contributor Author

@elBoberido

Thinking about it, we could use this trick to ensure that we do not break the API. A CI job which builds posh 3.0 against hoofs master and examples 3.0 against posh + hoofs master.

IMHO that would be overkill...

@elBoberido
Copy link
Member

IMHO that would be overkill...

well, it depends on how serious we are about API breakage 😅

we might not yet be there but at some point I think it would make sense

@mossmaurice mossmaurice merged commit 3d22bd4 into eclipse-iceoryx:master Jan 12, 2023
@mossmaurice mossmaurice deleted the iox-1391-move-vocabulary-types branch January 12, 2023 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Refactor code without adding features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split iceoryx_hoofs into logical modules
3 participants