Skip to content

Commit

Permalink
Remove public declarations (ros2#230)
Browse files Browse the repository at this point in the history
This package is only intended to be accessed through `rmw_implementation`. As such none of the headers in this package were intended to be part of the public interface. The link interface of this package is that provided by `rmw_implementation`.

Signed-off-by: Dan Rose <dan@digilabs.io>
  • Loading branch information
rotu authored and eboasson committed May 17, 2021
1 parent d6e5b92 commit d4226c8
Show file tree
Hide file tree
Showing 20 changed files with 53 additions and 127 deletions.
16 changes: 0 additions & 16 deletions rmw_cyclonedds_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ add_library(rmw_cyclonedds_cpp
src/Serialization.cpp
src/TypeSupport2.cpp)

target_include_directories(rmw_cyclonedds_cpp PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)

target_link_libraries(rmw_cyclonedds_cpp
CycloneDDS::ddsc
)
Expand All @@ -91,12 +86,6 @@ target_compile_definitions(${PROJECT_NAME}
RMW_VERSION_PATCH=${rmw_VERSION_PATCH}
)

# Causes the visibility macros to use dllexport rather than dllimport,
# which is appropriate when building the dll but not consuming it.
target_compile_definitions(${PROJECT_NAME}
PRIVATE "RMW_CYCLONEDDS_CPP_BUILDING_LIBRARY")

ament_export_include_directories(include)
ament_export_libraries(rmw_cyclonedds_cpp)

register_rmw_implementation(
Expand All @@ -110,11 +99,6 @@ endif()

ament_package()

install(
DIRECTORY include/
DESTINATION include
)

install(
TARGETS rmw_cyclonedds_cpp
ARCHIVE DESTINATION lib
Expand Down
56 changes: 0 additions & 56 deletions rmw_cyclonedds_cpp/include/rmw_cyclonedds_cpp/visibility_control.h

This file was deleted.

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 RMW_CYCLONEDDS_CPP__MESSAGETYPESUPPORT_HPP_
#define RMW_CYCLONEDDS_CPP__MESSAGETYPESUPPORT_HPP_
#ifndef MESSAGETYPESUPPORT_HPP_
#define MESSAGETYPESUPPORT_HPP_

#include <cassert>
#include <memory>
Expand All @@ -36,4 +36,4 @@ class MessageTypeSupport : public TypeSupport<MembersType>

#include "MessageTypeSupport_impl.hpp"

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

#ifndef RMW_CYCLONEDDS_CPP__MESSAGETYPESUPPORT_IMPL_HPP_
#define RMW_CYCLONEDDS_CPP__MESSAGETYPESUPPORT_IMPL_HPP_
#ifndef MESSAGETYPESUPPORT_IMPL_HPP_
#define MESSAGETYPESUPPORT_IMPL_HPP_

#include <cassert>
#include <memory>
#include <regex>
#include <sstream>
#include <string>

#include "rmw_cyclonedds_cpp/MessageTypeSupport.hpp"
#include "MessageTypeSupport.hpp"
#include "rosidl_typesupport_introspection_cpp/field_types.hpp"

namespace rmw_cyclonedds_cpp
Expand All @@ -47,4 +47,4 @@ MessageTypeSupport<MembersType>::MessageTypeSupport(const MembersType * members)

} // namespace rmw_cyclonedds_cpp

#endif // RMW_CYCLONEDDS_CPP__MESSAGETYPESUPPORT_IMPL_HPP_
#endif // MESSAGETYPESUPPORT_IMPL_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 RMW_CYCLONEDDS_CPP__SERVICETYPESUPPORT_HPP_
#define RMW_CYCLONEDDS_CPP__SERVICETYPESUPPORT_HPP_
#ifndef SERVICETYPESUPPORT_HPP_
#define SERVICETYPESUPPORT_HPP_

#include <cassert>

Expand Down Expand Up @@ -50,4 +50,4 @@ class ResponseTypeSupport : public ServiceTypeSupport<MessageMembersType>

#include "ServiceTypeSupport_impl.hpp"

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

#ifndef RMW_CYCLONEDDS_CPP__SERVICETYPESUPPORT_IMPL_HPP_
#define RMW_CYCLONEDDS_CPP__SERVICETYPESUPPORT_IMPL_HPP_
#ifndef SERVICETYPESUPPORT_IMPL_HPP_
#define SERVICETYPESUPPORT_IMPL_HPP_

#include <cassert>
#include <regex>
#include <sstream>
#include <string>

#include "rmw_cyclonedds_cpp/ServiceTypeSupport.hpp"
#include "ServiceTypeSupport.hpp"
#include "rosidl_typesupport_introspection_cpp/field_types.hpp"

namespace rmw_cyclonedds_cpp
Expand Down Expand Up @@ -72,4 +72,4 @@ ResponseTypeSupport<ServiceMembersType, MessageMembersType>::ResponseTypeSupport

} // namespace rmw_cyclonedds_cpp

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

#ifndef RMW_CYCLONEDDS_CPP__TYPESUPPORT_HPP_
#define RMW_CYCLONEDDS_CPP__TYPESUPPORT_HPP_
#ifndef TYPESUPPORT_HPP_
#define TYPESUPPORT_HPP_

#include <cassert>
#include <string>
Expand All @@ -30,13 +30,11 @@
#include "rosidl_typesupport_introspection_cpp/identifier.hpp"
#include "rosidl_typesupport_introspection_cpp/message_introspection.hpp"
#include "rosidl_typesupport_introspection_cpp/service_introspection.hpp"
#include "rosidl_typesupport_introspection_cpp/visibility_control.h"

#include "rosidl_typesupport_introspection_c/field_types.h"
#include "rosidl_typesupport_introspection_c/identifier.h"
#include "rosidl_typesupport_introspection_c/message_introspection.h"
#include "rosidl_typesupport_introspection_c/service_introspection.h"
#include "rosidl_typesupport_introspection_c/visibility_control.h"

#include "serdes.hpp"

Expand Down Expand Up @@ -137,4 +135,4 @@ class TypeSupport

#include "TypeSupport_impl.hpp"

#endif // RMW_CYCLONEDDS_CPP__TYPESUPPORT_HPP_
#endif // TYPESUPPORT_HPP_
2 changes: 1 addition & 1 deletion rmw_cyclonedds_cpp/src/TypeSupport2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <vector>

#include "bytewise.hpp"
#include "rmw_cyclonedds_cpp/exception.hpp"
#include "exception.hpp"
#include "rosidl_runtime_c/string_functions.h"
#include "rosidl_runtime_c/u16string_functions.h"
#include "rosidl_typesupport_introspection_c/identifier.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef RMW_CYCLONEDDS_CPP__TYPESUPPORT_IMPL_HPP_
#define RMW_CYCLONEDDS_CPP__TYPESUPPORT_IMPL_HPP_
#ifndef TYPESUPPORT_IMPL_HPP_
#define TYPESUPPORT_IMPL_HPP_

#include <cassert>
#include <functional>
#include <string>
#include <vector>

#include "rmw_cyclonedds_cpp/TypeSupport.hpp"
#include "rmw_cyclonedds_cpp/macros.hpp"
#include "TypeSupport.hpp"
#include "macros.hpp"
#include "rosidl_typesupport_introspection_cpp/field_types.hpp"
#include "rosidl_typesupport_introspection_cpp/message_introspection.hpp"
#include "rosidl_typesupport_introspection_cpp/service_introspection.hpp"
Expand Down Expand Up @@ -558,4 +558,4 @@ std::string TypeSupport<MembersType>::getName()

} // namespace rmw_cyclonedds_cpp

