Skip to content

Commit f7b2b9f

Browse files
EduPonzrichiware
authored andcommitted
Refs #21325: Remove FASTCDR_VERSION_MAJOR == 1 related code
Signed-off-by: eduponz <eduardoponz@eprosima.com>
1 parent aa80b72 commit f7b2b9f

17 files changed

Lines changed: 0 additions & 10388 deletions

File tree

include/fastdds/config.hpp.in

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,4 @@
124124
(FASTDDS_VERSION_MAJOR == major && FASTDDS_VERSION_MINOR < minor), \
125125
"TODO before version " #major "." #minor " : " #msg)
126126

127-
#if FASTCDR_VERSION_MAJOR > 1
128-
#define FASTDDS_SER_METHOD_DEPRECATED(major, entity_name, msg) FASTDDS_DEPRECATED_UNTIL(major, entity_name, msg)
129-
#else
130-
#define FASTDDS_SER_METHOD_DEPRECATED(major, entity_name, msg)
131-
#endif // if FASTCDR_VERSION_MAJOR > 1
132-
133127
#endif // FASTDDS__CONFIG_H

include/fastdds/rtps/common/CdrSerialization.hpp

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -20,76 +20,6 @@
2020
#define FASTDDS_RTPS_COMMON__CDRSERIALIZATION_HPP
2121

2222
#include <fastcdr/Cdr.h>
23-
24-
#if FASTCDR_VERSION_MAJOR == 1
25-
26-
#include <fastcdr/exceptions/BadParamException.h>
27-
#include <fastcdr/cdr/fixed_size_string.hpp>
28-
29-
namespace eprosima {
30-
namespace fastcdr {
31-
32-
namespace CdrVersion {
33-
const eprosima::fastcdr::Cdr::CdrType DDS_CDR = eprosima::fastcdr::Cdr::CdrType::DDS_CDR;
34-
const eprosima::fastcdr::Cdr::CdrType XCDRv1 = eprosima::fastcdr::Cdr::CdrType::DDS_CDR;
35-
const eprosima::fastcdr::Cdr::CdrType XCDRv2 = eprosima::fastcdr::Cdr::CdrType::DDS_CDR;
36-
} // namespace CdrVersion
37-
38-
class CdrSizeCalculator;
39-
40-
template<class _T>
41-
extern size_t calculate_serialized_size(
42-
eprosima::fastcdr::CdrSizeCalculator& calculator,
43-
const _T& data,
44-
size_t& current_alignment);
45-
46-
template<class _T>
47-
extern void serialize(
48-
Cdr&,
49-
const _T&);
50-
51-
template<class _T>
52-
extern void deserialize(
53-
Cdr&,
54-
_T&);
55-
56-
// Dummy class
57-
class CdrSizeCalculator
58-
{
59-
public:
60-
61-
CdrSizeCalculator(
62-
eprosima::fastcdr::Cdr::CdrType)
63-
{
64-
}
65-
66-
template<class _T>
67-
size_t calculate_serialized_size(
68-
const _T& data,
69-
size_t current_alignment)
70-
{
71-
return eprosima::fastcdr::calculate_serialized_size(*this, data, current_alignment);
72-
}
73-
74-
};
75-
76-
template<size_t MAX_CHARS>
77-
using fastcdr::fixed_string = eprosima::fastcdr::fixed_string<MAX_CHARS>;
78-
79-
} // namespace fastcdr
80-
} // namespace eprosima
81-
82-
namespace eprosima {
83-
namespace fastdds {
84-
namespace rtps {
85-
//! Default XCDR encoding version used in Fast DDS.
86-
constexpr eprosima::fastcdr::Cdr::CdrType DEFAULT_XCDR_VERSION {eprosima::fastcdr::Cdr::CdrType::DDS_CDR};
87-
} // namespace rtps
88-
} // namespace fastdds
89-
} // namespace eprosima
90-
91-
#else
92-
9323
#include <fastcdr/CdrSizeCalculator.hpp>
9424

9525
namespace eprosima {
@@ -101,6 +31,4 @@ constexpr eprosima::fastcdr::CdrVersion DEFAULT_XCDR_VERSION {eprosima::fastcdr:
10131
} // namespace fastdds
10232
} // namespace eprosima
10333

104-
#endif //FASTCDR_VERSION_MAJOR == 1
105-
10634
#endif // FASTDDS_RTPS_COMMON__CDRSERIALIZATION_HPP

