diff --git a/rmw_cyclonedds_cpp/include/rmw_cyclonedds_cpp/TypeSupport.hpp b/rmw_cyclonedds_cpp/include/rmw_cyclonedds_cpp/TypeSupport.hpp index 206f52f5..303ef3cb 100644 --- a/rmw_cyclonedds_cpp/include/rmw_cyclonedds_cpp/TypeSupport.hpp +++ b/rmw_cyclonedds_cpp/include/rmw_cyclonedds_cpp/TypeSupport.hpp @@ -16,9 +16,9 @@ #ifndef RMW_CYCLONEDDS_CPP__TYPESUPPORT_HPP_ #define RMW_CYCLONEDDS_CPP__TYPESUPPORT_HPP_ -#include -#include -#include +#include +#include +#include #include #include @@ -53,15 +53,15 @@ struct StringHelper; template<> struct StringHelper { - using type = rosidl_generator_c__String; + using type = rosidl_runtime_c__String; static std::string convert_to_std_string(void * data) { - auto c_string = static_cast(data); + auto c_string = static_cast(data); if (!c_string) { RCUTILS_LOG_ERROR_NAMED( "rmw_cyclonedds_cpp", - "Failed to cast data as rosidl_generator_c__String"); + "Failed to cast data as rosidl_runtime_c__String"); return ""; } if (!c_string->data) { @@ -73,7 +73,7 @@ struct StringHelper return std::string(c_string->data); } - static std::string convert_to_std_string(rosidl_generator_c__String & data) + static std::string convert_to_std_string(rosidl_runtime_c__String & data) { return std::string(data.data); } @@ -82,8 +82,8 @@ struct StringHelper { std::string str; deser >> str; - rosidl_generator_c__String * c_str = static_cast(field); - rosidl_generator_c__String__assign(c_str, str.c_str()); + rosidl_runtime_c__String * c_str = static_cast(field); + rosidl_runtime_c__String__assign(c_str, str.c_str()); } }; diff --git a/rmw_cyclonedds_cpp/include/rmw_cyclonedds_cpp/TypeSupport_impl.hpp b/rmw_cyclonedds_cpp/include/rmw_cyclonedds_cpp/TypeSupport_impl.hpp index f2cc2cba..0a733ee2 100644 --- a/rmw_cyclonedds_cpp/include/rmw_cyclonedds_cpp/TypeSupport_impl.hpp +++ b/rmw_cyclonedds_cpp/include/rmw_cyclonedds_cpp/TypeSupport_impl.hpp @@ -30,8 +30,8 @@ #include "rosidl_typesupport_introspection_c/message_introspection.h" #include "rosidl_typesupport_introspection_c/service_introspection.h" -#include "rosidl_generator_c/primitives_sequence_functions.h" -#include "rosidl_generator_c/u16string_functions.h" +#include "rosidl_runtime_c/primitives_sequence_functions.h" +#include "rosidl_runtime_c/u16string_functions.h" #include "serdes.hpp" #include "u16string.hpp" @@ -56,19 +56,19 @@ SPECIALIZE_GENERIC_C_SEQUENCE(uint32, uint32_t) SPECIALIZE_GENERIC_C_SEQUENCE(int64, int64_t) SPECIALIZE_GENERIC_C_SEQUENCE(uint64, uint64_t) -typedef struct rosidl_generator_c__void__Sequence +typedef struct rosidl_runtime_c__void__Sequence { void * data; /// The number of valid items in data size_t size; /// The number of allocated items in data size_t capacity; -} rosidl_generator_c__void__Sequence; +} rosidl_runtime_c__void__Sequence; inline bool -rosidl_generator_c__void__Sequence__init( - rosidl_generator_c__void__Sequence * sequence, size_t size, size_t member_size) +rosidl_runtime_c__void__Sequence__init( + rosidl_runtime_c__void__Sequence * sequence, size_t size, size_t member_size) { if (!sequence) { return false; @@ -88,7 +88,7 @@ rosidl_generator_c__void__Sequence__init( inline void -rosidl_generator_c__void__Sequence__fini(rosidl_generator_c__void__Sequence * sequence) +rosidl_runtime_c__void__Sequence__fini(rosidl_runtime_c__void__Sequence * sequence) { if (!sequence) { return; @@ -182,7 +182,7 @@ static size_t calculateMaxAlign(const MembersType * members) if (std::is_same::value) { - alignment = alignof(rosidl_generator_c__String); + alignment = alignof(rosidl_runtime_c__String); } else { alignment = alignof(std::string); } @@ -229,7 +229,7 @@ size_t get_array_size_and_assign_field( void * & subros_message, size_t, size_t) { - auto tmpsequence = static_cast(field); + auto tmpsequence = static_cast(field); if (member->is_upper_bound_ && tmpsequence->size > member->array_size_) { throw std::runtime_error("vector overcomes the maximum length"); } @@ -353,34 +353,34 @@ inline void deserialize_field( CStringHelper::assign(deser, field, call_new); } else { if (member->array_size_ && !member->is_upper_bound_) { - auto deser_field = static_cast(field); + auto deser_field = static_cast(field); // tmpstring is defined here and not below to avoid // memory allocation in every iteration of the for loop std::string tmpstring; for (size_t i = 0; i < member->array_size_; ++i) { deser.deserialize(tmpstring); - if (!rosidl_generator_c__String__assign(&deser_field[i], tmpstring.c_str())) { - throw std::runtime_error("unable to assign rosidl_generator_c__String"); + if (!rosidl_runtime_c__String__assign(&deser_field[i], tmpstring.c_str())) { + throw std::runtime_error("unable to assign rosidl_runtime_c__String"); } } } else { std::vector cpp_string_vector; deser >> cpp_string_vector; - auto & string_array_field = *reinterpret_cast(field); + auto & string_array_field = *reinterpret_cast(field); if ( - !rosidl_generator_c__String__Sequence__init( + !rosidl_runtime_c__String__Sequence__init( &string_array_field, cpp_string_vector.size())) { - throw std::runtime_error("unable to initialize rosidl_generator_c__String array"); + throw std::runtime_error("unable to initialize rosidl_runtime_c__String array"); } for (size_t i = 0; i < cpp_string_vector.size(); ++i) { if ( - !rosidl_generator_c__String__assign( + !rosidl_runtime_c__String__assign( &string_array_field.data[i], cpp_string_vector[i].c_str())) { - throw std::runtime_error("unable to assign rosidl_generator_c__String"); + throw std::runtime_error("unable to assign rosidl_runtime_c__String"); } } } @@ -399,9 +399,9 @@ inline void deserialize_field( if (!member->is_array_) { deser >> wstr; wstring_to_u16string( - wstr, *static_cast(field)); + wstr, *static_cast(field)); } else if (member->array_size_ && !member->is_upper_bound_) { - auto array = static_cast(field); + auto array = static_cast(field); for (size_t i = 0; i < member->array_size_; ++i) { deser >> wstr; wstring_to_u16string(wstr, array[i]); @@ -409,9 +409,9 @@ inline void deserialize_field( } else { uint32_t size; deser >> size; - auto sequence = static_cast(field); - if (!rosidl_generator_c__U16String__Sequence__init(sequence, size)) { - throw std::runtime_error("unable to initialize rosidl_generator_c__U16String sequence"); + auto sequence = static_cast(field); + if (!rosidl_runtime_c__U16String__Sequence__init(sequence, size)) { + throw std::runtime_error("unable to initialize rosidl_runtime_c__U16String sequence"); } for (size_t i = 0; i < sequence->size; ++i) { deser >> wstr; @@ -452,8 +452,8 @@ inline size_t get_submessage_array_deserialize( { (void)member; uint32_t vsize = deser.deserialize_len(1); - auto tmparray = static_cast(field); - rosidl_generator_c__void__Sequence__init(tmparray, vsize, sub_members_size); + auto tmparray = static_cast(field); + rosidl_runtime_c__void__Sequence__init(tmparray, vsize, sub_members_size); subros_message = reinterpret_cast(tmparray->data); return vsize; } diff --git a/rmw_cyclonedds_cpp/include/rmw_cyclonedds_cpp/macros.hpp b/rmw_cyclonedds_cpp/include/rmw_cyclonedds_cpp/macros.hpp index 2d6b6216..9be8efe5 100644 --- a/rmw_cyclonedds_cpp/include/rmw_cyclonedds_cpp/macros.hpp +++ b/rmw_cyclonedds_cpp/include/rmw_cyclonedds_cpp/macros.hpp @@ -22,14 +22,14 @@ template<> \ struct GenericCSequence \ { \ - using type = rosidl_generator_c__ ## C_NAME ## __Sequence; \ + using type = rosidl_runtime_c__ ## C_NAME ## __Sequence; \ \ static void fini(type * array) { \ - rosidl_generator_c__ ## C_NAME ## __Sequence__fini(array); \ + rosidl_runtime_c__ ## C_NAME ## __Sequence__fini(array); \ } \ \ static bool init(type * array, size_t size) { \ - return rosidl_generator_c__ ## C_NAME ## __Sequence__init(array, size); \ + return rosidl_runtime_c__ ## C_NAME ## __Sequence__init(array, size); \ } \ }; diff --git a/rmw_cyclonedds_cpp/include/rmw_cyclonedds_cpp/u16string.hpp b/rmw_cyclonedds_cpp/include/rmw_cyclonedds_cpp/u16string.hpp index eae6f096..2c298964 100644 --- a/rmw_cyclonedds_cpp/include/rmw_cyclonedds_cpp/u16string.hpp +++ b/rmw_cyclonedds_cpp/include/rmw_cyclonedds_cpp/u16string.hpp @@ -16,16 +16,16 @@ #define RMW_CYCLONEDDS_CPP__U16STRING_HPP_ #include -#include "rosidl_generator_c/u16string_functions.h" +#include "rosidl_runtime_c/u16string_functions.h" namespace rmw_cyclonedds_cpp { void u16string_to_wstring( - const rosidl_generator_c__U16String & u16str, std::wstring & wstr); + const rosidl_runtime_c__U16String & u16str, std::wstring & wstr); bool wstring_to_u16string( - const std::wstring & wstr, rosidl_generator_c__U16String & u16str); + const std::wstring & wstr, rosidl_runtime_c__U16String & u16str); void u16string_to_wstring(const std::u16string & u16str, std::wstring & wstr); diff --git a/rmw_cyclonedds_cpp/src/Serialization.hpp b/rmw_cyclonedds_cpp/src/Serialization.hpp index b1d1ff8a..5265b845 100644 --- a/rmw_cyclonedds_cpp/src/Serialization.hpp +++ b/rmw_cyclonedds_cpp/src/Serialization.hpp @@ -17,7 +17,7 @@ #include #include "TypeSupport2.hpp" -#include "rosidl_generator_c/service_type_support_struct.h" +#include "rosidl_runtime_c/service_type_support_struct.h" #include "serdata.hpp" namespace rmw_cyclonedds_cpp diff --git a/rmw_cyclonedds_cpp/src/TypeSupport2.hpp b/rmw_cyclonedds_cpp/src/TypeSupport2.hpp index c3e065f5..13ea0314 100644 --- a/rmw_cyclonedds_cpp/src/TypeSupport2.hpp +++ b/rmw_cyclonedds_cpp/src/TypeSupport2.hpp @@ -24,8 +24,8 @@ #include "bytewise.hpp" #include "rmw_cyclonedds_cpp/exception.hpp" -#include "rosidl_generator_c/string_functions.h" -#include "rosidl_generator_c/u16string_functions.h" +#include "rosidl_runtime_c/string_functions.h" +#include "rosidl_runtime_c/u16string_functions.h" #include "rosidl_typesupport_introspection_c/identifier.h" #include "rosidl_typesupport_introspection_c/message_introspection.h" #include "rosidl_typesupport_introspection_c/service_introspection.h" @@ -397,7 +397,7 @@ class U16StringValueType : public AnyValueType struct ROSIDLC_StringValueType : public U8StringValueType { public: - using type = rosidl_generator_c__String; + using type = rosidl_runtime_c__String; TypedSpan data(const void * ptr) const override { @@ -419,7 +419,7 @@ struct ROSIDLC_StringValueType : public U8StringValueType class ROSIDLC_WStringValueType : public U16StringValueType { public: - using type = rosidl_generator_c__U16String; + using type = rosidl_runtime_c__U16String; TypedSpan data(const void * ptr) const override { diff --git a/rmw_cyclonedds_cpp/src/u16string.cpp b/rmw_cyclonedds_cpp/src/u16string.cpp index ec0d4540..562041ad 100644 --- a/rmw_cyclonedds_cpp/src/u16string.cpp +++ b/rmw_cyclonedds_cpp/src/u16string.cpp @@ -13,7 +13,7 @@ // limitations under the License. #include -#include "rosidl_generator_c/u16string_functions.h" +#include "rosidl_runtime_c/u16string_functions.h" namespace rmw_cyclonedds_cpp { @@ -39,7 +39,7 @@ bool wstring_to_u16string(const std::wstring & wstr, std::u16string & u16str) return true; } -void u16string_to_wstring(const rosidl_generator_c__U16String & u16str, std::wstring & wstr) +void u16string_to_wstring(const rosidl_runtime_c__U16String & u16str, std::wstring & wstr) { wstr.resize(u16str.size); for (size_t i = 0; i < u16str.size; ++i) { @@ -47,9 +47,9 @@ void u16string_to_wstring(const rosidl_generator_c__U16String & u16str, std::wst } } -bool wstring_to_u16string(const std::wstring & wstr, rosidl_generator_c__U16String & u16str) +bool wstring_to_u16string(const std::wstring & wstr, rosidl_runtime_c__U16String & u16str) { - bool succeeded = rosidl_generator_c__U16String__resize(&u16str, wstr.size()); + bool succeeded = rosidl_runtime_c__U16String__resize(&u16str, wstr.size()); if (!succeeded) { return false; }