Skip to content

Commit

Permalink
Rebase fix
Browse files Browse the repository at this point in the history
Signed-off-by: tempate <[email protected]>
  • Loading branch information
Tempate committed Jun 27, 2024
1 parent 9271cfe commit 8d371bc
Show file tree
Hide file tree
Showing 32 changed files with 227 additions and 374 deletions.
19 changes: 7 additions & 12 deletions ddsrecorder/test/blackbox/FileCreationTest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,13 @@

#include <ddsrecorder_yaml/recorder/YamlReaderConfiguration.hpp>

#if FASTRTPS_VERSION_MAJOR < 2 || (FASTRTPS_VERSION_MAJOR == 2 && FASTRTPS_VERSION_MINOR < 13)
#include "../resources/types/hello_world/v1/HelloWorld.h"
#include "../resources/types/hello_world/v1/HelloWorldPubSubTypes.h"
#else
#include "../resources/types/hello_world/v2/HelloWorld.h"
#include "../resources/types/hello_world/v2/HelloWorldPubSubTypes.h"
#endif // if FASTRTPS_VERSION_MAJOR < 2 || (FASTRTPS_VERSION_MAJOR == 2 && FASTRTPS_VERSION_MINOR < 13)

#include <tool/DdsRecorder.hpp>

#include "constants.hpp"

#include "../resources/types/hello_world/HelloWorld.hpp"
#include "../resources/types/hello_world/HelloWorldPubSubTypes.h"

using namespace eprosima;
using DdsRecorderState = ddsrecorder::recorder::DdsRecorderStateCode;

Expand Down Expand Up @@ -114,7 +109,7 @@ class FileCreationTest : public testing::Test

protected:

