Skip to content

Commit

Permalink
Move rclpp_generic into rclcpp
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolai Morin <[email protected]>
  • Loading branch information
nnmm committed Dec 17, 2020
1 parent 520a919 commit 2eded6d
Show file tree
Hide file tree
Showing 17 changed files with 55 additions and 2,787 deletions.
6 changes: 6 additions & 0 deletions rclcpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ project(rclcpp)
find_package(Threads REQUIRED)

find_package(ament_cmake_ros REQUIRED)
find_package(ament_index_cpp REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(libstatistics_collector REQUIRED)
find_package(rcl REQUIRED)
Expand Down Expand Up @@ -55,6 +56,9 @@ set(${PROJECT_NAME}_SRCS
src/rclcpp/executors/static_executor_entities_collector.cpp
src/rclcpp/executors/static_single_threaded_executor.cpp
src/rclcpp/future_return_code.cpp
src/rclcpp/generic/generic_publisher.cpp
src/rclcpp/generic/generic_subscription.cpp
src/rclcpp/generic/typesupport_helpers.cpp
src/rclcpp/graph_listener.cpp
src/rclcpp/guard_condition.cpp
src/rclcpp/init_options.cpp
Expand Down Expand Up @@ -176,6 +180,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC
target_link_libraries(${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT})
# specific order: dependents before dependencies
ament_target_dependencies(${PROJECT_NAME}
"ament_index_cpp"
"libstatistics_collector"
"rcl"
"rcl_yaml_param_parser"
Expand Down Expand Up @@ -206,6 +211,7 @@ ament_export_include_directories(include)
ament_export_libraries(${PROJECT_NAME})
ament_export_targets(${PROJECT_NAME})

ament_export_dependencies(ament_index_cpp)
ament_export_dependencies(libstatistics_collector)
ament_export_dependencies(rcl)
ament_export_dependencies(rcpputils)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef RCLCPP_GENERIC__GENERIC_PUBLISHER_HPP_
#define RCLCPP_GENERIC__GENERIC_PUBLISHER_HPP_
#ifndef RCLCPP__GENERIC__GENERIC_PUBLISHER_HPP_
#define RCLCPP__GENERIC__GENERIC_PUBLISHER_HPP_

#include <memory>
#include <string>
Expand Down Expand Up @@ -89,4 +89,4 @@ class GenericPublisher : public rclcpp::PublisherBase

} // namespace rclcpp_generic

#endif // RCLCPP_GENERIC__GENERIC_PUBLISHER_HPP_
#endif // RCLCPP__GENERIC__GENERIC_PUBLISHER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef RCLCPP_GENERIC__GENERIC_SUBSCRIPTION_HPP_
#define RCLCPP_GENERIC__GENERIC_SUBSCRIPTION_HPP_
#ifndef RCLCPP__GENERIC__GENERIC_SUBSCRIPTION_HPP_
#define RCLCPP__GENERIC__GENERIC_SUBSCRIPTION_HPP_

#include <functional>
#include <memory>
Expand Down Expand Up @@ -109,4 +109,4 @@ class GenericSubscription : public rclcpp::SubscriptionBase

} // namespace rclcpp_generic

#endif // RCLCPP_GENERIC__GENERIC_SUBSCRIPTION_HPP_
#endif // RCLCPP__GENERIC__GENERIC_SUBSCRIPTION_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef RCLCPP_GENERIC__TYPESUPPORT_HELPERS_HPP_
#define RCLCPP_GENERIC__TYPESUPPORT_HELPERS_HPP_
#ifndef RCLCPP__GENERIC__TYPESUPPORT_HELPERS_HPP_
#define RCLCPP__GENERIC__TYPESUPPORT_HELPERS_HPP_

#include <memory>
#include <string>
#include <tuple>

#include "rclcpp_generic/visibility_control.hpp"
#include "rclcpp/visibility_control.hpp"

#include "rcpputils/shared_library.hpp"

Expand All @@ -28,21 +28,21 @@
namespace rclcpp_generic
{

RCLCPP_GENERIC_PUBLIC
RCLCPP_PUBLIC
std::shared_ptr<rcpputils::SharedLibrary>
get_typesupport_library(const std::string & type, const std::string & typesupport_identifier);

RCLCPP_GENERIC_PUBLIC
RCLCPP_PUBLIC
const rosidl_message_type_support_t *
get_typesupport_handle(
const std::string & type,
const std::string & typesupport_identifier,
std::shared_ptr<rcpputils::SharedLibrary> library);

RCLCPP_GENERIC_PUBLIC
RCLCPP_PUBLIC
std::tuple<std::string, std::string, std::string>
extract_type_identifier(const std::string & full_type);

} // namespace rclcpp_generic

#endif // RCLCPP_GENERIC__TYPESUPPORT_HELPERS_HPP_
#endif // RCLCPP__GENERIC__TYPESUPPORT_HELPERS_HPP_
1 change: 1 addition & 0 deletions rclcpp/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<build_export_depend>rosidl_typesupport_c</build_export_depend>
<build_export_depend>rosidl_typesupport_cpp</build_export_depend>

<depend>ament_index_cpp</depend>
<depend>libstatistics_collector</depend>
<depend>rcl</depend>
<depend>rcl_yaml_param_parser</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "rclcpp_generic/generic_publisher.hpp"
#include "rclcpp/generic/generic_publisher.hpp"

#include <memory>
#include <string>
#include <utility>

#include "rclcpp_generic/typesupport_helpers.hpp"
#include "rclcpp/generic/typesupport_helpers.hpp"

namespace rclcpp_generic
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "rclcpp_generic/generic_subscription.hpp"
#include "rclcpp/generic/generic_subscription.hpp"

#include <memory>
#include <string>
#include <utility>

#include "rcl/subscription.h"
#include "rclcpp_generic/typesupport_helpers.hpp"
#include "rclcpp/generic/typesupport_helpers.hpp"

namespace rclcpp_generic
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "rclcpp_generic/typesupport_helpers.hpp"
#include "rclcpp/generic/typesupport_helpers.hpp"

#include <memory>
#include <sstream>
Expand Down
24 changes: 24 additions & 0 deletions rclcpp/test/rclcpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,22 @@ if(TARGET test_qos)
${PROJECT_NAME}
)
endif()
function(test_pubsub_for_rmw_implementation)
set(rmw_implementation_env_var RMW_IMPLEMENTATION=${rmw_implementation})
ament_add_gmock(test_pubsub${target_suffix} generic/test_pubsub.cpp
ENV ${rmw_implementation_env_var}
)
if(TARGET test_pubsub${target_suffix})
target_link_libraries(test_pubsub${target_suffix} ${PROJECT_NAME})
target_include_directories(test_pubsub${target_suffix} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/rclcpp/src/generic>)
ament_target_dependencies(test_pubsub${target_suffix}
"rcpputils"
"rosidl_typesupport_cpp"
"test_msgs"
)
endif()
endfunction()
call_for_each_rmw_implementation(test_pubsub_for_rmw_implementation)
ament_add_gtest(test_qos_event test_qos_event.cpp)
if(TARGET test_qos_event)
ament_target_dependencies(test_qos_event
Expand Down Expand Up @@ -463,6 +479,14 @@ if(TARGET test_type_support)
)
target_link_libraries(test_type_support ${PROJECT_NAME})
endif()
ament_add_gmock(test_typesupport_helpers generic/test_typesupport_helpers.cpp)
if(TARGET test_typesupport_helpers)
ament_target_dependencies(test_typesupport_helpers
"rcpputils"
"rosidl_runtime_cpp"
)
target_link_libraries(test_typesupport_helpers ${PROJECT_NAME})
endif()
ament_add_gtest(test_find_weak_nodes test_find_weak_nodes.cpp)
if(TARGET test_find_weak_nodes)
ament_target_dependencies(test_find_weak_nodes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef RCLCPP_GENERIC__MEMORY_MANAGEMENT_HPP_
#define RCLCPP_GENERIC__MEMORY_MANAGEMENT_HPP_
#ifndef RCLCPP__GENERIC__MEMORY_MANAGEMENT_HPP_
#define RCLCPP__GENERIC__MEMORY_MANAGEMENT_HPP_

#include <memory>
#include <string>
Expand Down Expand Up @@ -109,4 +109,4 @@ class MemoryManagement

} // namespace rclcpp_generic

#endif // RCLCPP_GENERIC__MEMORY_MANAGEMENT_HPP_
#endif // RCLCPP__GENERIC__MEMORY_MANAGEMENT_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#include "test_msgs/message_fixtures.hpp"
#include "test_msgs/msg/basic_types.hpp"

#include "rclcpp_generic/generic_publisher.hpp"
#include "rclcpp_generic/generic_subscription.hpp"
#include "rclcpp/generic/generic_publisher.hpp"
#include "rclcpp/generic/generic_subscription.hpp"

using namespace ::testing; // NOLINT
using namespace rclcpp_generic; // NOLINT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include "rcpputils/shared_library.hpp"

#include "rclcpp_generic/typesupport_helpers.hpp"
#include "rclcpp/generic/typesupport_helpers.hpp"

using namespace ::testing; // NOLINT

Expand Down
99 changes: 0 additions & 99 deletions rclcpp_generic/CMakeLists.txt

This file was deleted.

Loading

0 comments on commit 2eded6d

Please sign in to comment.