#endif // RMW_CYCLONEDDS_CPP__TYPESUPPORT_IMPL_HPP_
#endif // TYPESUPPORT_IMPL_HPP_
2 changes: 1 addition & 1 deletion rmw_cyclonedds_cpp/src/deserialization_exception.cpp
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 "rmw_cyclonedds_cpp/deserialization_exception.hpp"
#include "deserialization_exception.hpp"

using rmw_cyclonedds_cpp::DeserializationException;

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

#ifndef RMW_CYCLONEDDS_CPP__DESERIALIZATION_EXCEPTION_HPP_
#define RMW_CYCLONEDDS_CPP__DESERIALIZATION_EXCEPTION_HPP_
#ifndef DESERIALIZATION_EXCEPTION_HPP_
#define DESERIALIZATION_EXCEPTION_HPP_

#include "rmw_cyclonedds_cpp/exception.hpp"
#include "exception.hpp"

namespace rmw_cyclonedds_cpp
{
Expand All @@ -34,4 +34,4 @@ class DeserializationException : public Exception

} // namespace rmw_cyclonedds_cpp

#endif // RMW_CYCLONEDDS_CPP__DESERIALIZATION_EXCEPTION_HPP_
#endif // DESERIALIZATION_EXCEPTION_HPP_
2 changes: 1 addition & 1 deletion rmw_cyclonedds_cpp/src/exception.cpp
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 "rmw_cyclonedds_cpp/exception.hpp"
#include "exception.hpp"

