Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions .github/workflows/reusable-ubuntu-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,14 @@ jobs:
uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0
with:
packages: libasio-dev libtinyxml2-dev libssl-dev
update: false
upgrade: false

- name: Install colcon
uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0

- name: Install Python dependencies
uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0
with:
packages: vcstool xmlschema xmltodict==0.13.0 jsondiff==2.0.0 pandas==1.5.2 psutil
upgrade: false
packages: vcstool xmlschema xmltodict==0.13.0 jsondiff==2.0.0 pandas==3.0.1 psutil

- name: Setup CCache
uses: eProsima/eProsima-CI/external/setup-ccache-action@v0
Expand Down Expand Up @@ -181,17 +178,14 @@ jobs:
uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0
with:
packages: libasio-dev libtinyxml2-dev libssl-dev
update: false
upgrade: false

- name: Install colcon
uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0

- name: Install Python dependencies
uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0
with:
packages: vcstool xmlschema xmltodict==0.13.0 jsondiff==2.0.0 pandas==1.5.2 psutil
upgrade: false
packages: vcstool xmlschema xmltodict==0.13.0 jsondiff==2.0.0 pandas==3.0.1 psutil

- name: Setup CCache
uses: eProsima/eProsima-CI/external/setup-ccache-action@v0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ To execute the tests that verify the proper operation of the Discovery Server di
to install some Python3 modules. These can be installed using `pip`.

```bash
pip3 install jsondiff==1.2.0 xmltodict==0.12.0 pandas==1.1.2
pip3 install jsondiff==2.0.0 xmltodict==0.13.0 pandas==3.0.1 psutil
```

A [discovery-server.repos](https://raw.githubusercontent.com/eProsima/Discovery-Server/master/discovery-server.repos)
Expand Down
2 changes: 1 addition & 1 deletion resources/xtypes/HelloWorld.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @file HelloWorld.hpp
* This header file contains the declaration of the described types in the IDL file.
*
* This file was generated by the tool fastddsgen (version: 4.2.0).
* This file was generated by the tool fastddsgen (version: 4.3.0).
*/

#ifndef FAST_DDS_GENERATED__HELLOWORLD_HPP
Expand Down
3 changes: 2 additions & 1 deletion resources/xtypes/HelloWorldCdrAux.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
* @file HelloWorldCdrAux.hpp
* This source file contains some definitions of CDR related functions.
*
* This file was generated by the tool fastddsgen (version: 4.2.0).
* This file was generated by the tool fastddsgen (version: 4.3.0).
*/

#ifndef FAST_DDS_GENERATED__HELLOWORLDCDRAUX_HPP
#define FAST_DDS_GENERATED__HELLOWORLDCDRAUX_HPP

#include "HelloWorld.hpp"

constexpr uint32_t HelloWorld_max_cdr_typesize {268UL};
constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL};

Expand Down
2 changes: 1 addition & 1 deletion resources/xtypes/HelloWorldCdrAux.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @file HelloWorldCdrAux.ipp
* This source file contains some declarations of CDR related functions.
*
* This file was generated by the tool fastddsgen (version: 4.2.0).
* This file was generated by the tool fastddsgen (version: 4.3.0).
*/

#ifndef FAST_DDS_GENERATED__HELLOWORLDCDRAUX_IPP
Expand Down
81 changes: 22 additions & 59 deletions resources/xtypes/HelloWorldPubSubTypes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@
* @file HelloWorldPubSubTypes.cpp
* This header file contains the implementation of the serialization functions.
*
* This file was generated by the tool fastddsgen (version: 4.2.0).
* This file was generated by the tool fastddsgen (version: 4.3.0).
*/

#include "HelloWorldPubSubTypes.hpp"

#include <algorithm>
#include <mutex>

#include <fastdds/dds/log/Log.hpp>
#include <fastdds/rtps/common/CdrSerialization.hpp>

#include "HelloWorldCdrAux.hpp"
#include "HelloWorldTypeObjectSupport.hpp"

using SerializedPayload_t = eprosima::fastdds::rtps::SerializedPayload_t;
using InstanceHandle_t = eprosima::fastdds::rtps::InstanceHandle_t;
using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t;
Expand All @@ -38,25 +39,19 @@ HelloWorldPubSubType::HelloWorldPubSubType()
type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */
max_serialized_type_size = type_size + 4; /*encapsulation*/
is_compute_key_provided = false;
uint32_t key_length = HelloWorld_max_key_cdr_typesize > 16 ? HelloWorld_max_key_cdr_typesize : 16;
key_buffer_ = reinterpret_cast<unsigned char*>(malloc(key_length));
memset(key_buffer_, 0, key_length);
}