src/cpp/fastdds/core/policy/QosPoliciesSerializer.hpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -906,13 +906,8 @@ inline bool QosPoliciesSerializer<TypeIdV1>::add_to_cdr_message(
906906
ser.serialize_encapsulation();
907907

908908
ser << qos_policy.m_type_identifier;
909-
#if FASTCDR_VERSION_MAJOR == 1
910-
payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length
911-
size = (ser.getSerializedDataLength() + 3) & ~3;
912-
#else
913909
payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length
914910
size = (ser.get_serialized_data_length() + 3) & ~3;
915-
#endif // FASTCDR_VERSION_MAJOR == 1
916911

917912
bool valid = rtps::CDRMessage::addUInt16(cdr_message, qos_policy.Pid);
918913
valid &= rtps::CDRMessage::addUInt16(cdr_message, static_cast<uint16_t>(size));
@@ -938,9 +933,6 @@ inline bool QosPoliciesSerializer<TypeIdV1>::read_content_from_cdr_message(
938933
rtps::CDRMessage::readData(cdr_message, payload.data, parameter_length); // Object that manages the raw buffer.
939934

940935
eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN
941-
#if FASTCDR_VERSION_MAJOR == 1
942-
, eprosima::fastcdr::Cdr::CdrType::DDS_CDR
943-
#endif // FASTCDR_VERSION_MAJOR == 1
944936
);
945937

946938
try
@@ -988,13 +980,8 @@ inline bool QosPoliciesSerializer<TypeObjectV1>::add_to_cdr_message(
988980
ser.serialize_encapsulation();
989981

990982
ser << qos_policy.m_type_object;
991-
#if FASTCDR_VERSION_MAJOR == 1
992-
payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length
993-
size = (ser.getSerializedDataLength() + 3) & ~3;
994-
#else
995983
payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length
996984
size = (ser.get_serialized_data_length() + 3) & ~3;
997-
#endif // FASTCDR_VERSION_MAJOR == 1
998985

999986
bool valid = rtps::CDRMessage::addUInt16(cdr_message, qos_policy.Pid);
1000987
valid &= rtps::CDRMessage::addUInt16(cdr_message, static_cast<uint16_t>(size));
@@ -1020,9 +1007,6 @@ inline bool QosPoliciesSerializer<TypeObjectV1>::read_content_from_cdr_message(
10201007
rtps::CDRMessage::readData(cdr_message, payload.data, parameter_length); // Object that manages the raw buffer.
10211008

10221009
eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN
1023-
#if FASTCDR_VERSION_MAJOR == 1
1024-
, eprosima::fastcdr::Cdr::CdrType::DDS_CDR
1025-
#endif // FASTCDR_VERSION_MAJOR == 1
10261010
);
10271011

10281012
try
@@ -1071,13 +1055,8 @@ inline bool QosPoliciesSerializer<xtypes::TypeInformationParameter>::add_to_cdr_
10711055
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2);
10721056

10731057
ser << qos_policy.type_information;
1074-
#if FASTCDR_VERSION_MAJOR == 1
1075-
payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length
1076-
size = (ser.getSerializedDataLength() + 3) & ~3;
1077-
#else
10781058
payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length
10791059
size = (ser.get_serialized_data_length() + 3) & ~3;
1080-
#endif // FASTCDR_VERSION_MAJOR == 1
10811060

10821061
bool valid = rtps::CDRMessage::addUInt16(cdr_message, qos_policy.Pid);
10831062
valid &= rtps::CDRMessage::addUInt16(cdr_message, static_cast<uint16_t>(size));

src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ bool DDSFilterExpression::evaluate(
5555
{
5656
FastBuffer fastbuffer(reinterpret_cast<char*>(payload.data), payload.length);
5757
Cdr deser(fastbuffer
58-
#if FASTCDR_VERSION_MAJOR == 1
59-
, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN
60-
, eprosima::fastcdr::Cdr::CdrType::DDS_CDR
61-
#endif // FASTCDR_VERSION_MAJOR == 1
6258
);
6359
deser.read_encapsulation();
6460
traits<DynamicData>::narrow<DynamicDataImpl>(dyn_data_)->deserialize(deser);

src/cpp/rtps/transport/tcp/TCPControlMessage.cpp

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,7 @@ bool ConnectionRequest_t::serialize(
164164
return false;
165165
}
166166

167-
#if FASTCDR_VERSION_MAJOR == 1
168-
payload->length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length
169-
#else
170167
payload->length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length
171-
#endif // FASTCDR_VERSION_MAJOR == 1
172168

173169
return true;
174170
}
@@ -256,11 +252,7 @@ bool OpenLogicalPortRequest_t::serialize(
256252
return false;
257253
}
258254

259-
#if FASTCDR_VERSION_MAJOR == 1
260-
payload->length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length
261-
#else
262255
payload->length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length
263-
#endif // FASTCDR_VERSION_MAJOR == 1
264256

265257
return true;
266258
}
@@ -349,11 +341,7 @@ bool CheckLogicalPortsRequest_t::serialize(
349341
return false;
350342
}
351343

352-
#if FASTCDR_VERSION_MAJOR == 1
353-
payload->length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length
354-
#else
355344
payload->length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length
356-
#endif // FASTCDR_VERSION_MAJOR == 1
357345

358346
return true;
359347
}
@@ -441,11 +429,7 @@ bool KeepAliveRequest_t::serialize(
441429
return false;
442430
}
443431

