diff --git a/include/fastdds/dds/builtin/typelookup/common/TypeLookupTypes.hpp b/include/fastdds/dds/builtin/typelookup/common/TypeLookupTypes.hpp index 2542c41ba0e..11d1ca42bf1 100644 --- a/include/fastdds/dds/builtin/typelookup/common/TypeLookupTypes.hpp +++ b/include/fastdds/dds/builtin/typelookup/common/TypeLookupTypes.hpp @@ -138,7 +138,8 @@ class TypeLookup_getTypes_Result FASTDDS_EXPORTED_API TypeLookup_getTypes_Out& result(); #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, + "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") FASTDDS_EXPORTED_API static size_t getCdrSerializedSize( const TypeLookup_getTypes_Result& data, @@ -187,7 +188,8 @@ class TypeLookup_getTypeDependencies_In FASTDDS_EXPORTED_API void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_In::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, + "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_In::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") FASTDDS_EXPORTED_API void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -221,7 +223,8 @@ class TypeLookup_getTypeDependencies_Out FASTDDS_EXPORTED_API void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Out::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, + "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Out::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") FASTDDS_EXPORTED_API void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -279,12 +282,14 @@ class TypeLookup_getTypeDependencies_Result const TypeLookup_getTypeDependencies_Result& data, size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Result::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, + "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Result::serialize()", "In favor of version using eprosima::fastcdr::serialize.") FASTDDS_EXPORTED_API void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Result::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, + "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Result::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") FASTDDS_EXPORTED_API void deserialize( eprosima::fastcdr::Cdr& cdr); diff --git a/include/fastdds/rtps/common/FragmentNumber.h b/include/fastdds/rtps/common/FragmentNumber.h index 49d7b717356..976b3b990d5 100644 --- a/include/fastdds/rtps/common/FragmentNumber.h +++ b/include/fastdds/rtps/common/FragmentNumber.h @@ -27,9 +27,9 @@ #include #include -namespace eprosima{ -namespace fastrtps{ -namespace rtps{ +namespace eprosima { +namespace fastrtps { +namespace rtps { using FragmentNumber_t = uint32_t; @@ -37,19 +37,21 @@ using FragmentNumber_t = uint32_t; //!@ingroup COMMON_MODULE using FragmentNumberSet_t = BitmapRange; -inline std::ostream& operator<<(std::ostream& output, const FragmentNumberSet_t& fns) +inline std::ostream& operator <<( + std::ostream& output, + const FragmentNumberSet_t& fns) { output << fns.base() << ":"; fns.for_each([&](FragmentNumber_t it) - { - output << it << "-"; - }); + { + output << it << "-"; + }); return output; } -} -} -} +} // namespace rtps +} // namespace fastrtps +} // namespace eprosima #endif /* _FASTDDS_RTPS_RPTS_ELEM_FRAGNUM_H_ */ diff --git a/include/fastdds/rtps/common/MatchingInfo.h b/include/fastdds/rtps/common/MatchingInfo.h index acce98233f9..50025f870f9 100644 --- a/include/fastdds/rtps/common/MatchingInfo.h +++ b/include/fastdds/rtps/common/MatchingInfo.h @@ -22,9 +22,9 @@ #include -namespace eprosima{ -namespace fastrtps{ -namespace rtps{ +namespace eprosima { +namespace fastrtps { +namespace rtps { /** * @enum MatchingStatus, indicates whether the matched publication/subscription method of the PublisherListener or SubscriberListener has @@ -32,10 +32,12 @@ namespace rtps{ * @ingroup COMMON_MODULE */ #if defined(_WIN32) - enum FASTDDS_EXPORTED_API MatchingStatus{ +enum FASTDDS_EXPORTED_API MatchingStatus +{ #else - enum MatchingStatus{ -#endif +enum MatchingStatus +{ +#endif // if defined(_WIN32) MATCHED_MATCHING,//!< MATCHED_MATCHING, new publisher/subscriber found REMOVED_MATCHING //!< REMOVED_MATCHING, publisher/subscriber removed @@ -48,21 +50,36 @@ namespace rtps{ class FASTDDS_EXPORTED_API MatchingInfo { public: + //!Default constructor - MatchingInfo():status(MATCHED_MATCHING){}; + MatchingInfo() + : status(MATCHED_MATCHING) + { + } + /** - * @param stat Status - * @param guid GUID - */ - MatchingInfo(MatchingStatus stat,const GUID_t&guid):status(stat),remoteEndpointGuid(guid){}; - ~MatchingInfo(){}; + * @param stat Status + * @param guid GUID + */ + MatchingInfo( + MatchingStatus stat, + const GUID_t& guid) + : status(stat) + , remoteEndpointGuid(guid) + { + } + + ~MatchingInfo() + { + } + //!Status MatchingStatus status; //!Remote endpoint GUID GUID_t remoteEndpointGuid; }; -} -} -} +} // namespace rtps +} // namespace fastrtps +} // namespace eprosima #endif /* _FASTDDS_RTPS_MATCHINGINFO_H_ */ diff --git a/include/fastdds/rtps/common/Token.h b/include/fastdds/rtps/common/Token.h index 69cf13b8297..3f4bebc7b37 100644 --- a/include/fastdds/rtps/common/Token.h +++ b/include/fastdds/rtps/common/Token.h @@ -28,90 +28,102 @@ namespace rtps { class DataHolder { - public: - - DataHolder() {} - - DataHolder(const DataHolder& data_holder) : - class_id_(data_holder.class_id_), - properties_(data_holder.properties_), - binary_properties_(data_holder.binary_properties_) {} - - DataHolder(DataHolder&& data_holder) : - class_id_(data_holder.class_id_), - properties_(data_holder.properties_), - binary_properties_(data_holder.binary_properties_) {} - - DataHolder& operator=(const DataHolder& data_holder) - { - class_id_ = data_holder.class_id_; - properties_ = data_holder.properties_; - binary_properties_ = data_holder.binary_properties_; - - return *this; - } - - DataHolder& operator=(DataHolder&& data_holder) - { - class_id_ = std::move(data_holder.class_id_); - properties_ = std::move(data_holder.properties_); - binary_properties_ = std::move(data_holder.binary_properties_); - - return *this; - } - - bool is_nil() const - { - return class_id_.empty(); - } - - void class_id(const std::string& class_id) - { - class_id_ = class_id; - } - - void class_id(std::string&& class_id) - { - class_id_ = std::move(class_id); - } - - std::string& class_id() - { - return class_id_; - } - - const std::string& class_id() const - { - return class_id_; - } - - const PropertySeq& properties() const - { - return properties_; - } - - PropertySeq& properties() - { - return properties_; - } - - const BinaryPropertySeq& binary_properties() const - { - return binary_properties_; - } - - BinaryPropertySeq& binary_properties() - { - return binary_properties_; - } - - private: - - std::string class_id_; - - PropertySeq properties_; - - BinaryPropertySeq binary_properties_; +public: + + DataHolder() + { + } + + DataHolder( + const DataHolder& data_holder) + : class_id_(data_holder.class_id_) + , properties_(data_holder.properties_) + , binary_properties_(data_holder.binary_properties_) + { + } + + DataHolder( + DataHolder&& data_holder) + : class_id_(data_holder.class_id_) + , properties_(data_holder.properties_) + , binary_properties_(data_holder.binary_properties_) + { + } + + DataHolder& operator =( + const DataHolder& data_holder) + { + class_id_ = data_holder.class_id_; + properties_ = data_holder.properties_; + binary_properties_ = data_holder.binary_properties_; + + return *this; + } + + DataHolder& operator =( + DataHolder&& data_holder) + { + class_id_ = std::move(data_holder.class_id_); + properties_ = std::move(data_holder.properties_); + binary_properties_ = std::move(data_holder.binary_properties_); + + return *this; + } + + bool is_nil() const + { + return class_id_.empty(); + } + + void class_id( + const std::string& class_id) + { + class_id_ = class_id; + } + + void class_id( + std::string&& class_id) + { + class_id_ = std::move(class_id); + } + + std::string& class_id() + { + return class_id_; + } + + const std::string& class_id() const + { + return class_id_; + } + + const PropertySeq& properties() const + { + return properties_; + } + + PropertySeq& properties() + { + return properties_; + } + + const BinaryPropertySeq& binary_properties() const + { + return binary_properties_; + } + + BinaryPropertySeq& binary_properties() + { + return binary_properties_; + } + +private: + + std::string class_id_; + + PropertySeq properties_; + + BinaryPropertySeq binary_properties_; }; typedef std::vector DataHolderSeq; @@ -124,31 +136,57 @@ typedef Token PermissionsCredentialToken; class DataHolderHelper { - public: +public: - static std::string* find_property_value(DataHolder& data_holder, const std::string& name); + static std::string* find_property_value( + DataHolder& data_holder, + const std::string& name); - static const std::string* find_property_value(const DataHolder& data_holder, const std::string& name); + static const std::string* find_property_value( + const DataHolder& data_holder, + const std::string& name); - static Property* find_property(DataHolder& data_holder, const std::string& name); + static Property* find_property( + DataHolder& data_holder, + const std::string& name); - static const Property* find_property(const DataHolder& data_holder, const std::string& name); + static const Property* find_property( + const DataHolder& data_holder, + const std::string& name); - static std::vector* find_binary_property_value(DataHolder& data_holder, const std::string& name); + static std::vector* find_binary_property_value( + DataHolder& data_holder, + const std::string& name); - static const std::vector* find_binary_property_value(const DataHolder& data_holder, const std::string& name); + static const std::vector* find_binary_property_value( + const DataHolder& data_holder, + const std::string& name); - static BinaryProperty* find_binary_property(DataHolder& data_holder, const std::string& name); + static BinaryProperty* find_binary_property( + DataHolder& data_holder, + const std::string& name); - static const BinaryProperty* find_binary_property(const DataHolder& data_holder, const std::string& name); + static const BinaryProperty* find_binary_property( + const DataHolder& data_holder, + const std::string& name); - static size_t serialized_size(const DataHolder& data_holder, size_t current_alignment = 0); + static size_t serialized_size( + const DataHolder& data_holder, + size_t current_alignment = 0); - static size_t serialized_size(const DataHolderSeq& data_holders, size_t current_alignment = 0); + static size_t serialized_size( + const DataHolderSeq& data_holders, + size_t current_alignment = 0); - private: +private: + + inline static size_t alignment( + size_t current_alignment, + size_t dataSize) + { + return (dataSize - (current_alignment % dataSize)) & (dataSize - 1); + } - inline static size_t alignment(size_t current_alignment, size_t dataSize) { return (dataSize - (current_alignment % dataSize)) & (dataSize-1);} }; } //namespace rtps diff --git a/include/fastdds/rtps/exceptions/Exception.h b/include/fastdds/rtps/exceptions/Exception.h index e73e148f7ec..81eefd68ed7 100644 --- a/include/fastdds/rtps/exceptions/Exception.h +++ b/include/fastdds/rtps/exceptions/Exception.h @@ -32,77 +32,87 @@ namespace rtps { */ class Exception : public std::exception { - public: - - FASTDDS_EXPORTED_API Exception(){}; - - /// @brief Default destructor. - virtual FASTDDS_EXPORTED_API ~Exception() throw(); - - /** - * @brief This function returns the number associated with the system exception. - * @return The number associated with the system exception. - */ - FASTDDS_EXPORTED_API const int32_t& minor() const; - - /** - * @brief This function sets the number that will be associated with the system exception. - * @param minor The number that will be associated with the system exception. - */ - FASTDDS_EXPORTED_API void minor(const int32_t &minor); - - /// @brief This function throws the object as exception. - virtual FASTDDS_EXPORTED_API void raise() const = 0; - - /** - * @brief This function returns the error message. - * @return The error message. - */ - virtual FASTDDS_EXPORTED_API const char* what() const throw(); - - protected: - - /** - * @brief Default constructor. - */ - FASTDDS_EXPORTED_API explicit Exception(const char* const& message); - - /** - * @brief Default copy constructor. - * @param ex Exception that will be copied. - */ - FASTDDS_EXPORTED_API Exception(const Exception &ex); - - /** - * @brief Default move constructor. - * @param ex Exception that will be moved. - */ - FASTDDS_EXPORTED_API Exception(Exception&& ex); - - /** - * @brief Constructor. - * @param message An error message. This message is copied. - * @param minor The number that will be associated with the system exception. - */ - FASTDDS_EXPORTED_API explicit Exception(const char* const& message, const int32_t minor); - - /** - * @brief Assigment operation. - * @param ex Exception that will be copied. - */ - FASTDDS_EXPORTED_API Exception& operator=(const Exception& ex); - - /** - * @brief Assigment operation. - * @param ex Exception that will be moved. - */ - FASTDDS_EXPORTED_API Exception& operator=(Exception&& ex); - - private: - - std::string message_; - - int32_t minor_; +public: + + FASTDDS_EXPORTED_API Exception() + { + } + + /// @brief Default destructor. + virtual FASTDDS_EXPORTED_API ~Exception() throw(); + + /** + * @brief This function returns the number associated with the system exception. + * @return The number associated with the system exception. + */ + FASTDDS_EXPORTED_API const int32_t& minor() const; + + /** + * @brief This function sets the number that will be associated with the system exception. + * @param minor The number that will be associated with the system exception. + */ + FASTDDS_EXPORTED_API void minor( + const int32_t& minor); + + /// @brief This function throws the object as exception. + virtual FASTDDS_EXPORTED_API void raise() const = 0; + + /** + * @brief This function returns the error message. + * @return The error message. + */ + virtual FASTDDS_EXPORTED_API const char* what() const throw(); + +protected: + + /** + * @brief Default constructor. + */ + FASTDDS_EXPORTED_API explicit Exception( + const char* const& message); + + /** + * @brief Default copy constructor. + * @param ex Exception that will be copied. + */ + FASTDDS_EXPORTED_API Exception( + const Exception& ex); + + /** + * @brief Default move constructor. + * @param ex Exception that will be moved. + */ + FASTDDS_EXPORTED_API Exception( + Exception&& ex); + + /** + * @brief Constructor. + * @param message An error message. This message is copied. + * @param minor The number that will be associated with the system exception. + */ + FASTDDS_EXPORTED_API explicit Exception( + const char* const& message, + const int32_t minor); + + /** + * @brief Assigment operation. + * @param ex Exception that will be copied. + */ + FASTDDS_EXPORTED_API Exception& operator =( + const Exception& ex); + + /** + * @brief Assigment operation. + * @param ex Exception that will be moved. + */ + FASTDDS_EXPORTED_API Exception& operator =( + Exception&& ex); + +private: + + std::string message_; + + int32_t minor_; }; } // namespace rtps diff --git a/include/fastdds/rtps/security/exceptions/SecurityException.h b/include/fastdds/rtps/security/exceptions/SecurityException.h index 266a4815f2c..0838f4035fd 100644 --- a/include/fastdds/rtps/security/exceptions/SecurityException.h +++ b/include/fastdds/rtps/security/exceptions/SecurityException.h @@ -31,45 +31,55 @@ namespace security { */ class SecurityException : public Exception { - public: +public: - FASTDDS_EXPORTED_API SecurityException() {} + FASTDDS_EXPORTED_API SecurityException() + { + } - /** - * @brief Default constructor. - * @param message An error message. This message is copied. - */ - FASTDDS_EXPORTED_API SecurityException(const std::string& message) : Exception(message.c_str(), 1) {} + /** + * @brief Default constructor. + * @param message An error message. This message is copied. + */ + FASTDDS_EXPORTED_API SecurityException( + const std::string& message) + : Exception(message.c_str(), 1) + { + } - /** - * @brief Default copy constructor. - * @param ex SecurityException that will be copied. - */ - FASTDDS_EXPORTED_API SecurityException(const SecurityException &ex); + /** + * @brief Default copy constructor. + * @param ex SecurityException that will be copied. + */ + FASTDDS_EXPORTED_API SecurityException( + const SecurityException& ex); - /** - * @brief Default move constructor. - * @param ex SecurityException that will be moved. - */ - FASTDDS_EXPORTED_API SecurityException(SecurityException&& ex); + /** + * @brief Default move constructor. + * @param ex SecurityException that will be moved. + */ + FASTDDS_EXPORTED_API SecurityException( + SecurityException&& ex); - /** - * @brief Assigment operation. - * @param ex SecurityException that will be copied. - */ - FASTDDS_EXPORTED_API SecurityException& operator=(const SecurityException &ex); + /** + * @brief Assigment operation. + * @param ex SecurityException that will be copied. + */ + FASTDDS_EXPORTED_API SecurityException& operator =( + const SecurityException& ex); - /** - * @brief Assigment operation. - * @param ex SecurityException that will be moved. - */ - FASTDDS_EXPORTED_API SecurityException& operator=(SecurityException&& ex); + /** + * @brief Assigment operation. + * @param ex SecurityException that will be moved. + */ + FASTDDS_EXPORTED_API SecurityException& operator =( + SecurityException&& ex); - /// \brief Default constructor - virtual FASTDDS_EXPORTED_API ~SecurityException() throw(); + /// \brief Default constructor + virtual FASTDDS_EXPORTED_API ~SecurityException() throw(); - /// \brief This function throws the object as an exception. - virtual FASTDDS_EXPORTED_API void raise() const; + /// \brief This function throws the object as an exception. + virtual FASTDDS_EXPORTED_API void raise() const; }; } // namespace security } // namespace rtps diff --git a/include/fastdds/rtps/writer/WriterDiscoveryInfo.h b/include/fastdds/rtps/writer/WriterDiscoveryInfo.h index c61a380774e..9167f72a09a 100644 --- a/include/fastdds/rtps/writer/WriterDiscoveryInfo.h +++ b/include/fastdds/rtps/writer/WriterDiscoveryInfo.h @@ -65,8 +65,8 @@ struct WriterDiscoveryInfo const WriterProxyData& info; }; -} -} -} +} // namespace rtps +} // namespace fastrtps +} // namespace eprosima #endif // _RTPS_WRITER_WRITERDISCOVERYINFO_H_ diff --git a/include/fastrtps/participant/Participant.h b/include/fastrtps/participant/Participant.h index a4d0ce211a4..d79557cf6f4 100644 --- a/include/fastrtps/participant/Participant.h +++ b/include/fastrtps/participant/Participant.h @@ -26,18 +26,17 @@ #include namespace eprosima { -namespace fastrtps{ +namespace fastrtps { class ParticipantImpl; class ParticipantAttributes; -namespace rtps -{ - class WriterProxyData; - class ReaderProxyData; - class ResourceEvent; - class RTPSParticipant; -} +namespace rtps { +class WriterProxyData; +class ReaderProxyData; +class ResourceEvent; +class RTPSParticipant; +} // namespace rtps /** * Class Participant used to group Publishers and Subscribers into a single working unit. @@ -45,60 +44,62 @@ namespace rtps */ class FASTDDS_EXPORTED_API Participant { - public: - /** - * Get the rtps::GUID_t of the associated RTPSParticipant. - * @return rtps::GUID_t - */ - const rtps::GUID_t& getGuid() const; - - /** - * Get the ParticipantAttributes. - * @return ParticipantAttributes. - */ - const ParticipantAttributes& getAttributes() const; - - /** - * Called when using a StaticEndpointDiscovery mechanism different that the one - * included in FastRTPS, for example when communicating with other implementations. - * It indicates to the Participant that an Endpoint from the XML has been discovered and - * should be activated. - * @param partguid Participant rtps::GUID_t. - * @param userId User defined ID as shown in the XML file. - * @param kind EndpointKind (WRITER or READER) - * @return True if correctly found and activated. - */ - bool newRemoteEndpointDiscovered( - const rtps::GUID_t& partguid, - uint16_t userId, - rtps::EndpointKind_t kind); - - /** - * Returns a list with the participant names. - * @return list of participant names. - */ - std::vector getParticipantNames() const; - - /** - * @brief Asserts liveliness of manual by participant publishers - */ - void assert_liveliness(); - - rtps::ResourceEvent& get_resource_event() const; - - private: - Participant(); - - virtual ~Participant(); - - ParticipantImpl* mp_impl; - - friend class Domain; - - friend class ParticipantImpl; +public: + + /** + * Get the rtps::GUID_t of the associated RTPSParticipant. + * @return rtps::GUID_t + */ + const rtps::GUID_t& getGuid() const; + + /** + * Get the ParticipantAttributes. + * @return ParticipantAttributes. + */ + const ParticipantAttributes& getAttributes() const; + + /** + * Called when using a StaticEndpointDiscovery mechanism different that the one + * included in FastRTPS, for example when communicating with other implementations. + * It indicates to the Participant that an Endpoint from the XML has been discovered and + * should be activated. + * @param partguid Participant rtps::GUID_t. + * @param userId User defined ID as shown in the XML file. + * @param kind EndpointKind (WRITER or READER) + * @return True if correctly found and activated. + */ + bool newRemoteEndpointDiscovered( + const rtps::GUID_t& partguid, + uint16_t userId, + rtps::EndpointKind_t kind); + + /** + * Returns a list with the participant names. + * @return list of participant names. + */ + std::vector getParticipantNames() const; + + /** + * @brief Asserts liveliness of manual by participant publishers + */ + void assert_liveliness(); + + rtps::ResourceEvent& get_resource_event() const; + +private: + + Participant(); + + virtual ~Participant(); + + ParticipantImpl* mp_impl; + + friend class Domain; + + friend class ParticipantImpl; }; -} +} // namespace fastrtps } /* namespace eprosima */ #endif /* PARTICIPANT_H_ */ diff --git a/include/fastrtps/types/DynamicDataFactory.h b/include/fastrtps/types/DynamicDataFactory.h index 875f4323cd1..a5ea5b6837a 100644 --- a/include/fastrtps/types/DynamicDataFactory.h +++ b/include/fastrtps/types/DynamicDataFactory.h @@ -31,6 +31,7 @@ namespace types { class DynamicDataFactory { protected: + DynamicDataFactory(); ReturnCode_t create_members( @@ -40,22 +41,27 @@ class DynamicDataFactory #ifndef DISABLE_DYNAMIC_MEMORY_CHECK std::vector dynamic_datas_; mutable std::recursive_mutex mutex_; -#endif +#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK public: + ~DynamicDataFactory(); FASTDDS_EXPORTED_API static DynamicDataFactory* get_instance(); FASTDDS_EXPORTED_API static ReturnCode_t delete_instance(); - FASTDDS_EXPORTED_API DynamicData* create_data(DynamicTypeBuilder* pBuilder); + FASTDDS_EXPORTED_API DynamicData* create_data( + DynamicTypeBuilder* pBuilder); - FASTDDS_EXPORTED_API DynamicData* create_data(DynamicType_ptr pType); + FASTDDS_EXPORTED_API DynamicData* create_data( + DynamicType_ptr pType); - FASTDDS_EXPORTED_API DynamicData* create_copy(const DynamicData* pData); + FASTDDS_EXPORTED_API DynamicData* create_copy( + const DynamicData* pData); - FASTDDS_EXPORTED_API ReturnCode_t delete_data(DynamicData* pData); + FASTDDS_EXPORTED_API ReturnCode_t delete_data( + DynamicData* pData); FASTDDS_EXPORTED_API bool is_empty() const; }; diff --git a/include/fastrtps/types/DynamicDataPtr.h b/include/fastrtps/types/DynamicDataPtr.h index e1e4e054bcf..63075aa33ba 100644 --- a/include/fastrtps/types/DynamicDataPtr.h +++ b/include/fastrtps/types/DynamicDataPtr.h @@ -29,8 +29,8 @@ class DynamicData_ptr : public std::shared_ptr typedef std::shared_ptr Base; - using Base::operator->; - using Base::operator*; + using Base::operator ->; + using Base::operator *; using Base::operator bool; FASTDDS_EXPORTED_API DynamicData_ptr() diff --git a/include/fastrtps/types/DynamicTypeBuilder.h b/include/fastrtps/types/DynamicTypeBuilder.h index ccdc0f95bb4..4dca61cb0e7 100644 --- a/include/fastrtps/types/DynamicTypeBuilder.h +++ b/include/fastrtps/types/DynamicTypeBuilder.h @@ -31,11 +31,14 @@ class DynamicTypeMember; class DynamicTypeBuilder { protected: + DynamicTypeBuilder(); - DynamicTypeBuilder(const DynamicTypeBuilder* builder); + DynamicTypeBuilder( + const DynamicTypeBuilder* builder); - DynamicTypeBuilder(const TypeDescriptor* descriptor); + DynamicTypeBuilder( + const TypeDescriptor* descriptor); virtual ~DynamicTypeBuilder(); @@ -60,23 +63,28 @@ class DynamicTypeBuilder const std::string& key, const std::string& value); - bool check_union_configuration(const MemberDescriptor* descriptor); + bool check_union_configuration( + const MemberDescriptor* descriptor); // Checks if there is a member with the given name. - bool exists_member_by_name(const std::string& name) const; + bool exists_member_by_name( + const std::string& name) const; void refresh_member_ids(); void clear(); - ReturnCode_t copy_from_builder(const DynamicTypeBuilder* other); + ReturnCode_t copy_from_builder( + const DynamicTypeBuilder* other); public: + FASTDDS_EXPORTED_API ReturnCode_t add_empty_member( uint32_t index, const std::string& name); - FASTDDS_EXPORTED_API ReturnCode_t add_member(const MemberDescriptor* descriptor); + FASTDDS_EXPORTED_API ReturnCode_t add_member( + const MemberDescriptor* descriptor); FASTDDS_EXPORTED_API ReturnCode_t add_member( MemberId id, @@ -100,7 +108,7 @@ class DynamicTypeBuilder FASTDDS_EXPORTED_API ReturnCode_t add_member( MemberId id, const std::string& name, - DynamicType_ptr type_ = DynamicType_ptr(nullptr)); + DynamicType_ptr type_ = DynamicType_ptr(nullptr)); FASTDDS_EXPORTED_API ReturnCode_t add_member( MemberId id, @@ -116,7 +124,8 @@ class DynamicTypeBuilder const std::vector& unionLabels, bool isDefaultLabel); - FASTDDS_EXPORTED_API ReturnCode_t apply_annotation(AnnotationDescriptor& descriptor); + FASTDDS_EXPORTED_API ReturnCode_t apply_annotation( + AnnotationDescriptor& descriptor); FASTDDS_EXPORTED_API ReturnCode_t apply_annotation( const std::string& annotation_name, @@ -135,9 +144,11 @@ class DynamicTypeBuilder FASTDDS_EXPORTED_API DynamicType_ptr build(); - FASTDDS_EXPORTED_API ReturnCode_t copy_from(const DynamicTypeBuilder* other); + FASTDDS_EXPORTED_API ReturnCode_t copy_from( + const DynamicTypeBuilder* other); - ReturnCode_t get_all_members(std::map& members); + ReturnCode_t get_all_members( + std::map& members); FASTDDS_EXPORTED_API inline TypeKind get_kind() const { @@ -146,7 +157,8 @@ class DynamicTypeBuilder FASTDDS_EXPORTED_API std::string get_name() const; - FASTDDS_EXPORTED_API MemberId get_member_id_by_name(const std::string& name) const; + FASTDDS_EXPORTED_API MemberId get_member_id_by_name( + const std::string& name) const; const TypeDescriptor* get_type_descriptor() const { @@ -157,7 +169,8 @@ class DynamicTypeBuilder bool is_discriminator_type() const; - FASTDDS_EXPORTED_API ReturnCode_t set_name(const std::string& name); + FASTDDS_EXPORTED_API ReturnCode_t set_name( + const std::string& name); }; } // namespace types diff --git a/include/fastrtps/types/MemberDescriptor.h b/include/fastrtps/types/MemberDescriptor.h index 7d03a0b82fa..f6f1fc69706 100644 --- a/include/fastrtps/types/MemberDescriptor.h +++ b/include/fastrtps/types/MemberDescriptor.h @@ -18,9 +18,9 @@ #include #include -namespace eprosima{ -namespace fastrtps{ -namespace types{ +namespace eprosima { +namespace fastrtps { +namespace types { class DynamicType; class AnnotationDescriptor; @@ -28,6 +28,7 @@ class AnnotationDescriptor; class MemberDescriptor { protected: + std::string name_; // Name of the member MemberId id_; // MemberId, it should be filled automatically when the member is added. DynamicType_ptr type_; // Member's Type. @@ -43,11 +44,14 @@ class MemberDescriptor friend class DynamicTypeMember; friend class TypeObjectFactory; - bool is_default_value_consistent(const std::string& sDefaultValue) const; + bool is_default_value_consistent( + const std::string& sDefaultValue) const; - bool is_type_name_consistent(const std::string& sName) const; + bool is_type_name_consistent( + const std::string& sName) const; public: + FASTDDS_EXPORTED_API MemberDescriptor(); FASTDDS_EXPORTED_API MemberDescriptor( @@ -73,21 +77,25 @@ class MemberDescriptor const std::vector& unionLabels, bool isDefaultLabel); - FASTDDS_EXPORTED_API MemberDescriptor(const MemberDescriptor* descriptor); + FASTDDS_EXPORTED_API MemberDescriptor( + const MemberDescriptor* descriptor); FASTDDS_EXPORTED_API ~MemberDescriptor(); - bool check_union_labels(const std::vector& labels) const; + bool check_union_labels( + const std::vector& labels) const; - FASTDDS_EXPORTED_API ReturnCode_t copy_from(const MemberDescriptor* other); + FASTDDS_EXPORTED_API ReturnCode_t copy_from( + const MemberDescriptor* other); - FASTDDS_EXPORTED_API bool equals(const MemberDescriptor* other) const; + FASTDDS_EXPORTED_API bool equals( + const MemberDescriptor* other) const; FASTDDS_EXPORTED_API TypeKind get_kind() const; FASTDDS_EXPORTED_API MemberId get_id() const; - FASTDDS_EXPORTED_API uint32_t get_index() const; + FASTDDS_EXPORTED_API uint32_t get_index() const; FASTDDS_EXPORTED_API std::string get_name() const; @@ -105,39 +113,49 @@ class MemberDescriptor FASTDDS_EXPORTED_API bool is_default_union_value() const; - FASTDDS_EXPORTED_API bool is_consistent(TypeKind parentKind) const; + FASTDDS_EXPORTED_API bool is_consistent( + TypeKind parentKind) const; - FASTDDS_EXPORTED_API void add_union_case_index(uint64_t value); + FASTDDS_EXPORTED_API void add_union_case_index( + uint64_t value); - FASTDDS_EXPORTED_API void set_id(MemberId id); + FASTDDS_EXPORTED_API void set_id( + MemberId id); - FASTDDS_EXPORTED_API void set_index(uint32_t index); + FASTDDS_EXPORTED_API void set_index( + uint32_t index); - FASTDDS_EXPORTED_API void set_name(const std::string& name); + FASTDDS_EXPORTED_API void set_name( + const std::string& name); - FASTDDS_EXPORTED_API void set_type(DynamicType_ptr type); + FASTDDS_EXPORTED_API void set_type( + DynamicType_ptr type); FASTDDS_EXPORTED_API DynamicType_ptr get_type() const { return type_; } - FASTDDS_EXPORTED_API void set_default_union_value(bool bDefault); + FASTDDS_EXPORTED_API void set_default_union_value( + bool bDefault); - FASTDDS_EXPORTED_API void set_default_value(const std::string& value) + FASTDDS_EXPORTED_API void set_default_value( + const std::string& value) { default_value_ = value; } // Annotations - ReturnCode_t apply_annotation(AnnotationDescriptor& descriptor); + ReturnCode_t apply_annotation( + AnnotationDescriptor& descriptor); ReturnCode_t apply_annotation( const std::string& annotation_name, const std::string& key, const std::string& value); - AnnotationDescriptor* get_annotation(const std::string& name) const; + AnnotationDescriptor* get_annotation( + const std::string& name) const; // Annotations application FASTDDS_EXPORTED_API bool annotation_is_optional() const; @@ -168,23 +186,31 @@ class MemberDescriptor FASTDDS_EXPORTED_API uint16_t annotation_get_bit_bound() const; // Annotations setters - FASTDDS_EXPORTED_API void annotation_set_optional(bool optional); + FASTDDS_EXPORTED_API void annotation_set_optional( + bool optional); - FASTDDS_EXPORTED_API void annotation_set_key(bool key); + FASTDDS_EXPORTED_API void annotation_set_key( + bool key); - FASTDDS_EXPORTED_API void annotation_set_must_understand(bool must_understand); + FASTDDS_EXPORTED_API void annotation_set_must_understand( + bool must_understand); - FASTDDS_EXPORTED_API void annotation_set_non_serialized(bool non_serialized); + FASTDDS_EXPORTED_API void annotation_set_non_serialized( + bool non_serialized); - FASTDDS_EXPORTED_API void annotation_set_value(const std::string& value); + FASTDDS_EXPORTED_API void annotation_set_value( + const std::string& value); - FASTDDS_EXPORTED_API void annotation_set_default(const std::string& default_value); + FASTDDS_EXPORTED_API void annotation_set_default( + const std::string& default_value); FASTDDS_EXPORTED_API void annotation_set_default_literal(); - FASTDDS_EXPORTED_API void annotation_set_position(uint16_t position); + FASTDDS_EXPORTED_API void annotation_set_position( + uint16_t position); - FASTDDS_EXPORTED_API void annotation_set_bit_bound(uint16_t bit_bound); + FASTDDS_EXPORTED_API void annotation_set_bit_bound( + uint16_t bit_bound); }; } // namespace types diff --git a/include/fastrtps/types/TypeObjectFactory.h b/include/fastrtps/types/TypeObjectFactory.h index 946dee92015..4d935923df4 100644 --- a/include/fastrtps/types/TypeObjectFactory.h +++ b/include/fastrtps/types/TypeObjectFactory.h @@ -28,11 +28,13 @@ namespace types { class TypeObjectFactory { private: + mutable std::recursive_mutex m_MutexIdentifiers; mutable std::recursive_mutex m_MutexObjects; mutable std::recursive_mutex m_MutexInformations; protected: + TypeObjectFactory(); mutable std::map identifiers_; // Basic, builtin and EK_MINIMAL std::map complete_identifiers_; // Only EK_COMPLETE @@ -122,6 +124,7 @@ class TypeObjectFactory const TypeIdentifier* identifier) const; public: + FASTDDS_EXPORTED_API static TypeObjectFactory* get_instance(); FASTDDS_EXPORTED_API static ReturnCode_t delete_instance(); @@ -134,7 +137,7 @@ class TypeObjectFactory * @return */ FASTDDS_EXPORTED_API const TypeInformation* get_type_information( - const std::string &type_name) const; + const std::string& type_name) const; /** * @brief get_type_information Retrieves the TypeInformation of the given TypeIdentifier. @@ -181,7 +184,7 @@ class TypeObjectFactory FASTDDS_EXPORTED_API const TypeIdentifier* get_array_identifier( const std::string& type_name, - const std::vector &bound, + const std::vector& bound, bool complete = false); FASTDDS_EXPORTED_API const TypeIdentifier* get_map_identifier( diff --git a/include/fastrtps/utils/md5.h b/include/fastrtps/utils/md5.h index b3e1bfefe1b..4842bee38fd 100644 --- a/include/fastrtps/utils/md5.h +++ b/include/fastrtps/utils/md5.h @@ -1,6 +1,6 @@ /* MD5 - converted to C++ class by Frank Thilo (thilo@unix-ag.org) - for bzflag (http://www.bzflag.org) + converted to C++ class by Frank Thilo (thilo@unix-ag.org) + for bzflag (http://www.bzflag.org) based on: @@ -8,27 +8,27 @@ reference implementation of RFC 1321 Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All -rights reserved. + rights reserved. -License to copy and use this software is granted provided that it -is identified as the "RSA Data Security, Inc. MD5 Message-Digest -Algorithm" in all material mentioning or referencing this software -or this function. + License to copy and use this software is granted provided that it + is identified as the "RSA Data Security, Inc. MD5 Message-Digest + Algorithm" in all material mentioning or referencing this software + or this function. -License is also granted to make and use derivative works provided -that such works are identified as "derived from the RSA Data -Security, Inc. MD5 Message-Digest Algorithm" in all material -mentioning or referencing the derived work. + License is also granted to make and use derivative works provided + that such works are identified as "derived from the RSA Data + Security, Inc. MD5 Message-Digest Algorithm" in all material + mentioning or referencing the derived work. -RSA Data Security, Inc. makes no representations concerning either -the merchantability of this software or the suitability of this -software for any particular purpose. It is provided "as is" -without express or implied warranty of any kind. + RSA Data Security, Inc. makes no representations concerning either + the merchantability of this software or the suitability of this + software for any particular purpose. It is provided "as is" + without express or implied warranty of any kind. -These notices must be retained in any copies of any part of this -documentation and/or software. + These notices must be retained in any copies of any part of this + documentation and/or software. -*/ + */ #ifndef BZF_MD5_H #define BZF_MD5_H @@ -39,63 +39,124 @@ documentation and/or software. #include /** -* Class MD5, for calculating MD5 hashes of strings or byte arrays -* it is not meant to be fast or secure -* -* usage: 1) feed it blocks of uchars with update() -* 2) finalize() -* 3) get hexdigest() string -* or -* MD5(std::string).hexdigest() -* -* assumes that char is 8 bit and int is 32 bit + * Class MD5, for calculating MD5 hashes of strings or byte arrays + * it is not meant to be fast or secure + * + * usage: 1) feed it blocks of uchars with update() + * 2) finalize() + * 3) get hexdigest() string + * or + * MD5(std::string).hexdigest() + * + * assumes that char is 8 bit and int is 32 bit * @ingroup UTILITIES_MODULE -*/ + */ class FASTDDS_EXPORTED_API MD5 { public: + typedef unsigned char uint1; // 8bit - typedef unsigned int size_type; // must be 32bit - - MD5(); - MD5(const std::string& text); - void update(const unsigned char *buf, size_type length); - void update(const char *buf, size_type length); - MD5& finalize(); - std::string hexdigest() const; - friend std::ostream& operator<<(std::ostream&, MD5& md5); + typedef unsigned int size_type; // must be 32bit + + MD5(); + MD5( + const std::string& text); + void update( + const unsigned char* buf, + size_type length); + void update( + const char* buf, + size_type length); + MD5& finalize(); + std::string hexdigest() const; + friend std::ostream& operator <<( + std::ostream&, + MD5& md5); uint1 digest[16]; // the result - void init(); -private: - - - typedef unsigned int uint4; // 32bit - enum {blocksize = 64}; // VC6 won't eat a const static int here - - void transform(const uint1 block[blocksize]); - static void decode(uint4 output[], const uint1 input[], size_type len); - static void encode(uint1 output[], const uint4 input[], size_type len); - - bool finalized; - uint1 buffer[blocksize]; // bytes that didn't fit in last 64 byte chunk - uint4 count[2]; // 64bit counter for number of bits (lo, hi) - uint4 state[4]; // digest so far + void init(); +private: - // low level logic operations - static inline uint4 F(uint4 x, uint4 y, uint4 z); - static inline uint4 G(uint4 x, uint4 y, uint4 z); - static inline uint4 H(uint4 x, uint4 y, uint4 z); - static inline uint4 I(uint4 x, uint4 y, uint4 z); - static inline uint4 rotate_left(uint4 x, int n); - static inline void FF(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); - static inline void GG(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); - static inline void HH(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); - static inline void II(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); + typedef unsigned int uint4; // 32bit + enum + { + blocksize = 64 + }; // VC6 won't eat a const static int here + + void transform( + const uint1 block[blocksize]); + static void decode( + uint4 output[], + const uint1 input[], + size_type len); + static void encode( + uint1 output[], + const uint4 input[], + size_type len); + + bool finalized; + uint1 buffer[blocksize]; // bytes that didn't fit in last 64 byte chunk + uint4 count[2]; // 64bit counter for number of bits (lo, hi) + uint4 state[4]; // digest so far + + + // low level logic operations + static inline uint4 F( + uint4 x, + uint4 y, + uint4 z); + static inline uint4 G( + uint4 x, + uint4 y, + uint4 z); + static inline uint4 H( + uint4 x, + uint4 y, + uint4 z); + static inline uint4 I( + uint4 x, + uint4 y, + uint4 z); + static inline uint4 rotate_left( + uint4 x, + int n); + static inline void FF( + uint4& a, + uint4 b, + uint4 c, + uint4 d, + uint4 x, + uint4 s, + uint4 ac); + static inline void GG( + uint4& a, + uint4 b, + uint4 c, + uint4 d, + uint4 x, + uint4 s, + uint4 ac); + static inline void HH( + uint4& a, + uint4 b, + uint4 c, + uint4 d, + uint4 x, + uint4 s, + uint4 ac); + static inline void II( + uint4& a, + uint4 b, + uint4 c, + uint4 d, + uint4 x, + uint4 s, + uint4 ac); }; -std::string md5(const std::string str); +std::string md5( + const std::string str); -#endif +#endif // ifndef BZF_MD5_H diff --git a/src/cpp/dynamic-types/TypeObjectCdrAux.ipp b/src/cpp/dynamic-types/TypeObjectCdrAux.ipp index db518536c54..aa592ec4abe 100644 --- a/src/cpp/dynamic-types/TypeObjectCdrAux.ipp +++ b/src/cpp/dynamic-types/TypeObjectCdrAux.ipp @@ -16,4997 +16,5154 @@ #define DYNAMIC_TYPES_TYPEOBJECTCDRAUX_IPP namespace eprosima { -namespace fastcdr { -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonStructMember& data, - size_t& current_alignment) -{ + namespace fastcdr { + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CommonStructMember& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - calculate_serialized_size(calculator, data.member_flags(), current_alignment); - calculate_serialized_size(calculator, data.member_type_id(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + calculate_serialized_size(calculator, data.member_flags(), current_alignment); + calculate_serialized_size(calculator, data.member_type_id(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.member_id(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.member_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.member_type_id(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.member_id(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.member_flags(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.member_type_id(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonStructMember& data) -{ - scdr << data.member_id(); + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CommonStructMember& data) + { + scdr << data.member_id(); #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.member_flags().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.member_flags().bitset().to_ulong()); + scdr << bits; #else - scdr << data.member_flags(); + scdr << data.member_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.member_type_id(); -} + scdr << data.member_type_id(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonStructMember& data) -{ - dcdr >> data.member_id(); + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CommonStructMember& data) + { + dcdr >> data.member_id(); #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.member_flags().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.member_flags().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.member_flags(); + dcdr >> data.member_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.member_type_id(); -} + dcdr >> data.member_type_id(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteMemberDetail& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteMemberDetail& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.name().size() + 1; - calculate_serialized_size(calculator, data.ann_builtin(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.name().size() + 1; + calculate_serialized_size(calculator, data.ann_builtin(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.ann_custom().size(); ++a) - { - calculate_serialized_size(calculator, data.ann_custom().at(a), current_alignment); - } + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.ann_custom().size(); ++a) + { + calculate_serialized_size(calculator, data.ann_custom().at(a), current_alignment); + } - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.name(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.ann_builtin(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.ann_custom(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.name(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.ann_builtin(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.ann_custom(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteMemberDetail& data) -{ - scdr << data.name(); - scdr << data.ann_builtin(); - scdr << data.ann_custom(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteMemberDetail& data) + { + scdr << data.name(); + scdr << data.ann_builtin(); + scdr << data.ann_custom(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteMemberDetail& data) -{ - dcdr >> data.name(); - dcdr >> data.ann_builtin(); - dcdr >> data.ann_custom(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteMemberDetail& data) + { + dcdr >> data.name(); + dcdr >> data.ann_builtin(); + dcdr >> data.ann_custom(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalMemberDetail& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalMemberDetail& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - static_cast(calculator); - static_cast(data); - size_t initial_alignment = current_alignment; + static_cast < void > (calculator); + static_cast < void > (data); + size_t initial_alignment = current_alignment; - current_alignment += ((4) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + current_alignment += ((4) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.name_hash(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.name_hash(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalMemberDetail& data) -{ - scdr << data.name_hash(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalMemberDetail& data) + { + scdr << data.name_hash(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalMemberDetail& data) -{ - dcdr >> data.name_hash(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalMemberDetail& data) + { + dcdr >> data.name_hash(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteStructMember& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteStructMember& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.common(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.detail(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteStructMember& data) -{ - scdr << data.common(); - scdr << data.detail(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteStructMember& data) + { + scdr << data.common(); + scdr << data.detail(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteStructMember& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteStructMember& data) + { + dcdr >> data.common(); + dcdr >> data.detail(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalStructMember& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalStructMember& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.common(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.detail(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalStructMember& data) -{ - scdr << data.common(); - scdr << data.detail(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalStructMember& data) + { + scdr << data.common(); + scdr << data.detail(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalStructMember& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalStructMember& data) + { + dcdr >> data.common(); + dcdr >> data.detail(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::AppliedBuiltinTypeAnnotations& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::AppliedBuiltinTypeAnnotations& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.verbatim(), current_alignment); + calculate_serialized_size(calculator, data.verbatim(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.verbatim(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::AppliedBuiltinTypeAnnotations& data) -{ - scdr << data.verbatim(); -} - -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::AppliedBuiltinTypeAnnotations& data) -{ - dcdr >> data.verbatim(); -} - -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator&, - const eprosima::fastrtps::types::MinimalTypeDetail&, - size_t&) -{ - return 0; -} - -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr&, - const eprosima::fastrtps::types::MinimalTypeDetail&) -{ -} - -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr&, - eprosima::fastrtps::types::MinimalTypeDetail&) -{ -} - -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteTypeDetail& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.ann_builtin(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.ann_custom().size(); ++a) - { - calculate_serialized_size(calculator, data.ann_custom().at(a), current_alignment); - } - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.type_name().size() + 1; - - return current_alignment - initial_alignment; - -#else + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.verbatim(), current_alignment); + + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + + return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 + } + + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::AppliedBuiltinTypeAnnotations& data) + { + scdr << data.verbatim(); + } + + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::AppliedBuiltinTypeAnnotations& data) + { + dcdr >> data.verbatim(); + } + + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator&, + const eprosima::fastrtps::types::MinimalTypeDetail&, + size_t&) + { + return 0; + } + + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr&, + const eprosima::fastrtps::types::MinimalTypeDetail&) + { + } + + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr&, + eprosima::fastrtps::types::MinimalTypeDetail&) + { + } + + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteTypeDetail& data, + size_t& current_alignment) + { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.ann_builtin(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.ann_custom().size(); ++a) + { + calculate_serialized_size(calculator, data.ann_custom().at(a), current_alignment); + } + current_alignment += 4 + + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.type_name().size() + 1; + + return current_alignment - initial_alignment; + +#else + + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.ann_builtin(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.ann_custom(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.type_name(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.ann_builtin(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.ann_custom(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.type_name(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteTypeDetail& data) -{ - scdr << data.ann_builtin(); - scdr << data.ann_custom(); - scdr << data.type_name(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteTypeDetail& data) + { + scdr << data.ann_builtin(); + scdr << data.ann_custom(); + scdr << data.type_name(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteTypeDetail& data) -{ - dcdr >> data.ann_builtin(); - dcdr >> data.ann_custom(); - dcdr >> data.type_name(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteTypeDetail& data) + { + dcdr >> data.ann_builtin(); + dcdr >> data.ann_custom(); + dcdr >> data.type_name(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteStructHeader& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteStructHeader& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.base_type(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); + calculate_serialized_size(calculator, data.base_type(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.base_type(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.base_type(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.detail(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteStructHeader& data) -{ - scdr << data.base_type(); - scdr << data.detail(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteStructHeader& data) + { + scdr << data.base_type(); + scdr << data.detail(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteStructHeader& data) -{ - dcdr >> data.base_type(); - dcdr >> data.detail(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteStructHeader& data) + { + dcdr >> data.base_type(); + dcdr >> data.detail(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalStructHeader& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalStructHeader& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.base_type(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); + calculate_serialized_size(calculator, data.base_type(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.base_type(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.base_type(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.detail(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalStructHeader& data) -{ - scdr << data.base_type(); - scdr << data.detail(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalStructHeader& data) + { + scdr << data.base_type(); + scdr << data.detail(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalStructHeader& data) -{ - dcdr >> data.base_type(); - dcdr >> data.detail(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalStructHeader& data) + { + dcdr >> data.base_type(); + dcdr >> data.detail(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteStructType& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteStructType& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.struct_flags(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.member_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.member_seq().at(a), current_alignment); - } + calculate_serialized_size(calculator, data.struct_flags(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.member_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.member_seq().at(a), current_alignment); + } - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.struct_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.member_seq(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.struct_flags(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.header(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.member_seq(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteStructType& data) -{ + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteStructType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.struct_flags().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.struct_flags().bitset().to_ulong()); + scdr << bits; #else - scdr << data.struct_flags(); + scdr << data.struct_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.member_seq(); -} + scdr << data.header(); + scdr << data.member_seq(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteStructType& data) -{ + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteStructType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.struct_flags().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.struct_flags().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.struct_flags(); + dcdr >> data.struct_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.member_seq(); -} + dcdr >> data.header(); + dcdr >> data.member_seq(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalStructType& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalStructType& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.struct_flags(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.member_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.member_seq().at(a), current_alignment); - } + calculate_serialized_size(calculator, data.struct_flags(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.member_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.member_seq().at(a), current_alignment); + } - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.struct_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.member_seq(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.struct_flags(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.header(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.member_seq(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalStructType& data) -{ + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalStructType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.struct_flags().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.struct_flags().bitset().to_ulong()); + scdr << bits; #else - scdr << data.struct_flags(); + scdr << data.struct_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.member_seq(); -} + scdr << data.header(); + scdr << data.member_seq(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalStructType& data) -{ + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalStructType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.struct_flags().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.struct_flags().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.struct_flags(); + dcdr >> data.struct_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.member_seq(); -} + dcdr >> data.header(); + dcdr >> data.member_seq(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonUnionMember& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CommonUnionMember& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - calculate_serialized_size(calculator, data.member_flags(), current_alignment); - calculate_serialized_size(calculator, data.type_id(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + calculate_serialized_size(calculator, data.member_flags(), current_alignment); + calculate_serialized_size(calculator, data.type_id(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.label_seq().size(); ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.label_seq().size(); ++a) + { + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.member_id(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.member_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.type_id(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 3), data.label_seq(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.member_id(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.member_flags(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.type_id(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 3), data.label_seq(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonUnionMember& data) -{ - scdr << data.member_id(); + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CommonUnionMember& data) + { + scdr << data.member_id(); #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.member_flags().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.member_flags().bitset().to_ulong()); + scdr << bits; #else - scdr << data.member_flags(); + scdr << data.member_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.type_id(); - scdr << data.label_seq(); -} + scdr << data.type_id(); + scdr << data.label_seq(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonUnionMember& data) -{ - dcdr >> data.member_id(); + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CommonUnionMember& data) + { + dcdr >> data.member_id(); #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.member_flags().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.member_flags().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.member_flags(); + dcdr >> data.member_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.type_id(); - dcdr >> data.label_seq(); -} + dcdr >> data.type_id(); + dcdr >> data.label_seq(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteUnionMember& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteUnionMember& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.common(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.detail(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteUnionMember& data) -{ - scdr << data.common(); - scdr << data.detail(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteUnionMember& data) + { + scdr << data.common(); + scdr << data.detail(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteUnionMember& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteUnionMember& data) + { + dcdr >> data.common(); + dcdr >> data.detail(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalUnionMember& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalUnionMember& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.common(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.detail(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalUnionMember& data) -{ - scdr << data.common(); - scdr << data.detail(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalUnionMember& data) + { + scdr << data.common(); + scdr << data.detail(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalUnionMember& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalUnionMember& data) + { + dcdr >> data.common(); + dcdr >> data.detail(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonDiscriminatorMember& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CommonDiscriminatorMember& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.member_flags(), current_alignment); - calculate_serialized_size(calculator, data.type_id(), current_alignment); + calculate_serialized_size(calculator, data.member_flags(), current_alignment); + calculate_serialized_size(calculator, data.type_id(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.member_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.type_id(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.member_flags(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.type_id(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonDiscriminatorMember& data) -{ + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CommonDiscriminatorMember& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.member_flags().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.member_flags().bitset().to_ulong()); + scdr << bits; #else - scdr << data.member_flags(); + scdr << data.member_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.type_id(); -} + scdr << data.type_id(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonDiscriminatorMember& data) -{ + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CommonDiscriminatorMember& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.member_flags().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.member_flags().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.member_flags(); + dcdr >> data.member_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.type_id(); -} + dcdr >> data.type_id(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteDiscriminatorMember& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteDiscriminatorMember& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.ann_builtin(), current_alignment); + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.ann_builtin(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.ann_custom().size(); ++a) - { - calculate_serialized_size(calculator, data.ann_custom().at(a), current_alignment); - } + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.ann_custom().size(); ++a) + { + calculate_serialized_size(calculator, data.ann_custom().at(a), current_alignment); + } - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.ann_builtin(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.ann_custom(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.common(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.ann_builtin(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.ann_custom(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteDiscriminatorMember& data) -{ - scdr << data.common(); - scdr << data.ann_builtin(); - scdr << data.ann_custom(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteDiscriminatorMember& data) + { + scdr << data.common(); + scdr << data.ann_builtin(); + scdr << data.ann_custom(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteDiscriminatorMember& data) -{ - dcdr >> data.common(); - dcdr >> data.ann_builtin(); - dcdr >> data.ann_custom(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteDiscriminatorMember& data) + { + dcdr >> data.common(); + dcdr >> data.ann_builtin(); + dcdr >> data.ann_custom(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalDiscriminatorMember& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalDiscriminatorMember& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.common(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.common(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalDiscriminatorMember& data) -{ - scdr << data.common(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalDiscriminatorMember& data) + { + scdr << data.common(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalDiscriminatorMember& data) -{ - dcdr >> data.common(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalDiscriminatorMember& data) + { + dcdr >> data.common(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteUnionHeader& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteUnionHeader& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.detail(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.detail(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.detail(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteUnionHeader& data) -{ - scdr << data.detail(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteUnionHeader& data) + { + scdr << data.detail(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteUnionHeader& data) -{ - dcdr >> data.detail(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteUnionHeader& data) + { + dcdr >> data.detail(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalUnionHeader& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalUnionHeader& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.detail(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.detail(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.detail(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalUnionHeader& data) -{ - scdr << data.detail(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalUnionHeader& data) + { + scdr << data.detail(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalUnionHeader& data) -{ - dcdr >> data.detail(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalUnionHeader& data) + { + dcdr >> data.detail(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteUnionType& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteUnionType& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.union_flags(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - calculate_serialized_size(calculator, data.discriminator(), current_alignment); + calculate_serialized_size(calculator, data.union_flags(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.discriminator(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.member_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.member_seq().at(a), current_alignment); - } + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.member_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.member_seq().at(a), current_alignment); + } - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.union_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.discriminator(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 3), data.member_seq(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.union_flags(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.header(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.discriminator(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 3), data.member_seq(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteUnionType& data) -{ + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteUnionType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.union_flags().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.union_flags().bitset().to_ulong()); + scdr << bits; #else - scdr << data.union_flags(); + scdr << data.union_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.discriminator(); - scdr << data.member_seq(); -} + scdr << data.header(); + scdr << data.discriminator(); + scdr << data.member_seq(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteUnionType& data) -{ + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteUnionType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.union_flags().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.union_flags().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.union_flags(); + dcdr >> data.union_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.discriminator(); - dcdr >> data.member_seq(); -} + dcdr >> data.header(); + dcdr >> data.discriminator(); + dcdr >> data.member_seq(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalUnionType& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalUnionType& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.union_flags(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - calculate_serialized_size(calculator, data.discriminator(), current_alignment); + calculate_serialized_size(calculator, data.union_flags(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.discriminator(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.member_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.member_seq().at(a), current_alignment); - } + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.member_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.member_seq().at(a), current_alignment); + } - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.union_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.discriminator(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 3), data.member_seq(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.union_flags(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.header(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.discriminator(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 3), data.member_seq(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalUnionType& data) -{ + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalUnionType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.union_flags().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.union_flags().bitset().to_ulong()); + scdr << bits; #else - scdr << data.union_flags(); + scdr << data.union_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.discriminator(); - scdr << data.member_seq(); -} + scdr << data.header(); + scdr << data.discriminator(); + scdr << data.member_seq(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalUnionType& data) -{ + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalUnionType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.union_flags().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.union_flags().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.union_flags(); + dcdr >> data.union_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.discriminator(); - dcdr >> data.member_seq(); -} + dcdr >> data.header(); + dcdr >> data.discriminator(); + dcdr >> data.member_seq(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonAnnotationParameter& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CommonAnnotationParameter& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.member_flags(), current_alignment); - calculate_serialized_size(calculator, data.member_type_id(), current_alignment); + calculate_serialized_size(calculator, data.member_flags(), current_alignment); + calculate_serialized_size(calculator, data.member_type_id(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.member_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.member_type_id(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.member_flags(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.member_type_id(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonAnnotationParameter& data) -{ + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CommonAnnotationParameter& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.member_flags().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.member_flags().bitset().to_ulong()); + scdr << bits; #else - scdr << data.member_flags(); + scdr << data.member_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.member_type_id(); -} + scdr << data.member_type_id(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonAnnotationParameter& data) -{ + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CommonAnnotationParameter& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.member_flags().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.member_flags().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.member_flags(); + dcdr >> data.member_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.member_type_id(); -} + dcdr >> data.member_type_id(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteAnnotationParameter& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteAnnotationParameter& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.common(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.name().size() + 1; - calculate_serialized_size(calculator, data.default_value(), current_alignment); + calculate_serialized_size(calculator, data.common(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.name().size() + 1; + calculate_serialized_size(calculator, data.default_value(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.name(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.default_value(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.common(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.name(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.default_value(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteAnnotationParameter& data) -{ - scdr << data.common(); - scdr << data.name(); - scdr << data.default_value(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteAnnotationParameter& data) + { + scdr << data.common(); + scdr << data.name(); + scdr << data.default_value(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteAnnotationParameter& data) -{ - dcdr >> data.common(); - dcdr >> data.name(); - dcdr >> data.default_value(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteAnnotationParameter& data) + { + dcdr >> data.common(); + dcdr >> data.name(); + dcdr >> data.default_value(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalAnnotationParameter& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalAnnotationParameter& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.common(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.name().size() + 1; - calculate_serialized_size(calculator, data.default_value(), current_alignment); + calculate_serialized_size(calculator, data.common(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.name().size() + 1; + calculate_serialized_size(calculator, data.default_value(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.name(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.default_value(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.common(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.name(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.default_value(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalAnnotationParameter& data) -{ - scdr << data.common(); - scdr << data.name(); - scdr << data.default_value(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalAnnotationParameter& data) + { + scdr << data.common(); + scdr << data.name(); + scdr << data.default_value(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalAnnotationParameter& data) -{ - dcdr >> data.common(); - dcdr >> data.name(); - dcdr >> data.default_value(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalAnnotationParameter& data) + { + dcdr >> data.common(); + dcdr >> data.name(); + dcdr >> data.default_value(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteAnnotationHeader& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteAnnotationHeader& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - static_cast(calculator); - size_t initial_alignment = current_alignment; + static_cast < void > (calculator); + size_t initial_alignment = current_alignment; - current_alignment += 4 + - eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.annotation_name().size() + 1; + current_alignment += 4 + + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.annotation_name().size() + 1; - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.annotation_name(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.annotation_name(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteAnnotationHeader& data) -{ - scdr << data.annotation_name(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteAnnotationHeader& data) + { + scdr << data.annotation_name(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteAnnotationHeader& data) -{ - dcdr >> data.annotation_name(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteAnnotationHeader& data) + { + dcdr >> data.annotation_name(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator&, - const eprosima::fastrtps::types::MinimalAnnotationHeader&, - size_t&) -{ - return 0; -} + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator&, + const eprosima::fastrtps::types::MinimalAnnotationHeader&, + size_t&) + { + return 0; + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr&, - const eprosima::fastrtps::types::MinimalAnnotationHeader&) -{ -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr&, + const eprosima::fastrtps::types::MinimalAnnotationHeader&) + { + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr&, - eprosima::fastrtps::types::MinimalAnnotationHeader&) -{ -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr&, + eprosima::fastrtps::types::MinimalAnnotationHeader&) + { + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteAnnotationType& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteAnnotationType& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.annotation_flag(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.annotation_flag(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.member_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.member_seq().at( - a), current_alignment); - } + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.member_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.member_seq().at( + a), current_alignment); + } - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.annotation_flag(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.member_seq(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.annotation_flag(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.header(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.member_seq(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteAnnotationType& data) -{ + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteAnnotationType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.annotation_flag().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.annotation_flag().bitset().to_ulong()); + scdr << bits; #else - scdr << data.annotation_flag(); + scdr << data.annotation_flag(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.member_seq(); -} + scdr << data.header(); + scdr << data.member_seq(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteAnnotationType& data) -{ + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteAnnotationType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.annotation_flag().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.annotation_flag().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.annotation_flag(); + dcdr >> data.annotation_flag(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.member_seq(); -} + dcdr >> data.header(); + dcdr >> data.member_seq(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalAnnotationType& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalAnnotationType& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.annotation_flag(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.annotation_flag(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.member_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.member_seq().at(a), - current_alignment); - } + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.member_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.member_seq().at(a), + current_alignment); + } - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.annotation_flag(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.member_seq(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.annotation_flag(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.header(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.member_seq(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalAnnotationType& data) -{ + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalAnnotationType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.annotation_flag().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.annotation_flag().bitset().to_ulong()); + scdr << bits; #else - scdr << data.annotation_flag(); + scdr << data.annotation_flag(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.member_seq(); -} + scdr << data.header(); + scdr << data.member_seq(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalAnnotationType& data) -{ + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalAnnotationType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.annotation_flag().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.annotation_flag().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.annotation_flag(); + dcdr >> data.annotation_flag(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.member_seq(); -} + dcdr >> data.header(); + dcdr >> data.member_seq(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonAliasBody& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CommonAliasBody& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.related_flags(), current_alignment); - calculate_serialized_size(calculator, data.related_type(), current_alignment); + calculate_serialized_size(calculator, data.related_flags(), current_alignment); + calculate_serialized_size(calculator, data.related_type(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.related_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.related_type(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.related_flags(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.related_type(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonAliasBody& data) -{ + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CommonAliasBody& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.related_flags().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.related_flags().bitset().to_ulong()); + scdr << bits; #else - scdr << data.related_flags(); + scdr << data.related_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.related_type(); -} + scdr << data.related_type(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonAliasBody& data) -{ + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CommonAliasBody& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.related_flags().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.related_flags().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.related_flags(); + dcdr >> data.related_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.related_type(); -} + dcdr >> data.related_type(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteAliasBody& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteAliasBody& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.ann_builtin(), current_alignment); + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.ann_builtin(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.ann_custom().size(); ++a) - { - calculate_serialized_size(calculator, data.ann_custom().at(a), current_alignment); - } + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.ann_custom().size(); ++a) + { + calculate_serialized_size(calculator, data.ann_custom().at(a), current_alignment); + } - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.ann_builtin(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.ann_custom(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.common(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.ann_builtin(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.ann_custom(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteAliasBody& data) -{ - scdr << data.common(); - scdr << data.ann_builtin(); - scdr << data.ann_custom(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteAliasBody& data) + { + scdr << data.common(); + scdr << data.ann_builtin(); + scdr << data.ann_custom(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteAliasBody& data) -{ - dcdr >> data.common(); - dcdr >> data.ann_builtin(); - dcdr >> data.ann_custom(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteAliasBody& data) + { + dcdr >> data.common(); + dcdr >> data.ann_builtin(); + dcdr >> data.ann_custom(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalAliasBody& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalAliasBody& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.common(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.common(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalAliasBody& data) -{ - scdr << data.common(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalAliasBody& data) + { + scdr << data.common(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalAliasBody& data) -{ - dcdr >> data.common(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalAliasBody& data) + { + dcdr >> data.common(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteAliasHeader& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteAliasHeader& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.detail(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.detail(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.detail(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteAliasHeader& data) -{ - scdr << data.detail(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteAliasHeader& data) + { + scdr << data.detail(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteAliasHeader& data) -{ - dcdr >> data.detail(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteAliasHeader& data) + { + dcdr >> data.detail(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator&, - const eprosima::fastrtps::types::MinimalAliasHeader&, - size_t&) -{ - return 0; -} + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator&, + const eprosima::fastrtps::types::MinimalAliasHeader&, + size_t&) + { + return 0; + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr&, - const eprosima::fastrtps::types::MinimalAliasHeader&) -{ -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr&, + const eprosima::fastrtps::types::MinimalAliasHeader&) + { + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr&, - eprosima::fastrtps::types::MinimalAliasHeader&) -{ -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr&, + eprosima::fastrtps::types::MinimalAliasHeader&) + { + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteAliasType& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteAliasType& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.alias_flags(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - calculate_serialized_size(calculator, data.body(), current_alignment); + calculate_serialized_size(calculator, data.alias_flags(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.body(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.alias_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.body(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.alias_flags(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.header(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.body(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteAliasType& data) -{ + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteAliasType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.alias_flags().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.alias_flags().bitset().to_ulong()); + scdr << bits; #else - scdr << data.alias_flags(); + scdr << data.alias_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.body(); -} + scdr << data.header(); + scdr << data.body(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteAliasType& data) -{ + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteAliasType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.alias_flags().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.alias_flags().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.alias_flags(); + dcdr >> data.alias_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.body(); -} + dcdr >> data.header(); + dcdr >> data.body(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalAliasType& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalAliasType& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.alias_flags(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - calculate_serialized_size(calculator, data.body(), current_alignment); + calculate_serialized_size(calculator, data.alias_flags(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.body(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.alias_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.body(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.alias_flags(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.header(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.body(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalAliasType& data) -{ + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalAliasType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.alias_flags().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.alias_flags().bitset().to_ulong()); + scdr << bits; #else - scdr << data.alias_flags(); + scdr << data.alias_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.body(); -} + scdr << data.header(); + scdr << data.body(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalAliasType& data) -{ + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalAliasType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.alias_flags().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.alias_flags().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.alias_flags(); + dcdr >> data.alias_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.body(); -} + dcdr >> data.header(); + dcdr >> data.body(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteElementDetail& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteElementDetail& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.ann_builtin(), current_alignment); + calculate_serialized_size(calculator, data.ann_builtin(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.ann_custom().size(); ++a) - { - calculate_serialized_size(calculator, data.ann_custom().at(a), current_alignment); - } + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.ann_custom().size(); ++a) + { + calculate_serialized_size(calculator, data.ann_custom().at(a), current_alignment); + } - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.ann_builtin(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.ann_custom(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.ann_builtin(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.ann_custom(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteElementDetail& data) -{ - scdr << data.ann_builtin(); - scdr << data.ann_custom(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteElementDetail& data) + { + scdr << data.ann_builtin(); + scdr << data.ann_custom(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteElementDetail& data) -{ - dcdr >> data.ann_builtin(); - dcdr >> data.ann_custom(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteElementDetail& data) + { + dcdr >> data.ann_builtin(); + dcdr >> data.ann_custom(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonCollectionElement& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CommonCollectionElement& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.element_flags(), current_alignment); - calculate_serialized_size(calculator, data.type(), current_alignment); + calculate_serialized_size(calculator, data.element_flags(), current_alignment); + calculate_serialized_size(calculator, data.type(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.element_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.type(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.element_flags(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.type(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonCollectionElement& data) -{ + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CommonCollectionElement& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.element_flags().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.element_flags().bitset().to_ulong()); + scdr << bits; #else - scdr << data.element_flags(); + scdr << data.element_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.type(); -} + scdr << data.type(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonCollectionElement& data) -{ + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CommonCollectionElement& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.element_flags().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.element_flags().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.element_flags(); + dcdr >> data.element_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.type(); -} + dcdr >> data.type(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteCollectionElement& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteCollectionElement& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.common(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.detail(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteCollectionElement& data) -{ - scdr << data.common(); - scdr << data.detail(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteCollectionElement& data) + { + scdr << data.common(); + scdr << data.detail(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteCollectionElement& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteCollectionElement& data) + { + dcdr >> data.common(); + dcdr >> data.detail(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalCollectionElement& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalCollectionElement& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.common(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.common(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalCollectionElement& data) -{ - scdr << data.common(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalCollectionElement& data) + { + scdr << data.common(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalCollectionElement& data) -{ - dcdr >> data.common(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalCollectionElement& data) + { + dcdr >> data.common(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonCollectionHeader& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CommonCollectionHeader& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - static_cast(calculator); - static_cast(data); - size_t initial_alignment = current_alignment; + static_cast < void > (calculator); + static_cast < void > (data); + size_t initial_alignment = current_alignment; - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.bound(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.bound(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonCollectionHeader& data) -{ - scdr << data.bound(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CommonCollectionHeader& data) + { + scdr << data.bound(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonCollectionHeader& data) -{ - dcdr >> data.bound(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CommonCollectionHeader& data) + { + dcdr >> data.bound(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteCollectionHeader& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteCollectionHeader& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.detail(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.common(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.detail(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteCollectionHeader& data) -{ - scdr << data.common(); - scdr << data.detail(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteCollectionHeader& data) + { + scdr << data.common(); + scdr << data.detail(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteCollectionHeader& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteCollectionHeader& data) + { + dcdr >> data.common(); + dcdr >> data.detail(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalCollectionHeader& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalCollectionHeader& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.common(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.common(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalCollectionHeader& data) -{ - scdr << data.common(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalCollectionHeader& data) + { + scdr << data.common(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalCollectionHeader& data) -{ - dcdr >> data.common(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalCollectionHeader& data) + { + dcdr >> data.common(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalSequenceType& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalSequenceType& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - // FIXED_SIXE current_alignment += ((4) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - calculate_serialized_size(calculator, data.collection_flag(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - calculate_serialized_size(calculator, data.element(), current_alignment); + // FIXED_SIXE current_alignment += ((4) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + calculate_serialized_size(calculator, data.collection_flag(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.element(), current_alignment); - // STRING current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.str().size() + 1; - // SEQUENCE - /* - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for(size_t a = 0; a < data.param_seq().size(); ++a) - { - current_alignment += AppliedAnnotationParameter::getCdrSerializedSize(data.param_seq().at(a), current_alignment); - } - */ + // STRING current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.str().size() + 1; + // SEQUENCE + /* + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for(size_t a = 0; a < data.param_seq().size(); ++a) + { + current_alignment += AppliedAnnotationParameter::getCdrSerializedSize(data.param_seq().at(a), current_alignment); + } + */ - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.collection_flag(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.element(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.collection_flag(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.header(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.element(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteSequenceType& data) -{ + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteSequenceType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.collection_flag().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.collection_flag().bitset().to_ulong()); + scdr << bits; #else - scdr << data.collection_flag(); + scdr << data.collection_flag(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.element(); -} + scdr << data.header(); + scdr << data.element(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteSequenceType& data) -{ + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteSequenceType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.collection_flag().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.collection_flag().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.collection_flag(); + dcdr >> data.collection_flag(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.element(); -} + dcdr >> data.header(); + dcdr >> data.element(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteSequenceType& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteSequenceType& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - // FIXED_SIXE current_alignment += ((4) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - calculate_serialized_size(calculator, data.collection_flag(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - calculate_serialized_size(calculator, data.element(), current_alignment); + // FIXED_SIXE current_alignment += ((4) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + calculate_serialized_size(calculator, data.collection_flag(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.element(), current_alignment); - // STRING current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.str().size() + 1; - // SEQUENCE - /* - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for(size_t a = 0; a < data.param_seq().size(); ++a) - { - current_alignment += AppliedAnnotationParameter::getCdrSerializedSize(data.param_seq().at(a), current_alignment); - } - */ + // STRING current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.str().size() + 1; + // SEQUENCE + /* + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for(size_t a = 0; a < data.param_seq().size(); ++a) + { + current_alignment += AppliedAnnotationParameter::getCdrSerializedSize(data.param_seq().at(a), current_alignment); + } + */ - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.collection_flag(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.element(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.collection_flag(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.header(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.element(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalSequenceType& data) -{ + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalSequenceType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.collection_flag().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.collection_flag().bitset().to_ulong()); + scdr << bits; #else - scdr << data.collection_flag(); + scdr << data.collection_flag(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.element(); -} + scdr << data.header(); + scdr << data.element(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalSequenceType& data) -{ + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalSequenceType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.collection_flag().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.collection_flag().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.collection_flag(); + dcdr >> data.collection_flag(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.element(); -} + dcdr >> data.header(); + dcdr >> data.element(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonArrayHeader& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CommonArrayHeader& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - static_cast(calculator); - size_t initial_alignment = current_alignment; + static_cast < void > (calculator); + size_t initial_alignment = current_alignment; - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.bound_seq().size(); ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.bound_seq().size(); ++a) + { + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.bound_seq(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.bound_seq(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonArrayHeader& data) -{ - scdr << data.bound_seq(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CommonArrayHeader& data) + { + scdr << data.bound_seq(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonArrayHeader& data) -{ - dcdr >> data.bound_seq(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CommonArrayHeader& data) + { + dcdr >> data.bound_seq(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteArrayHeader& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteArrayHeader& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.common(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.detail(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteArrayHeader& data) -{ - scdr << data.common(); - scdr << data.detail(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteArrayHeader& data) + { + scdr << data.common(); + scdr << data.detail(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteArrayHeader& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteArrayHeader& data) + { + dcdr >> data.common(); + dcdr >> data.detail(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalArrayHeader& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalArrayHeader& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.common(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.common(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalArrayHeader& data) -{ - scdr << data.common(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalArrayHeader& data) + { + scdr << data.common(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalArrayHeader& data) -{ - dcdr >> data.common(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalArrayHeader& data) + { + dcdr >> data.common(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteArrayType& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteArrayType& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.collection_flag(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - calculate_serialized_size(calculator, data.element(), current_alignment); + calculate_serialized_size(calculator, data.collection_flag(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.element(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.collection_flag(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.element(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.collection_flag(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.header(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.element(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteArrayType& data) -{ + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteArrayType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.collection_flag().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.collection_flag().bitset().to_ulong()); + scdr << bits; #else - scdr << data.collection_flag(); + scdr << data.collection_flag(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.element(); -} + scdr << data.header(); + scdr << data.element(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteArrayType& data) -{ + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteArrayType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.collection_flag().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.collection_flag().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.collection_flag(); + dcdr >> data.collection_flag(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.element(); -} + dcdr >> data.header(); + dcdr >> data.element(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalArrayType& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalArrayType& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.collection_flag(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - calculate_serialized_size(calculator, data.element(), current_alignment); + calculate_serialized_size(calculator, data.collection_flag(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.element(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.collection_flag(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.element(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.collection_flag(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.header(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.element(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalArrayType& data) -{ + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalArrayType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.collection_flag().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.collection_flag().bitset().to_ulong()); + scdr << bits; #else - scdr << data.collection_flag(); + scdr << data.collection_flag(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.element(); -} + scdr << data.header(); + scdr << data.element(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalArrayType& data) -{ + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalArrayType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.collection_flag().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.collection_flag().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.collection_flag(); + dcdr >> data.collection_flag(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.element(); -} + dcdr >> data.header(); + dcdr >> data.element(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteMapType& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteMapType& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.collection_flag(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - calculate_serialized_size(calculator, data.key(), current_alignment); - calculate_serialized_size(calculator, data.element(), current_alignment); + calculate_serialized_size(calculator, data.collection_flag(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.key(), current_alignment); + calculate_serialized_size(calculator, data.element(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.collection_flag(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.key(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 3), data.element(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.collection_flag(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.header(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.key(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 3), data.element(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteMapType& data) -{ + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteMapType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.collection_flag().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.collection_flag().bitset().to_ulong()); + scdr << bits; #else - scdr << data.collection_flag(); + scdr << data.collection_flag(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.key(); - scdr << data.element(); -} + scdr << data.header(); + scdr << data.key(); + scdr << data.element(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteMapType& data) -{ + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteMapType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.collection_flag().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.collection_flag().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.collection_flag(); + dcdr >> data.collection_flag(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.key(); - dcdr >> data.element(); -} + dcdr >> data.header(); + dcdr >> data.key(); + dcdr >> data.element(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalMapType& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalMapType& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.collection_flag(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - calculate_serialized_size(calculator, data.key(), current_alignment); - calculate_serialized_size(calculator, data.element(), current_alignment); + calculate_serialized_size(calculator, data.collection_flag(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.key(), current_alignment); + calculate_serialized_size(calculator, data.element(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.collection_flag(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.key(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.element(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.collection_flag(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.header(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.key(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.element(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalMapType& data) -{ + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalMapType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.collection_flag().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.collection_flag().bitset().to_ulong()); + scdr << bits; #else - scdr << data.collection_flag(); + scdr << data.collection_flag(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.key(); - scdr << data.element(); -} + scdr << data.header(); + scdr << data.key(); + scdr << data.element(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalMapType& data) -{ + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalMapType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.collection_flag().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.collection_flag().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.collection_flag(); + dcdr >> data.collection_flag(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.key(); - dcdr >> data.element(); -} + dcdr >> data.header(); + dcdr >> data.key(); + dcdr >> data.element(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonEnumeratedLiteral& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CommonEnumeratedLiteral& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - calculate_serialized_size(calculator, data.flags(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + calculate_serialized_size(calculator, data.flags(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.value(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.flags(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.value(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.flags(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonEnumeratedLiteral& data) -{ - scdr << data.value(); + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CommonEnumeratedLiteral& data) + { + scdr << data.value(); #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.flags().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.flags().bitset().to_ulong()); + scdr << bits; #else - scdr << data.flags(); + scdr << data.flags(); #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonEnumeratedLiteral& data) -{ - dcdr >> data.value(); + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CommonEnumeratedLiteral& data) + { + dcdr >> data.value(); #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.flags().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.flags().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.flags(); + dcdr >> data.flags(); #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteEnumeratedLiteral& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteEnumeratedLiteral& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.common(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.detail(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteEnumeratedLiteral& data) -{ - scdr << data.common(); - scdr << data.detail(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteEnumeratedLiteral& data) + { + scdr << data.common(); + scdr << data.detail(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteEnumeratedLiteral& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteEnumeratedLiteral& data) + { + dcdr >> data.common(); + dcdr >> data.detail(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalEnumeratedLiteral& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalEnumeratedLiteral& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.common(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.detail(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalEnumeratedLiteral& data) -{ - scdr << data.common(); - scdr << data.detail(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalEnumeratedLiteral& data) + { + scdr << data.common(); + scdr << data.detail(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalEnumeratedLiteral& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalEnumeratedLiteral& data) + { + dcdr >> data.common(); + dcdr >> data.detail(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonEnumeratedHeader& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CommonEnumeratedHeader& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - static_cast(calculator); - static_cast(data); - size_t initial_alignment = current_alignment; + static_cast < void > (calculator); + static_cast < void > (data); + size_t initial_alignment = current_alignment; - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.bit_bound(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.bit_bound(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonEnumeratedHeader& data) -{ - scdr << data.bit_bound(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CommonEnumeratedHeader& data) + { + scdr << data.bit_bound(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonEnumeratedHeader& data) -{ - dcdr >> data.bit_bound(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CommonEnumeratedHeader& data) + { + dcdr >> data.bit_bound(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteEnumeratedHeader& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteEnumeratedHeader& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.common(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.detail(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteEnumeratedHeader& data) -{ - scdr << data.common(); - scdr << data.detail(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteEnumeratedHeader& data) + { + scdr << data.common(); + scdr << data.detail(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteEnumeratedHeader& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteEnumeratedHeader& data) + { + dcdr >> data.common(); + dcdr >> data.detail(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalEnumeratedHeader& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalEnumeratedHeader& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.common(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.common(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalEnumeratedHeader& data) -{ - scdr << data.common(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalEnumeratedHeader& data) + { + scdr << data.common(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalEnumeratedHeader& data) -{ - dcdr >> data.common(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalEnumeratedHeader& data) + { + dcdr >> data.common(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteEnumeratedType& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteEnumeratedType& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.enum_flags(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.enum_flags(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.literal_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.literal_seq().at(a), - current_alignment); - } + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.literal_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.literal_seq().at(a), + current_alignment); + } - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.enum_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.literal_seq(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.enum_flags(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.header(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.literal_seq(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteEnumeratedType& data) -{ + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteEnumeratedType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.enum_flags().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.enum_flags().bitset().to_ulong()); + scdr << bits; #else - scdr << data.enum_flags(); + scdr << data.enum_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.literal_seq(); -} + scdr << data.header(); + scdr << data.literal_seq(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteEnumeratedType& data) -{ + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteEnumeratedType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.enum_flags().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.enum_flags().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.enum_flags(); + dcdr >> data.enum_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.literal_seq(); -} + dcdr >> data.header(); + dcdr >> data.literal_seq(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalEnumeratedType& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalEnumeratedType& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.enum_flags(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.enum_flags(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.literal_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.literal_seq().at(a), current_alignment); - } + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.literal_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.literal_seq().at(a), current_alignment); + } - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.enum_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.literal_seq(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.enum_flags(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.header(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.literal_seq(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalEnumeratedType& data) -{ + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalEnumeratedType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.enum_flags().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.enum_flags().bitset().to_ulong()); + scdr << bits; #else - scdr << data.enum_flags(); + scdr << data.enum_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.literal_seq(); -} + scdr << data.header(); + scdr << data.literal_seq(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalEnumeratedType& data) -{ + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalEnumeratedType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.enum_flags().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.enum_flags().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.enum_flags(); + dcdr >> data.enum_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.literal_seq(); -} + dcdr >> data.header(); + dcdr >> data.literal_seq(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonBitflag& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CommonBitflag& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - calculate_serialized_size(calculator, data.flags(), current_alignment); + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + calculate_serialized_size(calculator, data.flags(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.position(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.flags(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.position(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.flags(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonBitflag& data) -{ - scdr << data.position(); + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CommonBitflag& data) + { + scdr << data.position(); #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.flags().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.flags().bitset().to_ulong()); + scdr << bits; #else - scdr << data.flags(); + scdr << data.flags(); #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonBitflag& data) -{ - dcdr >> data.position(); + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CommonBitflag& data) + { + dcdr >> data.position(); #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.flags().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.flags().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.flags(); + dcdr >> data.flags(); #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteBitflag& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteBitflag& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.common(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.detail(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteBitflag& data) -{ - scdr << data.common(); - scdr << data.detail(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteBitflag& data) + { + scdr << data.common(); + scdr << data.detail(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteBitflag& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteBitflag& data) + { + dcdr >> data.common(); + dcdr >> data.detail(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalBitflag& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalBitflag& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.common(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.detail(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalBitflag& data) -{ - scdr << data.common(); - scdr << data.detail(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalBitflag& data) + { + scdr << data.common(); + scdr << data.detail(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalBitflag& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalBitflag& data) + { + dcdr >> data.common(); + dcdr >> data.detail(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonBitmaskHeader& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CommonBitmaskHeader& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - static_cast(calculator); - static_cast(data); - size_t initial_alignment = current_alignment; + static_cast < void > (calculator); + static_cast < void > (data); + size_t initial_alignment = current_alignment; - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.bit_bound(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.bit_bound(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonBitmaskHeader& data) -{ - scdr << data.bit_bound(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CommonBitmaskHeader& data) + { + scdr << data.bit_bound(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonBitmaskHeader& data) -{ - dcdr >> data.bit_bound(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CommonBitmaskHeader& data) + { + dcdr >> data.bit_bound(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteBitmaskType& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteBitmaskType& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.bitmask_flags(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.bitmask_flags(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.flag_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.flag_seq().at(a), current_alignment); - } + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.flag_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.flag_seq().at(a), current_alignment); + } - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.bitmask_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.flag_seq(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.bitmask_flags(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.header(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.flag_seq(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteBitmaskType& data) -{ + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteBitmaskType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.bitmask_flags().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.bitmask_flags().bitset().to_ulong()); + scdr << bits; #else - scdr << data.bitmask_flags(); + scdr << data.bitmask_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.flag_seq(); -} + scdr << data.header(); + scdr << data.flag_seq(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteBitmaskType& data) -{ + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteBitmaskType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.bitmask_flags().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.bitmask_flags().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.bitmask_flags(); + dcdr >> data.bitmask_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.flag_seq(); -} + dcdr >> data.header(); + dcdr >> data.flag_seq(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalBitmaskType& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalBitmaskType& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.bitmask_flags(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.bitmask_flags(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.flag_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.flag_seq().at(a), current_alignment); - } + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.flag_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.flag_seq().at(a), current_alignment); + } - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.bitmask_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.flag_seq(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.bitmask_flags(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.header(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.flag_seq(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalBitmaskType& data) -{ + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalBitmaskType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.bitmask_flags().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.bitmask_flags().bitset().to_ulong()); + scdr << bits; #else - scdr << data.bitmask_flags(); + scdr << data.bitmask_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.flag_seq(); -} + scdr << data.header(); + scdr << data.flag_seq(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalBitmaskType& data) -{ + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalBitmaskType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.bitmask_flags().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.bitmask_flags().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.bitmask_flags(); + dcdr >> data.bitmask_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.flag_seq(); -} + dcdr >> data.header(); + dcdr >> data.flag_seq(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonBitfield& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CommonBitfield& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - calculate_serialized_size(calculator, data.flags(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + calculate_serialized_size(calculator, data.flags(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.position(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.bitcount(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 3), data.holder_type(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.position(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.flags(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.bitcount(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 3), data.holder_type(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonBitfield& data) -{ - scdr << data.position(); + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CommonBitfield& data) + { + scdr << data.position(); #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.flags().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.flags().bitset().to_ulong()); + scdr << bits; #else - scdr << data.flags(); + scdr << data.flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.bitcount(); - scdr << data.holder_type(); -} + scdr << data.bitcount(); + scdr << data.holder_type(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonBitfield& data) -{ - dcdr >> data.position(); + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CommonBitfield& data) + { + dcdr >> data.position(); #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.flags().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.flags().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.flags(); + dcdr >> data.flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.bitcount(); - dcdr >> data.holder_type(); -} + dcdr >> data.bitcount(); + dcdr >> data.holder_type(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteBitfield& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteBitfield& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.common(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.detail(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteBitfield& data) -{ - scdr << data.common(); - scdr << data.detail(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteBitfield& data) + { + scdr << data.common(); + scdr << data.detail(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteBitfield& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteBitfield& data) + { + dcdr >> data.common(); + dcdr >> data.detail(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalBitfield& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalBitfield& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.common(), current_alignment); - current_alignment += ((4) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + calculate_serialized_size(calculator, data.common(), current_alignment); + current_alignment += ((4) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.name_hash(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.common(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.name_hash(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalBitfield& data) -{ - scdr << data.common(); - scdr << data.name_hash(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalBitfield& data) + { + scdr << data.common(); + scdr << data.name_hash(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalBitfield& data) -{ - dcdr >> data.common(); - dcdr >> data.name_hash(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalBitfield& data) + { + dcdr >> data.common(); + dcdr >> data.name_hash(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteBitsetHeader& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteBitsetHeader& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.base_type(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); + calculate_serialized_size(calculator, data.base_type(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.detail(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.base_type(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.detail(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.base_type(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteBitsetHeader& data) -{ - scdr << data.base_type(); - scdr << data.detail(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteBitsetHeader& data) + { + scdr << data.base_type(); + scdr << data.detail(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteBitsetHeader& data) -{ - dcdr >> data.base_type(); - dcdr >> data.detail(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteBitsetHeader& data) + { + dcdr >> data.base_type(); + dcdr >> data.detail(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalBitsetHeader& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalBitsetHeader& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.base_type(), current_alignment); + calculate_serialized_size(calculator, data.base_type(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.base_type(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.base_type(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalBitsetHeader& data) -{ - scdr << data.base_type(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalBitsetHeader& data) + { + scdr << data.base_type(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalBitsetHeader& data) -{ - dcdr >> data.base_type(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalBitsetHeader& data) + { + dcdr >> data.base_type(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteBitsetType& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteBitsetType& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.bitset_flags(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.bitset_flags(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.field_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.field_seq().at(a), current_alignment); - } + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.field_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.field_seq().at(a), current_alignment); + } - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.bitset_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.field_seq(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.bitset_flags(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.header(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.field_seq(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteBitsetType& data) -{ + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteBitsetType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.bitset_flags().bitset().to_ulong()); - scdr << bits; + uint16_t bits = static_cast < uint16_t > (data.bitset_flags().bitset().to_ulong()); + scdr << bits; #else - scdr << data.bitset_flags(); + scdr << data.bitset_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.field_seq(); -} + scdr << data.header(); + scdr << data.field_seq(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteBitsetType& data) -{ + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteBitsetType& data) + { #if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.bitset_flags().bitset(std::bitset<16>(bits)); + uint16_t bits; + dcdr >> bits; + data.bitset_flags().bitset(std::bitset < 16 > (bits)); #else - dcdr >> data.bitset_flags(); + dcdr >> data.bitset_flags(); #endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.field_seq(); -} + dcdr >> data.header(); + dcdr >> data.field_seq(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalBitsetType& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalBitsetType& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.bitset_flags(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.field_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.field_seq().at(a), current_alignment); - } - - return current_alignment - initial_alignment; + size_t initial_alignment = current_alignment; -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.bitset_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.field_seq(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} + calculate_serialized_size(calculator, data.bitset_flags(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalBitsetType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.bitset_flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.bitset_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.field_seq(); -} - -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalBitsetType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.bitset_flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.bitset_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.field_seq(); -} - -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator&, - const eprosima::fastrtps::types::CompleteExtendedType&, - size_t&) -{ - return 0; -} - -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr&, - const eprosima::fastrtps::types::CompleteExtendedType&) -{ -} - -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr&, - eprosima::fastrtps::types::CompleteExtendedType&) -{ -} - -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator&, - const eprosima::fastrtps::types::MinimalExtendedType&, - size_t&) -{ - return 0; -} - -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr&, - const eprosima::fastrtps::types::MinimalExtendedType&) -{ -} - -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr&, - eprosima::fastrtps::types::MinimalExtendedType&) -{ -} - -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteTypeObject& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - switch (data._d()) - { - case eprosima::fastrtps::types::TK_ALIAS: - calculate_serialized_size(calculator, data.alias_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_ANNOTATION: - calculate_serialized_size(calculator, data.annotation_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_STRUCTURE: - calculate_serialized_size(calculator, data.struct_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_UNION: - calculate_serialized_size(calculator, data.union_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_BITSET: - calculate_serialized_size(calculator, data.bitset_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_SEQUENCE: - calculate_serialized_size(calculator, data.sequence_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_ARRAY: - calculate_serialized_size(calculator, data.array_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_MAP: - calculate_serialized_size(calculator, data.map_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_ENUM: - calculate_serialized_size(calculator, data.enumerated_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_BITMASK: - calculate_serialized_size(calculator, data.bitmask_type(), current_alignment); - break; - default: - calculate_serialized_size(calculator, data.extended_type(), current_alignment); - break; - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data._d(), current_alignment); - - switch (data._d()) - { - case eprosima::fastrtps::types::TK_ALIAS: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.alias_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_ANNOTATION: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.annotation_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_STRUCTURE: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 3), data.struct_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_UNION: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 4), data.union_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_BITSET: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 5), data.bitset_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_SEQUENCE: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 6), data.sequence_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_ARRAY: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 7), data.array_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_MAP: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 8), data.map_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_ENUM: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 9), data.enumerated_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_BITMASK: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 10), data.bitmask_type(), current_alignment); - break; - default: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 11), data.extended_type(), current_alignment); - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteTypeObject& data) -{ - scdr << data._d(); - - switch (data._d()) - { - case eprosima::fastrtps::types::TK_ALIAS: - scdr << data.alias_type(); - break; - case eprosima::fastrtps::types::TK_ANNOTATION: - scdr << data.annotation_type(); - break; - case eprosima::fastrtps::types::TK_STRUCTURE: - scdr << data.struct_type(); - break; - case eprosima::fastrtps::types::TK_UNION: - scdr << data.union_type(); - break; - case eprosima::fastrtps::types::TK_BITSET: - scdr << data.bitset_type(); - break; - case eprosima::fastrtps::types::TK_SEQUENCE: - scdr << data.sequence_type(); - break; - case eprosima::fastrtps::types::TK_ARRAY: - scdr << data.array_type(); - break; - case eprosima::fastrtps::types::TK_MAP: - scdr << data.map_type(); - break; - case eprosima::fastrtps::types::TK_ENUM: - scdr << data.enumerated_type(); - break; - case eprosima::fastrtps::types::TK_BITMASK: - scdr << data.bitmask_type(); - break; - default: - scdr << data.extended_type(); - break; - } -} - -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteTypeObject& data) -{ - dcdr >> data._d(); - - switch (data._d()) - { - case eprosima::fastrtps::types::TK_ALIAS: - dcdr >> data.alias_type(); - break; - case eprosima::fastrtps::types::TK_ANNOTATION: - dcdr >> data.annotation_type(); - break; - case eprosima::fastrtps::types::TK_STRUCTURE: - dcdr >> data.struct_type(); - break; - case eprosima::fastrtps::types::TK_UNION: - dcdr >> data.union_type(); - break; - case eprosima::fastrtps::types::TK_BITSET: - dcdr >> data.bitset_type(); - break; - case eprosima::fastrtps::types::TK_SEQUENCE: - dcdr >> data.sequence_type(); - break; - case eprosima::fastrtps::types::TK_ARRAY: - dcdr >> data.array_type(); - break; - case eprosima::fastrtps::types::TK_MAP: - dcdr >> data.map_type(); - break; - case eprosima::fastrtps::types::TK_ENUM: - dcdr >> data.enumerated_type(); - break; - case eprosima::fastrtps::types::TK_BITMASK: - dcdr >> data.bitmask_type(); - break; - default: - dcdr >> data.extended_type(); - break; - } -} - -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalTypeObject& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - switch (data._d()) - { - case eprosima::fastrtps::types::TK_ALIAS: - calculate_serialized_size(calculator, data.alias_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_ANNOTATION: - calculate_serialized_size(calculator, data.annotation_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_STRUCTURE: - calculate_serialized_size(calculator, data.struct_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_UNION: - calculate_serialized_size(calculator, data.union_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_BITSET: - calculate_serialized_size(calculator, data.bitset_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_SEQUENCE: - calculate_serialized_size(calculator, data.sequence_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_ARRAY: - calculate_serialized_size(calculator, data.array_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_MAP: - calculate_serialized_size(calculator, data.map_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_ENUM: - calculate_serialized_size(calculator, data.enumerated_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_BITMASK: - calculate_serialized_size(calculator, data.bitmask_type(), current_alignment); - break; - default: - calculate_serialized_size(calculator, data.extended_type(), current_alignment); - break; - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data._d(), current_alignment); - - switch (data._d()) - { - case eprosima::fastrtps::types::TK_ALIAS: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.alias_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_ANNOTATION: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.annotation_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_STRUCTURE: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 3), data.struct_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_UNION: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 4), data.union_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_BITSET: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 5), data.bitset_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_SEQUENCE: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 6), data.sequence_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_ARRAY: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 7), data.array_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_MAP: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 8), data.map_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_ENUM: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 9), data.enumerated_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_BITMASK: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 10), data.bitmask_type(), current_alignment); - break; - default: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 11), data.extended_type(), current_alignment); - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalTypeObject& data) -{ - scdr << data._d(); - - switch (data._d()) - { - case eprosima::fastrtps::types::TK_ALIAS: - scdr << data.alias_type(); - break; - case eprosima::fastrtps::types::TK_ANNOTATION: - scdr << data.annotation_type(); - break; - case eprosima::fastrtps::types::TK_STRUCTURE: - scdr << data.struct_type(); - break; - case eprosima::fastrtps::types::TK_UNION: - scdr << data.union_type(); - break; - case eprosima::fastrtps::types::TK_BITSET: - scdr << data.bitset_type(); - break; - case eprosima::fastrtps::types::TK_SEQUENCE: - scdr << data.sequence_type(); - break; - case eprosima::fastrtps::types::TK_ARRAY: - scdr << data.array_type(); - break; - case eprosima::fastrtps::types::TK_MAP: - scdr << data.map_type(); - break; - case eprosima::fastrtps::types::TK_ENUM: - scdr << data.enumerated_type(); - break; - case eprosima::fastrtps::types::TK_BITMASK: - scdr << data.bitmask_type(); - break; - default: - scdr << data.extended_type(); - break; - } -} - -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalTypeObject& data) -{ - dcdr >> data._d(); - - switch (data._d()) - { - case eprosima::fastrtps::types::TK_ALIAS: - dcdr >> data.alias_type(); - break; - case eprosima::fastrtps::types::TK_ANNOTATION: - dcdr >> data.annotation_type(); - break; - case eprosima::fastrtps::types::TK_STRUCTURE: - dcdr >> data.struct_type(); - break; - case eprosima::fastrtps::types::TK_UNION: - dcdr >> data.union_type(); - break; - case eprosima::fastrtps::types::TK_BITSET: - dcdr >> data.bitset_type(); - break; - case eprosima::fastrtps::types::TK_SEQUENCE: - dcdr >> data.sequence_type(); - break; - case eprosima::fastrtps::types::TK_ARRAY: - dcdr >> data.array_type(); - break; - case eprosima::fastrtps::types::TK_MAP: - dcdr >> data.map_type(); - break; - case eprosima::fastrtps::types::TK_ENUM: - dcdr >> data.enumerated_type(); - break; - case eprosima::fastrtps::types::TK_BITMASK: - dcdr >> data.bitmask_type(); - break; - default: - dcdr >> data.extended_type(); - break; - } -} - -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::TypeObject& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - switch (data._d()) - { - case eprosima::fastrtps::types::EK_COMPLETE: - calculate_serialized_size(calculator, data.complete(), current_alignment); - break; - case eprosima::fastrtps::types::EK_MINIMAL: - calculate_serialized_size(calculator, data.minimal(), current_alignment); - break; - default: - break; - } + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.field_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.field_seq().at(a), current_alignment); + } - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data._d(), current_alignment); - - switch (data._d()) - { - case eprosima::fastrtps::types::EK_COMPLETE: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.complete(), current_alignment); - break; - case eprosima::fastrtps::types::EK_MINIMAL: + 0), data.bitset_flags(), current_alignment); calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.minimal(), current_alignment); - break; - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::TypeObject& data) -{ - scdr << data._d(); - - switch (data._d()) - { - case eprosima::fastrtps::types::EK_COMPLETE: - scdr << data.complete(); - break; - case eprosima::fastrtps::types::EK_MINIMAL: - scdr << data.minimal(); - break; - default: - break; - } -} - -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::TypeObject& data) -{ - dcdr >> data._d(); - - switch (data._d()) - { - case eprosima::fastrtps::types::EK_COMPLETE: - dcdr >> data.complete(); - break; - case eprosima::fastrtps::types::EK_MINIMAL: - dcdr >> data.minimal(); - break; - default: - break; - } -} - -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::TypeIdentifierTypeObjectPair& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.type_identifier(), current_alignment); - calculate_serialized_size(calculator, data.type_object(), current_alignment); + 1), data.header(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.field_seq(), current_alignment); + + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + + return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 + } + + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalBitsetType& data) + { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast < uint16_t > (data.bitset_flags().bitset().to_ulong()); + scdr << bits; +#else + scdr << data.bitset_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 + scdr << data.header(); + scdr << data.field_seq(); + } + + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalBitsetType& data) + { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.bitset_flags().bitset(std::bitset < 16 > (bits)); +#else + dcdr >> data.bitset_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 + dcdr >> data.header(); + dcdr >> data.field_seq(); + } + + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator&, + const eprosima::fastrtps::types::CompleteExtendedType&, + size_t&) + { + return 0; + } + + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr&, + const eprosima::fastrtps::types::CompleteExtendedType&) + { + } + + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr&, + eprosima::fastrtps::types::CompleteExtendedType&) + { + } + + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator&, + const eprosima::fastrtps::types::MinimalExtendedType&, + size_t&) + { + return 0; + } + + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr&, + const eprosima::fastrtps::types::MinimalExtendedType&) + { + } + + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr&, + eprosima::fastrtps::types::MinimalExtendedType&) + { + } + + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::CompleteTypeObject& data, + size_t& current_alignment) + { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + switch (data._d()) + { + case eprosima::fastrtps::types::TK_ALIAS: + calculate_serialized_size(calculator, data.alias_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_ANNOTATION: + calculate_serialized_size(calculator, data.annotation_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_STRUCTURE: + calculate_serialized_size(calculator, data.struct_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_UNION: + calculate_serialized_size(calculator, data.union_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_BITSET: + calculate_serialized_size(calculator, data.bitset_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_SEQUENCE: + calculate_serialized_size(calculator, data.sequence_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_ARRAY: + calculate_serialized_size(calculator, data.array_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_MAP: + calculate_serialized_size(calculator, data.map_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_ENUM: + calculate_serialized_size(calculator, data.enumerated_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_BITMASK: + calculate_serialized_size(calculator, data.bitmask_type(), current_alignment); + break; + default: + calculate_serialized_size(calculator, data.extended_type(), current_alignment); + break; + } + + return current_alignment - initial_alignment; + +#else + + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - return current_alignment - initial_alignment; + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data._d(), current_alignment); + + switch (data._d()) + { + case eprosima::fastrtps::types::TK_ALIAS: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.alias_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_ANNOTATION: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.annotation_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_STRUCTURE: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 3), data.struct_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_UNION: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 4), data.union_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_BITSET: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 5), data.bitset_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_SEQUENCE: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 6), data.sequence_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_ARRAY: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 7), data.array_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_MAP: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 8), data.map_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_ENUM: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 9), data.enumerated_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_BITMASK: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 10), data.bitmask_type(), current_alignment); + break; + default: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 11), data.extended_type(), current_alignment); + break; + } + + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + + return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 + } + + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::CompleteTypeObject& data) + { + scdr << data._d(); + + switch (data._d()) + { + case eprosima::fastrtps::types::TK_ALIAS: + scdr << data.alias_type(); + break; + case eprosima::fastrtps::types::TK_ANNOTATION: + scdr << data.annotation_type(); + break; + case eprosima::fastrtps::types::TK_STRUCTURE: + scdr << data.struct_type(); + break; + case eprosima::fastrtps::types::TK_UNION: + scdr << data.union_type(); + break; + case eprosima::fastrtps::types::TK_BITSET: + scdr << data.bitset_type(); + break; + case eprosima::fastrtps::types::TK_SEQUENCE: + scdr << data.sequence_type(); + break; + case eprosima::fastrtps::types::TK_ARRAY: + scdr << data.array_type(); + break; + case eprosima::fastrtps::types::TK_MAP: + scdr << data.map_type(); + break; + case eprosima::fastrtps::types::TK_ENUM: + scdr << data.enumerated_type(); + break; + case eprosima::fastrtps::types::TK_BITMASK: + scdr << data.bitmask_type(); + break; + default: + scdr << data.extended_type(); + break; + } + } + + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::CompleteTypeObject& data) + { + dcdr >> data._d(); + + switch (data._d()) + { + case eprosima::fastrtps::types::TK_ALIAS: + dcdr >> data.alias_type(); + break; + case eprosima::fastrtps::types::TK_ANNOTATION: + dcdr >> data.annotation_type(); + break; + case eprosima::fastrtps::types::TK_STRUCTURE: + dcdr >> data.struct_type(); + break; + case eprosima::fastrtps::types::TK_UNION: + dcdr >> data.union_type(); + break; + case eprosima::fastrtps::types::TK_BITSET: + dcdr >> data.bitset_type(); + break; + case eprosima::fastrtps::types::TK_SEQUENCE: + dcdr >> data.sequence_type(); + break; + case eprosima::fastrtps::types::TK_ARRAY: + dcdr >> data.array_type(); + break; + case eprosima::fastrtps::types::TK_MAP: + dcdr >> data.map_type(); + break; + case eprosima::fastrtps::types::TK_ENUM: + dcdr >> data.enumerated_type(); + break; + case eprosima::fastrtps::types::TK_BITMASK: + dcdr >> data.bitmask_type(); + break; + default: + dcdr >> data.extended_type(); + break; + } + } + + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::MinimalTypeObject& data, + size_t& current_alignment) + { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + switch (data._d()) + { + case eprosima::fastrtps::types::TK_ALIAS: + calculate_serialized_size(calculator, data.alias_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_ANNOTATION: + calculate_serialized_size(calculator, data.annotation_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_STRUCTURE: + calculate_serialized_size(calculator, data.struct_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_UNION: + calculate_serialized_size(calculator, data.union_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_BITSET: + calculate_serialized_size(calculator, data.bitset_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_SEQUENCE: + calculate_serialized_size(calculator, data.sequence_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_ARRAY: + calculate_serialized_size(calculator, data.array_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_MAP: + calculate_serialized_size(calculator, data.map_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_ENUM: + calculate_serialized_size(calculator, data.enumerated_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_BITMASK: + calculate_serialized_size(calculator, data.bitmask_type(), current_alignment); + break; + default: + calculate_serialized_size(calculator, data.extended_type(), current_alignment); + break; + } + + return current_alignment - initial_alignment; + +#else + + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; -#else + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data._d(), current_alignment); + + switch (data._d()) + { + case eprosima::fastrtps::types::TK_ALIAS: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.alias_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_ANNOTATION: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.annotation_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_STRUCTURE: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 3), data.struct_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_UNION: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 4), data.union_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_BITSET: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 5), data.bitset_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_SEQUENCE: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 6), data.sequence_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_ARRAY: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 7), data.array_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_MAP: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 8), data.map_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_ENUM: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 9), data.enumerated_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_BITMASK: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 10), data.bitmask_type(), current_alignment); + break; + default: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 11), data.extended_type(), current_alignment); + break; + } + + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + + return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 + } + + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::MinimalTypeObject& data) + { + scdr << data._d(); + + switch (data._d()) + { + case eprosima::fastrtps::types::TK_ALIAS: + scdr << data.alias_type(); + break; + case eprosima::fastrtps::types::TK_ANNOTATION: + scdr << data.annotation_type(); + break; + case eprosima::fastrtps::types::TK_STRUCTURE: + scdr << data.struct_type(); + break; + case eprosima::fastrtps::types::TK_UNION: + scdr << data.union_type(); + break; + case eprosima::fastrtps::types::TK_BITSET: + scdr << data.bitset_type(); + break; + case eprosima::fastrtps::types::TK_SEQUENCE: + scdr << data.sequence_type(); + break; + case eprosima::fastrtps::types::TK_ARRAY: + scdr << data.array_type(); + break; + case eprosima::fastrtps::types::TK_MAP: + scdr << data.map_type(); + break; + case eprosima::fastrtps::types::TK_ENUM: + scdr << data.enumerated_type(); + break; + case eprosima::fastrtps::types::TK_BITMASK: + scdr << data.bitmask_type(); + break; + default: + scdr << data.extended_type(); + break; + } + } + + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::MinimalTypeObject& data) + { + dcdr >> data._d(); + + switch (data._d()) + { + case eprosima::fastrtps::types::TK_ALIAS: + dcdr >> data.alias_type(); + break; + case eprosima::fastrtps::types::TK_ANNOTATION: + dcdr >> data.annotation_type(); + break; + case eprosima::fastrtps::types::TK_STRUCTURE: + dcdr >> data.struct_type(); + break; + case eprosima::fastrtps::types::TK_UNION: + dcdr >> data.union_type(); + break; + case eprosima::fastrtps::types::TK_BITSET: + dcdr >> data.bitset_type(); + break; + case eprosima::fastrtps::types::TK_SEQUENCE: + dcdr >> data.sequence_type(); + break; + case eprosima::fastrtps::types::TK_ARRAY: + dcdr >> data.array_type(); + break; + case eprosima::fastrtps::types::TK_MAP: + dcdr >> data.map_type(); + break; + case eprosima::fastrtps::types::TK_ENUM: + dcdr >> data.enumerated_type(); + break; + case eprosima::fastrtps::types::TK_BITMASK: + dcdr >> data.bitmask_type(); + break; + default: + dcdr >> data.extended_type(); + break; + } + } + + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::TypeObject& data, + size_t& current_alignment) + { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + switch (data._d()) + { + case eprosima::fastrtps::types::EK_COMPLETE: + calculate_serialized_size(calculator, data.complete(), current_alignment); + break; + case eprosima::fastrtps::types::EK_MINIMAL: + calculate_serialized_size(calculator, data.minimal(), current_alignment); + break; + default: + break; + } + + return current_alignment - initial_alignment; + +#else + + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data._d(), current_alignment); + + switch (data._d()) + { + case eprosima::fastrtps::types::EK_COMPLETE: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.complete(), current_alignment); + break; + case eprosima::fastrtps::types::EK_MINIMAL: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.minimal(), current_alignment); + break; + default: + break; + } + + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + + return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 + } + + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::TypeObject& data) + { + scdr << data._d(); + + switch (data._d()) + { + case eprosima::fastrtps::types::EK_COMPLETE: + scdr << data.complete(); + break; + case eprosima::fastrtps::types::EK_MINIMAL: + scdr << data.minimal(); + break; + default: + break; + } + } + + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::TypeObject& data) + { + dcdr >> data._d(); + + switch (data._d()) + { + case eprosima::fastrtps::types::EK_COMPLETE: + dcdr >> data.complete(); + break; + case eprosima::fastrtps::types::EK_MINIMAL: + dcdr >> data.minimal(); + break; + default: + break; + } + } + + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::TypeIdentifierTypeObjectPair& data, + size_t& current_alignment) + { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.type_identifier(), current_alignment); + calculate_serialized_size(calculator, data.type_object(), current_alignment); + + return current_alignment - initial_alignment; + +#else + + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.type_identifier(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.type_object(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.type_identifier(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.type_object(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::TypeIdentifierTypeObjectPair& data) -{ - scdr << data.type_identifier(); - scdr << data.type_object(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::TypeIdentifierTypeObjectPair& data) + { + scdr << data.type_identifier(); + scdr << data.type_object(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::TypeIdentifierTypeObjectPair& data) -{ - dcdr >> data.type_identifier(); - dcdr >> data.type_object(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::TypeIdentifierTypeObjectPair& data) + { + dcdr >> data.type_identifier(); + dcdr >> data.type_object(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::TypeIdentifierPair& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::TypeIdentifierPair& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.type_identifier1(), current_alignment); - calculate_serialized_size(calculator, data.type_identifier2(), current_alignment); + calculate_serialized_size(calculator, data.type_identifier1(), current_alignment); + calculate_serialized_size(calculator, data.type_identifier2(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.type_identifier1(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.type_identifier2(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.type_identifier1(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.type_identifier2(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::TypeIdentifierPair& data) -{ - scdr << data.type_identifier1(); - scdr << data.type_identifier2(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::TypeIdentifierPair& data) + { + scdr << data.type_identifier1(); + scdr << data.type_identifier2(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::TypeIdentifierPair& data) -{ - dcdr >> data.type_identifier1(); - dcdr >> data.type_identifier2(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::TypeIdentifierPair& data) + { + dcdr >> data.type_identifier1(); + dcdr >> data.type_identifier2(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::TypeIdentifierWithSize& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::TypeIdentifierWithSize& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.type_id(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + calculate_serialized_size(calculator, data.type_id(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.type_id(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.typeobject_serialized_size(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.type_id(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.typeobject_serialized_size(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::TypeIdentifierWithSize& data) -{ - scdr << data.type_id(); - scdr << data.typeobject_serialized_size(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::TypeIdentifierWithSize& data) + { + scdr << data.type_id(); + scdr << data.typeobject_serialized_size(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::TypeIdentifierWithSize& data) -{ - dcdr >> data.type_id(); - dcdr >> data.typeobject_serialized_size(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::TypeIdentifierWithSize& data) + { + dcdr >> data.type_id(); + dcdr >> data.typeobject_serialized_size(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::TypeIdentifierWithDependencies& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::TypeIdentifierWithDependencies& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.typeid_with_size(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + calculate_serialized_size(calculator, data.typeid_with_size(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.dependent_typeids().size(); ++a) - { - calculate_serialized_size(calculator, data.dependent_typeids().at( - a), current_alignment); - } + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.dependent_typeids().size(); ++a) + { + calculate_serialized_size(calculator, data.dependent_typeids().at( + a), current_alignment); + } - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.typeid_with_size(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.dependent_typeid_count(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.dependent_typeids(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.typeid_with_size(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.dependent_typeid_count(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.dependent_typeids(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::TypeIdentifierWithDependencies& data) -{ - scdr << data.typeid_with_size(); - scdr << data.dependent_typeid_count(); - scdr << data.dependent_typeids(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::TypeIdentifierWithDependencies& data) + { + scdr << data.typeid_with_size(); + scdr << data.dependent_typeid_count(); + scdr << data.dependent_typeids(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::TypeIdentifierWithDependencies& data) -{ - dcdr >> data.typeid_with_size(); - dcdr >> data.dependent_typeid_count(); - dcdr >> data.dependent_typeids(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::TypeIdentifierWithDependencies& data) + { + dcdr >> data.typeid_with_size(); + dcdr >> data.dependent_typeid_count(); + dcdr >> data.dependent_typeids(); + } -template<> -FASTDDS_EXPORTED_API size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::TypeInformation& data, - size_t& current_alignment) -{ + template < > + FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::TypeInformation& data, + size_t& current_alignment) + { #if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; + size_t initial_alignment = current_alignment; - calculate_serialized_size(calculator, data.minimal(), current_alignment); - calculate_serialized_size(calculator, data.complete(), current_alignment); + calculate_serialized_size(calculator, data.minimal(), current_alignment); + calculate_serialized_size(calculator, data.complete(), current_alignment); - return current_alignment - initial_alignment; + return current_alignment - initial_alignment; #else - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + size_t calculated_size { + calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment) + }; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.minimal(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.complete(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.minimal(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.complete(), current_alignment); - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + return calculated_size; #endif // FASTCDR_VERSION_MAJOR == 1 -} + } -template<> -FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::TypeInformation& data) -{ - scdr << data.minimal(); - scdr << data.complete(); -} + template < > + FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::TypeInformation& data) + { + scdr << data.minimal(); + scdr << data.complete(); + } -template<> -FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::TypeInformation& data) -{ - dcdr >> data.minimal(); - dcdr >> data.complete(); -} + template < > + FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::TypeInformation& data) + { + dcdr >> data.minimal(); + dcdr >> data.complete(); + } -} // namespace fastcdr + } // namespace fastcdr } // namespace eprosima #endif // DYNAMIC_TYPES_TYPEOBJECTCDRAUX_IPP diff --git a/src/cpp/rtps/transport/shared_mem/test_SharedMemTransportDescriptor.h b/src/cpp/rtps/transport/shared_mem/test_SharedMemTransportDescriptor.h index 1071e856de1..f0576c700d4 100644 --- a/src/cpp/rtps/transport/shared_mem/test_SharedMemTransportDescriptor.h +++ b/src/cpp/rtps/transport/shared_mem/test_SharedMemTransportDescriptor.h @@ -28,7 +28,9 @@ namespace rtps { */ typedef struct test_SharedMemTransportDescriptor : public SharedMemTransportDescriptor { - virtual ~test_SharedMemTransportDescriptor() {} + virtual ~test_SharedMemTransportDescriptor() + { + } FASTDDS_EXPORTED_API test_SharedMemTransportDescriptor(); FASTDDS_EXPORTED_API test_SharedMemTransportDescriptor(