diff --git a/ddsrecorder/test/blackbox/FileCreationTest.hpp b/ddsrecorder/test/blackbox/FileCreationTest.hpp index 6b74326a..a65fd8e5 100644 --- a/ddsrecorder/test/blackbox/FileCreationTest.hpp +++ b/ddsrecorder/test/blackbox/FileCreationTest.hpp @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -42,7 +43,6 @@ #include #include -#include #include #include diff --git a/ddsrecorder/test/blackbox/mcap/McapFileCreationTest.cpp b/ddsrecorder/test/blackbox/mcap/McapFileCreationTest.cpp index 9fb75bc4..18ffae5d 100644 --- a/ddsrecorder/test/blackbox/mcap/McapFileCreationTest.cpp +++ b/ddsrecorder/test/blackbox/mcap/McapFileCreationTest.cpp @@ -17,6 +17,8 @@ #include #include + +#include #include #include @@ -30,7 +32,6 @@ #include #include -#include #include diff --git a/ddsrecorder/test/blackbox/mcap/McapLogErrorTest.cpp b/ddsrecorder/test/blackbox/mcap/McapLogErrorTest.cpp index be77744a..d58c9440 100644 --- a/ddsrecorder/test/blackbox/mcap/McapLogErrorTest.cpp +++ b/ddsrecorder/test/blackbox/mcap/McapLogErrorTest.cpp @@ -14,12 +14,12 @@ #include +#include #include #include #include #include -#include #include #include diff --git a/ddsrecorder/test/blackbox/sql/SqlFileCreationTest.cpp b/ddsrecorder/test/blackbox/sql/SqlFileCreationTest.cpp index f50b50e2..43368b78 100644 --- a/ddsrecorder/test/blackbox/sql/SqlFileCreationTest.cpp +++ b/ddsrecorder/test/blackbox/sql/SqlFileCreationTest.cpp @@ -23,12 +23,12 @@ #include +#include #include #include #include #include -#include #include diff --git a/ddsrecorder/test/blackbox/sql/SqlLogErrorTest.cpp b/ddsrecorder/test/blackbox/sql/SqlLogErrorTest.cpp index 245a5a17..68150799 100644 --- a/ddsrecorder/test/blackbox/sql/SqlLogErrorTest.cpp +++ b/ddsrecorder/test/blackbox/sql/SqlLogErrorTest.cpp @@ -14,12 +14,12 @@ #include +#include #include #include #include #include -#include #include #include diff --git a/ddsrecorder_participants/include/ddsrecorder_participants/common/serialize/Serializer.hpp b/ddsrecorder_participants/include/ddsrecorder_participants/common/serialize/Serializer.hpp index 40b9c8e8..cf5b8141 100644 --- a/ddsrecorder_participants/include/ddsrecorder_participants/common/serialize/Serializer.hpp +++ b/ddsrecorder_participants/include/ddsrecorder_participants/common/serialize/Serializer.hpp @@ -22,6 +22,10 @@ #include +#include +#include + + namespace eprosima { namespace ddsrecorder { namespace participants { @@ -75,6 +79,20 @@ class DDSRECORDER_PARTICIPANTS_DllAPI Serializer const std::string& type_str); }; +// Explicitly declare the specializations +template <> +DDSRECORDER_PARTICIPANTS_DllAPI ddspipe::core::types::TopicQoS Serializer::deserialize(const std::string& topic_qos_str); + +template <> +DDSRECORDER_PARTICIPANTS_DllAPI fastdds::dds::xtypes::TypeIdentifier Serializer::deserialize(const std::string& serialized_str); + +template <> +DDSRECORDER_PARTICIPANTS_DllAPI fastdds::dds::xtypes::TypeObject Serializer::deserialize(const std::string& serialized_str); + +template <> +DDSRECORDER_PARTICIPANTS_DllAPI DynamicTypesCollection Serializer::deserialize(const std::string& raw_data_str); + + } /* namespace participants */ } /* namespace ddsrecorder */ } /* namespace eprosima */ diff --git a/ddsrecorder_participants/src/cpp/common/serialize/Serializer.cpp b/ddsrecorder_participants/src/cpp/common/serialize/Serializer.cpp index 70cccf43..e4edef00 100644 --- a/ddsrecorder_participants/src/cpp/common/serialize/Serializer.cpp +++ b/ddsrecorder_participants/src/cpp/common/serialize/Serializer.cpp @@ -22,10 +22,7 @@ #include #include -#include - #include -#include #include #include @@ -79,6 +76,7 @@ std::string Serializer::serialize( } template <> +DDSRECORDER_PARTICIPANTS_DllAPI ddspipe::core::types::TopicQoS Serializer::deserialize( const std::string& topic_qos_str) { @@ -129,6 +127,7 @@ ddspipe::core::types::TopicQoS Serializer::deserialize( } template <> +DDSRECORDER_PARTICIPANTS_DllAPI fastdds::dds::xtypes::TypeIdentifier Serializer::deserialize( const std::string& type_identifier_str) { @@ -136,6 +135,7 @@ fastdds::dds::xtypes::TypeIdentifier Serializer::deserialize( } template <> +DDSRECORDER_PARTICIPANTS_DllAPI fastdds::dds::xtypes::TypeObject Serializer::deserialize( const std::string& type_object_str) { @@ -143,6 +143,7 @@ fastdds::dds::xtypes::TypeObject Serializer::deserialize( } template <> +DDSRECORDER_PARTICIPANTS_DllAPI DynamicTypesCollection Serializer::deserialize( const std::string& raw_data_str) { diff --git a/ddsrecorder_participants/src/cpp/common/time_utils.cpp b/ddsrecorder_participants/src/cpp/common/time_utils.cpp index 3042a630..7be7fc67 100644 --- a/ddsrecorder_participants/src/cpp/common/time_utils.cpp +++ b/ddsrecorder_participants/src/cpp/common/time_utils.cpp @@ -52,7 +52,7 @@ utils::Timestamp to_std_timestamp( throw std::runtime_error("No dot found in the timestamp"); } - auto time_point = utils::string_to_timestamp(time.substr(0, dot_pos), SQL_TIMESTAMP_FORMAT); + std::chrono::time_point time_point = utils::string_to_timestamp(time.substr(0, dot_pos), SQL_TIMESTAMP_FORMAT); const auto decimals = time.substr(dot_pos + 1); std::uint32_t nanoseconds; @@ -62,8 +62,8 @@ utils::Timestamp to_std_timestamp( { throw std::runtime_error("Failed to parse fractional part as an integer"); } - - time_point += std::chrono::nanoseconds(nanoseconds); + + time_point = std::chrono::time_point_cast(time_point + std::chrono::nanoseconds(nanoseconds)); return time_point; }