HelloWorldPubSubType::~HelloWorldPubSubType()
{
if (key_buffer_ != nullptr)
{
free(key_buffer_);
}
}

bool HelloWorldPubSubType::serialize(
const void* const data,
SerializedPayload_t& payload,
DataRepresentationId_t data_representation)
{
const ::HelloWorld* p_type = static_cast<const ::HelloWorld*>(data);
const ::HelloWorld* p_type =
static_cast<const ::HelloWorld*>(data);

// Object that manages the raw buffer.
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(payload.data), payload.max_size);
Expand All @@ -76,7 +71,7 @@ bool HelloWorldPubSubType::serialize(
ser.serialize_encapsulation();
// Serialize the object.
ser << *p_type;
ser.set_dds_cdr_options({0,0});
ser.set_dds_cdr_options({0, 0});
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand All @@ -95,7 +90,8 @@ bool HelloWorldPubSubType::deserialize(
try
{
// Convert DATA to pointer of your type
::HelloWorld* p_type = static_cast<::HelloWorld*>(data);
::HelloWorld* p_type =
static_cast<::HelloWorld*>(data);

// Object that manages the raw buffer.
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(payload.data), payload.length);
Expand Down Expand Up @@ -128,9 +124,10 @@ uint32_t HelloWorldPubSubType::calculate_serialized_size(
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2);
size_t current_alignment {0};
return static_cast<uint32_t>(calculator.calculate_serialized_size(
*static_cast<const ::HelloWorld*>(data), current_alignment)) +
4u /*encapsulation*/;
const ::HelloWorld* p_type =
static_cast<const ::HelloWorld*>(data);
auto calc_size = calculator.calculate_serialized_size(*p_type, current_alignment);
return static_cast<uint32_t>(calc_size) + 4u /*encapsulation*/;
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand All @@ -154,16 +151,9 @@ bool HelloWorldPubSubType::compute_key(
InstanceHandle_t& handle,
bool force_md5)
{
if (!is_compute_key_provided)
{
return false;
}

::HelloWorld data;
if (deserialize(payload, static_cast<void*>(&data)))
{
return compute_key(static_cast<void*>(&data), handle, force_md5);
}
static_cast<void>(payload);
static_cast<void>(handle);
static_cast<void>(force_md5);

return false;
}
Expand All @@ -173,44 +163,17 @@ bool HelloWorldPubSubType::compute_key(
InstanceHandle_t& handle,
bool force_md5)
{
if (!is_compute_key_provided)
{
return false;
}

const ::HelloWorld* p_type = static_cast<const ::HelloWorld*>(data);

// Object that manages the raw buffer.
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(key_buffer_),
HelloWorld_max_key_cdr_typesize);
static_cast<void>(data);
static_cast<void>(handle);
static_cast<void>(force_md5);

// Object that serializes the data.
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
eprosima::fastcdr::serialize_key(ser, *p_type);
if (force_md5 || HelloWorld_max_key_cdr_typesize > 16)
{
md5_.init();
md5_.update(key_buffer_, static_cast<unsigned int>(ser.get_serialized_data_length()));
md5_.finalize();
for (uint8_t i = 0; i < 16; ++i)
{
handle.value[i] = md5_.digest[i];
}
}
else
{
for (uint8_t i = 0; i < 16; ++i)
{
handle.value[i] = key_buffer_[i];
}
}
return true;
return false;
}

void HelloWorldPubSubType::register_type_object_representation()
{
register_HelloWorld_type_identifier(type_identifiers_);
EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION,
"TypeObject type representation support disabled in generated code");
}


Expand Down
7 changes: 3 additions & 4 deletions resources/xtypes/HelloWorldPubSubTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
* @file HelloWorldPubSubTypes.hpp
* This header file contains the declaration of the serialization functions.
*
* This file was generated by the tool fastddsgen (version: 4.2.0).
* This file was generated by the tool fastddsgen (version: 4.3.0).
*/


#ifndef FAST_DDS_GENERATED__HELLOWORLD_PUBSUBTYPES_HPP
#define FAST_DDS_GENERATED__HELLOWORLD_PUBSUBTYPES_HPP

#include <mutex>

#include <fastdds/dds/core/policy/QosPolicies.hpp>
#include <fastdds/dds/topic/TopicDataType.hpp>
#include <fastdds/rtps/common/InstanceHandle.hpp>
Expand Down Expand Up @@ -114,9 +116,6 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType

private:

eprosima::fastdds::MD5 md5_;
unsigned char* key_buffer_;

};


Expand Down
Loading