std::vector<std::shared_ptr<fastrtps::rtps::SerializedPayload_t>> record_messages_(
std::vector<std::shared_ptr<fastdds::rtps::SerializedPayload_t>> record_messages_(
const std::string& file_name,
const unsigned int messages1,
const DdsRecorderState state1 = DdsRecorderState::RUNNING,
Expand Down Expand Up @@ -189,7 +184,7 @@ class FileCreationTest : public testing::Test
return sent_messages;
}

std::vector<std::shared_ptr<fastrtps::rtps::SerializedPayload_t>> send_messages_(
std::vector<std::shared_ptr<fastdds::rtps::SerializedPayload_t>> send_messages_(
const unsigned int number_of_messages)
{
// Create the DataWriter
Expand All @@ -199,7 +194,7 @@ class FileCreationTest : public testing::Test
std::this_thread::sleep_for(std::chrono::milliseconds(100));

// Send the messages
std::vector<std::shared_ptr<fastrtps::rtps::SerializedPayload_t>> sent_messages;
std::vector<std::shared_ptr<fastdds::rtps::SerializedPayload_t>> sent_messages;

for (std::uint32_t i = 0; i < number_of_messages; i++)
{
Expand All @@ -213,7 +208,7 @@ class FileCreationTest : public testing::Test
// Serialize the message
HelloWorldPubSubType pubsubType;
const auto payload_size = pubsubType.getSerializedSizeProvider(&hello)();
auto payload = std::make_shared<fastrtps::rtps::SerializedPayload_t>(payload_size);
auto payload = std::make_shared<fastdds::rtps::SerializedPayload_t>(payload_size);
pubsubType.serialize(&hello, payload.get());

// Store the serialized message
Expand Down
4 changes: 2 additions & 2 deletions ddsrecorder/test/blackbox/mcap/McapFileCreationTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ TEST_F(McapFileCreationTest, mcap_data_num_msgs)
const std::string OUTPUT_FILE_NAME = "mcap_data_num_msgs";
const auto OUTPUT_FILE_PATH = get_output_file_path_(OUTPUT_FILE_NAME + ".mcap");

constexpr auto NUMBER_OF_MESSAGES = 10;
constexpr auto NUMBER_OF_MESSAGES = 128;

ASSERT_TRUE(delete_file_(OUTPUT_FILE_PATH));

Expand All @@ -276,7 +276,7 @@ TEST_F(McapFileCreationTest, mcap_data_num_msgs_downsampling)
const std::string OUTPUT_FILE_NAME = "mcap_data_num_msgs_downsampling";
const auto OUTPUT_FILE_PATH = get_output_file_path_(OUTPUT_FILE_NAME + ".mcap");

constexpr auto NUMBER_OF_MESSAGES = 10;
constexpr auto NUMBER_OF_MESSAGES = 128;
constexpr int DOWNSAMPLING = 2;

ASSERT_TRUE(delete_file_(OUTPUT_FILE_PATH));
Expand Down
2 changes: 1 addition & 1 deletion ddsrecorder/test/blackbox/sql/SqlFileCreationTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ TEST_F(SqlFileCreationTest, sql_data_num_msgs_downsampling)
const std::string OUTPUT_FILE_NAME = "sql_data_num_msgs_downsampling";
const auto OUTPUT_FILE_PATH = get_output_file_path_(OUTPUT_FILE_NAME + ".db");

constexpr auto NUMBER_OF_MESSAGES = 10;
constexpr auto NUMBER_OF_MESSAGES = 128;
constexpr int DOWNSAMPLING = 2;

ASSERT_TRUE(delete_file_(OUTPUT_FILE_PATH));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,13 @@ class DDSRECORDER_PARTICIPANTS_DllAPI Serializer
protected:

/**
* @brief Serialize a \c TypeObject or a \c TypeIdentifier into a \c SerializedPayload_t.
* @brief Serialize a \c TypeObject or a \c TypeIdentifier into a string.
*
* @param [in] object \c TypeObject or \c TypeIdentifier to serialize
* @return \c SerializedPayload_t with the serialization
*/
template <typename T>
static std::string type_data_to_type_str_(
const T& data,
const size_t size);
const T& data);

/**
* @brief Deserialize \c type_str into a \c TypeObject or a \c TypeIdentifier.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ mcap::Timestamp to_mcap_timestamp(
*/
DDSRECORDER_PARTICIPANTS_DllAPI
std::string to_sql_timestamp(
const fastrtps::rtps::Time_t& time,
const fastdds::rtps::Time_t& time,
const bool local_time = false);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <string>

#include <fastdds/rtps/common/SequenceNumber.h>
#include <fastrtps/types/DynamicType.h>
#include <fastdds/dds/xtypes/dynamic_types/DynamicType.hpp>

#include <ddspipe_core/efficiency/payload/PayloadPool.hpp>
#include <ddspipe_core/types/data/RtpsPayloadData.hpp>
Expand Down Expand Up @@ -66,13 +66,13 @@ struct SqlMessage : public BaseMessage
* @param dynamic_type DynamicType of the message.
*/
void set_key(
fastrtps::types::DynamicType_ptr dynamic_type);
fastdds::dds::DynamicType::_ref_type dynamic_type);

// Writer GUID
ddspipe::core::types::Guid writer_guid;

// Sequence number
fastrtps::rtps::SequenceNumber_t sequence_number;
fastdds::rtps::SequenceNumber_t sequence_number;

// Hashed value identifying the instance
ddspipe::core::types::InstanceHandle instance_handle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#include <cpp_utils/macros/custom_enumeration.hpp>

#include <fastrtps/types/DynamicType.h>
#include <fastdds/dds/xtypes/dynamic_types/DynamicType.hpp>

#include <ddspipe_core/efficiency/payload/PayloadPool.hpp>
#include <ddspipe_participants/participant/dynamic_types/ISchemaHandler.hpp>
Expand Down Expand Up @@ -366,7 +366,7 @@ class BaseHandler : public ddspipe::participants::ISchemaHandler
//////////////////////////////

//! Received types set
std::map<std::string, fastrtps::types::DynamicType_ptr> received_types_;
std::map<std::string, fastdds::dds::DynamicType::_ref_type> received_types_;

//! Dynamic types collection
DynamicTypesCollection dynamic_types_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#include <set>
#include <string>

#include <fastrtps/types/DynamicType.h>
#include <fastdds/dds/xtypes/dynamic_types/DynamicType.hpp>
#include <fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobject.hpp>

#include <ddspipe_core/efficiency/payload/PayloadPool.hpp>
#include <ddspipe_core/types/data/RtpsPayloadData.hpp>
Expand Down Expand Up @@ -96,7 +97,9 @@ class SqlHandler : public BaseHandler
*/
DDSRECORDER_PARTICIPANTS_DllAPI
void add_schema(
const fastrtps::types::DynamicType_ptr& dynamic_type) override;
const fastdds::dds::DynamicType::_ref_type& dynamic_type,
const std::string& type_name,
const fastdds::dds::xtypes::TypeIdentifier& type_id) override;

/**
* @brief Add a data sample to the given \c topic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,10 @@
#include <vector>

#include <cstdint>
#include <ddsrecorder_participants/common/types/dynamic_types_collection/DynamicTypesCollection.hpp>
#include <ddsrecorder_participants/library/library_dll.h>
#include <ddsrecorder_participants/recorder/output/BaseWriter.hpp>

#if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
#include <ddsrecorder_participants/common/types/dynamic_types_collection/v1/DynamicTypesCollection.hpp>
#else
#include <ddsrecorder_participants/common/types/dynamic_types_collection/v2/DynamicTypesCollection.hpp>
#endif // if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13

namespace eprosima {
namespace ddsrecorder {
namespace participants {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,10 @@

#include <ddspipe_participants/reader/auxiliar/InternalReader.hpp>

#include <ddsrecorder_participants/common/types/dynamic_types_collection/DynamicTypesCollection.hpp>
#include <ddsrecorder_participants/library/library_dll.h>
#include <ddsrecorder_participants/replayer/BaseReaderParticipantConfiguration.hpp>

#if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
#include <ddsrecorder_participants/common/types/dynamic_types_collection/v1/DynamicTypesCollection.hpp>
#else
#include <ddsrecorder_participants/common/types/dynamic_types_collection/v2/DynamicTypesCollection.hpp>
#endif // if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13

namespace eprosima {
namespace ddsrecorder {
namespace participants {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,11 @@

#include <ddspipe_core/efficiency/payload/PayloadPool.hpp>

#include <ddsrecorder_participants/common/types/dynamic_types_collection/DynamicTypesCollection.hpp>
#include <ddsrecorder_participants/library/library_dll.h>
#include <ddsrecorder_participants/replayer/BaseReaderParticipant.hpp>
#include <ddsrecorder_participants/replayer/BaseReaderParticipantConfiguration.hpp>

#if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
#include <ddsrecorder_participants/common/types/dynamic_types_collection/v1/DynamicTypesCollection.hpp>
#else
#include <ddsrecorder_participants/common/types/dynamic_types_collection/v2/DynamicTypesCollection.hpp>
#endif // if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13

namespace eprosima {
namespace ddsrecorder {
namespace participants {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,11 @@
#include <ddspipe_core/types/topic/dds/DdsTopic.hpp>
#include <ddspipe_core/types/topic/dds/DistributedTopic.hpp>

#include <ddsrecorder_participants/common/types/dynamic_types_collection/DynamicTypesCollection.hpp>
#include <ddsrecorder_participants/library/library_dll.h>
#include <ddsrecorder_participants/replayer/BaseReaderParticipant.hpp>
#include <ddsrecorder_participants/replayer/BaseReaderParticipantConfiguration.hpp>

#if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
#include <ddsrecorder_participants/common/types/dynamic_types_collection/v1/DynamicTypesCollection.hpp>
#else
#include <ddsrecorder_participants/common/types/dynamic_types_collection/v2/DynamicTypesCollection.hpp>
#endif // if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13

namespace eprosima {
namespace ddsrecorder {
namespace participants {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <ddsrecorder_participants/common/serialize/Serializer.hpp>
#include <ddsrecorder_participants/common/types/dynamic_types_collection/DynamicTypesCollection.hpp>
#include <ddsrecorder_participants/common/types/dynamic_types_collection/DynamicTypesCollectionPubSubTypes.h>
#include <ddsrecorder_participants/constants.hpp>

namespace eprosima {
Expand Down
4 changes: 2 additions & 2 deletions ddsrecorder_participants/src/cpp/common/time_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ utils::Timestamp to_std_timestamp(
}

mcap::Timestamp to_mcap_timestamp(
const fastrtps::rtps::Time_t& time)
const fastdds::rtps::Time_t& time)
{
return time.seconds() * NS_PER_SEC + time.nanosec();
}
Expand All @@ -81,7 +81,7 @@ mcap::Timestamp to_mcap_timestamp(
}

std::string to_sql_timestamp(
const fastrtps::rtps::Time_t& time,
const fastdds::rtps::Time_t& time,
const bool local_time /* = false */)
{
char datetime_str[30];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ void McapHandler::add_schema(
return;
}

// const std::string type_name = dynamic_type->get_name();

// Check if it exists already
if (received_types_.find(type_name) != received_types_.end())
{
Expand Down
Loading

0 comments on commit 8d371bc

Please sign in to comment.