-
Notifications
You must be signed in to change notification settings - Fork 417
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
refactor AnySubscriptionCallback and add/deprecate callback signatures #1598
Commits on Apr 1, 2021
-
refactor AnySubscriptionCallback to...
use std::variant and make the dispatch functions constexpr, avoiding runtime dispatching. Also, deprecate the std::function<void (std::shared_ptr<MessageT>)> signature, as it is unsafe to share one shared_ptr when multiple subscriptions take it, because they could mutate MessageT while others are using it. So you'd have to make a copy for each subscription, which is no different than the std::unique_ptr<MessageT> signature or the user making their own copy in a shared_ptr from the const MessageT & signature or the std::shared_ptr<const MessageT> signature. Added a std::function<void (const std::shared_ptr<const MessageT> &)> signature to go along side the existing std::function<void (std::shared_ptr<const MessageT>)> signature. Removed redundant 'const' before pass-by-value signatures, e.g. std::function<void (const shared_ptr<const MessageT>)> became std::function<void (shared_ptr<const MessageT>)>. This will not affect API or any users using the old style. Signed-off-by: William Woodall <william@osrfoundation.org>
Configuration menu - View commit details
-
Copy full SHA for 96a04a1 - Browse repository at this point
Copy the full SHA 96a04a1View commit details -
fix use of std::bind, free functions, etc. using new function_traits:…
…:as_std_function<> Signed-off-by: William Woodall <william@osrfoundation.org>
Configuration menu - View commit details
-
Copy full SHA for 1418e8e - Browse repository at this point
Copy the full SHA 1418e8eView commit details -
fix use of const MessageT & callbacks by fixing subscriptin_traits
Signed-off-by: William Woodall <william@osrfoundation.org>
Configuration menu - View commit details
-
Copy full SHA for 76edcd3 - Browse repository at this point
Copy the full SHA 76edcd3View commit details -
Signed-off-by: William Woodall <william@osrfoundation.org>
Configuration menu - View commit details
-
Copy full SHA for 2bec5c4 - Browse repository at this point
Copy the full SHA 2bec5c4View commit details -
use target_compile_features to require c++17 for downstream users of …
…rclcpp Signed-off-by: William Woodall <william@osrfoundation.org>
Configuration menu - View commit details
-
Copy full SHA for fda4a9f - Browse repository at this point
Copy the full SHA fda4a9fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3d4518d - Browse repository at this point
Copy the full SHA 3d4518dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 02e1eef - Browse repository at this point
Copy the full SHA 02e1eefView commit details -
use target_compile_features(... cxx_std_17)
Signed-off-by: William Woodall <william@osrfoundation.org>
Configuration menu - View commit details
-
Copy full SHA for fdc6920 - Browse repository at this point
Copy the full SHA fdc6920View commit details -
Keep both std::shared_ptr<const MessageT> and const std::shared_ptr<c…
…onst MessageT> & signatures. The const std::shared_ptr<const MessageT> & signature is being kept because it can be more flexible and efficient than std::shared_ptr<const MessageT>, but costs realtively little to support. The std::shared_ptr<const MessageT> signature is being kept because we want to avoid deprecating it and causing disruption, and because it is convenient to write, and in most cases will not materially impact the performance. Signed-off-by: William Woodall <william@osrfoundation.org>
Configuration menu - View commit details
-
Copy full SHA for d7840fd - Browse repository at this point
Copy the full SHA d7840fdView commit details -
defer deprecation of the shared_ptr<MessageT> sub callbacks
Signed-off-by: William Woodall <william@osrfoundation.org>
Configuration menu - View commit details
-
Copy full SHA for 0811b7f - Browse repository at this point
Copy the full SHA 0811b7fView commit details -
Signed-off-by: William Woodall <william@osrfoundation.org>
Configuration menu - View commit details
-
Copy full SHA for 2cea8ca - Browse repository at this point
Copy the full SHA 2cea8caView commit details -
small fixups to AnySubscriptionCallback
Signed-off-by: William Woodall <william@osrfoundation.org>
Configuration menu - View commit details
-
Copy full SHA for 934d8be - Browse repository at this point
Copy the full SHA 934d8beView commit details -
add check for unset AnySubscriptionCallback in dispatch methods
Signed-off-by: William Woodall <william@osrfoundation.org>
Configuration menu - View commit details
-
Copy full SHA for 84c7372 - Browse repository at this point
Copy the full SHA 84c7372View commit details -
update dispatch methods to handle all scenarios
Signed-off-by: William Woodall <william@osrfoundation.org>
Configuration menu - View commit details
-
Copy full SHA for 0903161 - Browse repository at this point
Copy the full SHA 0903161View commit details -
updated tests for AnySubscriptionCallback, include full parameterized…
… i/o matrix Signed-off-by: William Woodall <william@osrfoundation.org>
Configuration menu - View commit details
-
Copy full SHA for f923c2b - Browse repository at this point
Copy the full SHA f923c2bView commit details -
fixup test with changed assumption
Signed-off-by: William Woodall <william@osrfoundation.org>
Configuration menu - View commit details
-
Copy full SHA for a5ff680 - Browse repository at this point
Copy the full SHA a5ff680View commit details
Commits on Apr 2, 2021
-
remove use of std::unary_function, which was removed in c++17
Signed-off-by: William Woodall <william@osrfoundation.org>
Configuration menu - View commit details
-
Copy full SHA for 2590fd0 - Browse repository at this point
Copy the full SHA 2590fd0View commit details -
silence c++17 warnings on windows for now
Signed-off-by: William Woodall <william@osrfoundation.org>
Configuration menu - View commit details
-
Copy full SHA for ac4b35c - Browse repository at this point
Copy the full SHA ac4b35cView commit details