Skip to content

Commit df3c2ff

Browse files
authored
deprecate redundant namespaces (ros2#1083)
* deprecate redundant namespaces, move classes to own files, rename some classes Signed-off-by: William Woodall <william@osrfoundation.org> * fixup Signed-off-by: William Woodall <william@osrfoundation.org> * address review comments Signed-off-by: William Woodall <william@osrfoundation.org> * fix ups since rebase Signed-off-by: William Woodall <william@osrfoundation.org> * avoid deprecation warnings from deprecated functions Signed-off-by: William Woodall <william@osrfoundation.org> * more fixes Signed-off-by: William Woodall <william@osrfoundation.org> * another fixup, after another rebase Signed-off-by: William Woodall <william@osrfoundation.org>
1 parent 52ae3e0 commit df3c2ff

74 files changed

Lines changed: 716 additions & 563 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

rclcpp/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ set(${PROJECT_NAME}_SRCS
3939
src/rclcpp/detail/utilities.cpp
4040
src/rclcpp/duration.cpp
4141
src/rclcpp/event.cpp
42-
src/rclcpp/exceptions.cpp
42+
src/rclcpp/exceptions/exceptions.cpp
4343
src/rclcpp/executable_list.cpp
4444
src/rclcpp/executor.cpp
4545
src/rclcpp/executors.cpp
@@ -48,6 +48,7 @@ set(${PROJECT_NAME}_SRCS
4848
src/rclcpp/executors/single_threaded_executor.cpp
4949
src/rclcpp/executors/static_executor_entities_collector.cpp
5050
src/rclcpp/executors/static_single_threaded_executor.cpp
51+
src/rclcpp/future_return_code.cpp
5152
src/rclcpp/graph_listener.cpp
5253
src/rclcpp/guard_condition.cpp
5354
src/rclcpp/init_options.cpp

rclcpp/include/rclcpp/any_executable.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929

3030
namespace rclcpp
3131
{
32-
namespace executor
33-
{
3432

3533
struct AnyExecutable
3634
{
@@ -47,10 +45,15 @@ struct AnyExecutable
4745
rclcpp::ClientBase::SharedPtr client;
4846
rclcpp::Waitable::SharedPtr waitable;
4947
// These are used to keep the scope on the containing items
50-
rclcpp::callback_group::CallbackGroup::SharedPtr callback_group;
48+
rclcpp::CallbackGroup::SharedPtr callback_group;
5149
rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_base;
5250
};
5351

52+
namespace executor
53+
{
54+
55+
using AnyExecutable [[deprecated("use rclcpp::AnyExecutable instead")]] = AnyExecutable;
56+
5457
} // namespace executor
5558
} // namespace rclcpp
5659

rclcpp/include/rclcpp/callback_group.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ class NodeTopics;
4040
class NodeWaitables;
4141
} // namespace node_interfaces
4242

43-
namespace callback_group
44-
{
45-
4643
enum class CallbackGroupType
4744
{
4845
MutuallyExclusive,
@@ -162,6 +159,12 @@ class CallbackGroup
162159
}
163160
};
164161

162+
namespace callback_group
163+
{
164+
165+
using CallbackGroupType [[deprecated("use rclcpp::CallbackGroupType instead")]] = CallbackGroupType;
166+
using CallbackGroup [[deprecated("use rclcpp::CallbackGroup instead")]] = CallbackGroup;
167+
165168
} // namespace callback_group
166169
} // namespace rclcpp
167170

rclcpp/include/rclcpp/contexts/default_context.hpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ namespace rclcpp
2222
{
2323
namespace contexts
2424
{
25-
namespace default_context
26-
{
2725

2826
class DefaultContext : public rclcpp::Context
2927
{
@@ -38,6 +36,21 @@ RCLCPP_PUBLIC
3836
DefaultContext::SharedPtr
3937
get_global_default_context();
4038

39+
namespace default_context
40+
{
41+
42+
using DefaultContext
43+
[[deprecated("use rclcpp::contexts::DefaultContext instead")]] = DefaultContext;
44+
45+
[[deprecated("use rclcpp::contexts::get_global_default_context() instead")]]
46+
RCLCPP_PUBLIC
47+
inline
48+
DefaultContext::SharedPtr
49+
get_global_default_context()
50+
{
51+
return rclcpp::contexts::get_global_default_context();
52+
}
53+
4154
} // namespace default_context
4255
} // namespace contexts
4356
} // namespace rclcpp

rclcpp/include/rclcpp/create_client.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ create_client(
3535
std::shared_ptr<node_interfaces::NodeServicesInterface> node_services,
3636
const std::string & service_name,
3737
const rmw_qos_profile_t & qos_profile,
38-
rclcpp::callback_group::CallbackGroup::SharedPtr group)
38+
rclcpp::CallbackGroup::SharedPtr group)
3939
{
4040
rcl_client_options_t options = rcl_client_get_default_options();
4141
options.qos = qos_profile;

rclcpp/include/rclcpp/create_service.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ create_service(
3737
const std::string & service_name,
3838
CallbackT && callback,
3939
const rmw_qos_profile_t & qos_profile,
40-
rclcpp::callback_group::CallbackGroup::SharedPtr group)
40+
rclcpp::CallbackGroup::SharedPtr group)
4141
{
4242
rclcpp::AnyServiceCallback<ServiceT> any_service_callback;
4343
any_service_callback.set(std::forward<CallbackT>(callback));

rclcpp/include/rclcpp/create_timer.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ create_timer(
3939
rclcpp::Clock::SharedPtr clock,
4040
rclcpp::Duration period,
4141
CallbackT && callback,
42-
rclcpp::callback_group::CallbackGroup::SharedPtr group = nullptr)
42+
rclcpp::CallbackGroup::SharedPtr group = nullptr)
4343
{
4444
auto timer = rclcpp::GenericTimer<CallbackT>::make_shared(
4545
clock,
@@ -59,7 +59,7 @@ create_timer(
5959
rclcpp::Clock::SharedPtr clock,
6060
rclcpp::Duration period,
6161
CallbackT && callback,
62-
rclcpp::callback_group::CallbackGroup::SharedPtr group = nullptr)
62+
rclcpp::CallbackGroup::SharedPtr group = nullptr)
6363
{
6464
return create_timer(
6565
rclcpp::node_interfaces::get_node_base_interface(node),
@@ -90,7 +90,7 @@ typename rclcpp::WallTimer<CallbackT>::SharedPtr
9090
create_wall_timer(
9191
std::chrono::duration<DurationRepT, DurationT> period,
9292
CallbackT callback,
93-
rclcpp::callback_group::CallbackGroup::SharedPtr group,
93+
rclcpp::CallbackGroup::SharedPtr group,
9494
node_interfaces::NodeBaseInterface * node_base,
9595
node_interfaces::NodeTimersInterface * node_timers)
9696
{

0 commit comments

Comments
 (0)