444-
#if FASTCDR_VERSION_MAJOR == 1
445-
payload->length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length
446-
#else
447432
payload->length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length
448-
#endif // FASTCDR_VERSION_MAJOR == 1
449433

450434
return true;
451435
}
@@ -533,11 +517,7 @@ bool LogicalPortIsClosedRequest_t::serialize(
533517
return false;
534518
}
535519

536-
#if FASTCDR_VERSION_MAJOR == 1
537-
payload->length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length
538-
#else
539520
payload->length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length
540-
#endif // FASTCDR_VERSION_MAJOR == 1
541521

542522
return true;
543523
}
@@ -625,11 +605,7 @@ bool BindConnectionResponse_t::serialize(
625605
return false;
626606
}
627607

628-
#if FASTCDR_VERSION_MAJOR == 1
629-
payload->length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length
630-
#else
631608
payload->length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length
632-
#endif // FASTCDR_VERSION_MAJOR == 1
633609

634610
return true;
635611
}
@@ -718,11 +694,7 @@ bool CheckLogicalPortsResponse_t::serialize(
718694
return false;
719695
}
720696

721-
#if FASTCDR_VERSION_MAJOR == 1
722-
payload->length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length
723-
#else
724697
payload->length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length
725-
#endif // FASTCDR_VERSION_MAJOR == 1
726698

727699
return true;
728700
}

src/cpp/security/cryptography/AESGCMGMAC_Transform.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,6 @@
3838
#undef max
3939
#endif // ifdef WIN32
4040

41-
#if FASTCDR_VERSION_MAJOR == 1
42-
#define change_endianness changeEndianness
43-
#define get_serialized_data_length getSerializedDataLength
44-
#define get_state getState
45-
#define get_current_position getCurrentPosition
46-
#define get_buffer_pointer getBufferPointer
47-
#define set_state setState
48-
#endif // FASTCDR_VERSION_MAJOR == 1
49-
5041
namespace eprosima {
5142
namespace fastdds {
5243
namespace rtps {

test/blackbox/common/DDSBlackboxTestsDataRepresentationQos.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
using namespace eprosima::fastdds::dds;
2626

27-
#if FASTCDR_VERSION_MAJOR > 1
28-
2927
class MockHelloWorldPubSubType : public HelloWorldPubSubType
3028
{
3129
public:
@@ -150,5 +148,3 @@ INSTANTIATE_TEST_SUITE_P(
150148
std::make_tuple(XCDR2_VECTOR, XCDR2_VECTOR, true, XCDR2_DATA_REPRESENTATION, eprosima::fastcdr::PLAIN_CDR2),
151149
std::make_tuple(XCDR2_VECTOR, BOTH_XCDR_VECTOR, true, XCDR2_DATA_REPRESENTATION, eprosima::fastcdr::PLAIN_CDR2)
152150
));
153-
154-
#endif // FASTCDR_VERSION_MAJOR > 1

test/blackbox/common/RTPSAsSocketWriter.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,7 @@ class RTPSAsSocketWriter : public eprosima::fastdds::rtps::WriterListener
148148

149149
cdr << magicword_;
150150
cdr << *it;
151-
#if FASTCDR_VERSION_MAJOR == 1
152-
ch->serializedPayload.length = static_cast<uint32_t>(cdr.getSerializedDataLength());
153-
#else
154151
ch->serializedPayload.length = static_cast<uint32_t>(cdr.get_serialized_data_length());
155-
#endif // FASTCDR_VERSION_MAJOR == 1
156152

157153
history_->add_change(ch);
158154
it = msgs.erase(it);

test/blackbox/common/RTPSWithRegistrationReader.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -576,10 +576,6 @@ class RTPSWithRegistrationReader
576576
eprosima::fastcdr::FastBuffer buffer((char*)change->serializedPayload.data,
577577
change->serializedPayload.length);
578578
eprosima::fastcdr::Cdr cdr(buffer
579-
#if FASTCDR_VERSION_MAJOR == 1
580-
, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN
581-
, eprosima::fastcdr::Cdr::CdrType::DDS_CDR
582-
#endif // FASTCDR_VERSION_MAJOR == 1
583579
);
584580

585581
cdr.read_encapsulation();

0 commit comments

Comments
 (0)