using rmw_cyclonedds_cpp::Exception;

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 RMW_CYCLONEDDS_CPP__EXCEPTION_HPP_
#define RMW_CYCLONEDDS_CPP__EXCEPTION_HPP_
#ifndef EXCEPTION_HPP_
#define EXCEPTION_HPP_

#include <stdexcept>
#include <string>
Expand Down Expand Up @@ -51,4 +51,4 @@ class Exception : public std::exception
}
} // namespace rmw_cyclonedds_cpp

#endif // RMW_CYCLONEDDS_CPP__EXCEPTION_HPP_
#endif // EXCEPTION_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 RMW_CYCLONEDDS_CPP__MACROS_HPP_
#define RMW_CYCLONEDDS_CPP__MACROS_HPP_
#ifndef MACROS_HPP_
#define MACROS_HPP_

#include <limits>
#include <string>
Expand All @@ -33,4 +33,4 @@
} \
};

#endif // RMW_CYCLONEDDS_CPP__MACROS_HPP_
#endif // MACROS_HPP_
8 changes: 4 additions & 4 deletions rmw_cyclonedds_cpp/src/rmw_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@

#include "TypeSupport2.hpp"

#include "rmw_cyclonedds_cpp/rmw_version_test.hpp"
#include "rmw_cyclonedds_cpp/MessageTypeSupport.hpp"
#include "rmw_cyclonedds_cpp/ServiceTypeSupport.hpp"
#include "rmw_version_test.hpp"
#include "MessageTypeSupport.hpp"
#include "ServiceTypeSupport.hpp"

#include "rmw/get_topic_endpoint_info.h"
#include "rmw/incompatible_qos_events_statuses.h"
Expand All @@ -78,7 +78,7 @@

#include "dds/dds.h"
#include "dds/ddsi/ddsi_sertopic.h"
#include "rmw_cyclonedds_cpp/serdes.hpp"
#include "serdes.hpp"
#include "serdata.hpp"
#include "demangle.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef RMW_CYCLONEDDS_CPP__RMW_VERSION_TEST_HPP_
#define RMW_CYCLONEDDS_CPP__RMW_VERSION_TEST_HPP_
#ifndef RMW_VERSION_TEST_HPP_
#define RMW_VERSION_TEST_HPP_

/* True if the version of RMW is at least major.minor.patch */
#define RMW_VERSION_GTE(major, minor, patch) ( \
Expand All @@ -21,4 +21,4 @@
minor < RMW_VERSION_MINOR || ( \
minor == RMW_VERSION_MINOR && patch <= RMW_VERSION_PATCH))))

#endif // RMW_CYCLONEDDS_CPP__RMW_VERSION_TEST_HPP_
#endif // RMW_VERSION_TEST_HPP_
6 changes: 3 additions & 3 deletions rmw_cyclonedds_cpp/src/serdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
#include "bytewise.hpp"
#include "dds/ddsi/q_radmin.h"
#include "rmw/error_handling.h"
#include "rmw_cyclonedds_cpp/MessageTypeSupport.hpp"
#include "rmw_cyclonedds_cpp/ServiceTypeSupport.hpp"
#include "rmw_cyclonedds_cpp/serdes.hpp"
#include "MessageTypeSupport.hpp"
#include "ServiceTypeSupport.hpp"
#include "serdes.hpp"

/* Cyclone's nn_keyhash got renamed to ddsi_keyhash and shuffled around in the header
files to avoid pulling in tons of things just for a definition of a keyhash. This
Expand Down
2 changes: 1 addition & 1 deletion rmw_cyclonedds_cpp/src/serdes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <exception>

#include "dds/ddsrt/endian.h"
#include "rmw_cyclonedds_cpp/serdes.hpp"
#include "serdes.hpp"

cycdeserbase::cycdeserbase(const char * data_, size_t size_)
: data(data_),
Expand Down
Loading

0 comments on commit d4226c8

Please sign in to comment.