From 755adc4da13b69fdc4ecec37a3298d869a5db490 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 30 May 2023 10:16:42 +0200 Subject: [PATCH] Capture all fastcdr exceptions (#3540) * Refs #18001. Fixes on DDSFilterExpression.cpp Signed-off-by: Miguel Company * Refs #18001. Fixes on TCPControlMessage.cpp Signed-off-by: Miguel Company * Refs #18001. Changes in DynamicPubSubType. Signed-off-by: Miguel Company * Refs #18001. Changes in TypeLookupTypes. Signed-off-by: Miguel Company * Refs #18001. Changes in AESGCMGMAC_Transform. Signed-off-by: Miguel Company * Refs #18001. Uncrustify. Signed-off-by: Miguel Company --------- Signed-off-by: Miguel Company (cherry picked from commit f4000e8544843c495e84305b5fe9c1b9d574743f) Co-authored-by: Miguel Company --- src/cpp/dynamic-types/DynamicPubSubType.cpp | 18 +- .../typelookup/common/TypeLookupTypes.cpp | 999 ++++++++++-------- .../DDSSQLFilter/DDSFilterExpression.cpp | 4 +- .../rtps/transport/tcp/TCPControlMessage.cpp | 98 +- .../cryptography/AESGCMGMAC_Transform.cpp | 106 +- 5 files changed, 658 insertions(+), 567 deletions(-) diff --git a/src/cpp/dynamic-types/DynamicPubSubType.cpp b/src/cpp/dynamic-types/DynamicPubSubType.cpp index e535ab9f676..f1d1710831b 100644 --- a/src/cpp/dynamic-types/DynamicPubSubType.cpp +++ b/src/cpp/dynamic-types/DynamicPubSubType.cpp @@ -108,15 +108,16 @@ bool DynamicPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer((char*)payload->data, payload->length); // Object that manages the raw buffer. eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); // Object that deserializes the data. - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; try { - ((DynamicData*)data)->deserialize(deser); //Deserialize the object: + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + //Deserialize the object: + ((DynamicData*)data)->deserialize(deser); } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } @@ -184,14 +185,13 @@ bool DynamicPubSubType::serialize( eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - try { + // Serialize encapsulation + ser.serialize_encapsulation(); ((DynamicData*)data)->serialize(ser); // Serialize the object: } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } diff --git a/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypes.cpp b/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypes.cpp index c17b5a2ba69..b16c740625a 100644 --- a/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypes.cpp +++ b/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypes.cpp @@ -41,67 +41,72 @@ TypeLookup_getTypes_Result::~TypeLookup_getTypes_Result() { } -TypeLookup_getTypes_Result::TypeLookup_getTypes_Result(const TypeLookup_getTypes_Result &x) +TypeLookup_getTypes_Result::TypeLookup_getTypes_Result( + const TypeLookup_getTypes_Result& x) { m__d = x.m__d; - switch(m__d) + switch (m__d) { - case 0: - m_result = x.m_result; - break; - default: - break; + case 0: + m_result = x.m_result; + break; + default: + break; } } -TypeLookup_getTypes_Result::TypeLookup_getTypes_Result(TypeLookup_getTypes_Result &&x) +TypeLookup_getTypes_Result::TypeLookup_getTypes_Result( + TypeLookup_getTypes_Result&& x) { m__d = x.m__d; - switch(m__d) + switch (m__d) { - case 0: - m_result = std::move(x.m_result); - break; - default: - break; + case 0: + m_result = std::move(x.m_result); + break; + default: + break; } } -TypeLookup_getTypes_Result& TypeLookup_getTypes_Result::operator=(const TypeLookup_getTypes_Result &x) +TypeLookup_getTypes_Result& TypeLookup_getTypes_Result::operator =( + const TypeLookup_getTypes_Result& x) { m__d = x.m__d; - switch(m__d) + switch (m__d) { - case 0: - m_result = x.m_result; - break; - default: - break; + case 0: + m_result = x.m_result; + break; + default: + break; } return *this; } -TypeLookup_getTypes_Result& TypeLookup_getTypes_Result::operator=(TypeLookup_getTypes_Result &&x) +TypeLookup_getTypes_Result& TypeLookup_getTypes_Result::operator =( + TypeLookup_getTypes_Result&& x) { m__d = x.m__d; - switch(m__d) + switch (m__d) { - case 0: - m_result = std::move(x.m_result); - break; - default: - break; + case 0: + m_result = std::move(x.m_result); + break; + default: + break; } return *this; } -void TypeLookup_getTypes_Result::_d(int32_t __d) +void TypeLookup_getTypes_Result::_d( + int32_t __d) { m__d = __d; } @@ -116,13 +121,15 @@ int32_t& TypeLookup_getTypes_Result::_d() return m__d; } -void TypeLookup_getTypes_Result::result(const TypeLookup_getTypes_Out &_result) +void TypeLookup_getTypes_Result::result( + const TypeLookup_getTypes_Out& _result) { m_result = _result; m__d = 0; } -void TypeLookup_getTypes_Result::result(TypeLookup_getTypes_Out &&_result) +void TypeLookup_getTypes_Result::result( + TypeLookup_getTypes_Out&& _result) { m_result = std::move(_result); m__d = 0; @@ -132,15 +139,15 @@ const TypeLookup_getTypes_Out& TypeLookup_getTypes_Result::result() const { bool b = false; - switch(m__d) + switch (m__d) { - case 0: - b = true; - break; - default: - break; + case 0: + b = true; + break; + default: + break; } - if(!b) + if (!b) { throw BadParamException("This member is not been selected"); } @@ -152,15 +159,15 @@ TypeLookup_getTypes_Out& TypeLookup_getTypes_Result::result() { bool b = false; - switch(m__d) + switch (m__d) { - case 0: - b = true; - break; - default: - break; + case 0: + b = true; + break; + default: + break; } - if(!b) + if (!b) { throw BadParamException("This member is not been selected"); } @@ -168,54 +175,60 @@ TypeLookup_getTypes_Out& TypeLookup_getTypes_Result::result() return m_result; } -size_t TypeLookup_getTypes_Result::getCdrSerializedSize(const TypeLookup_getTypes_Result& data, size_t current_alignment) +size_t TypeLookup_getTypes_Result::getCdrSerializedSize( + const TypeLookup_getTypes_Result& data, + size_t current_alignment) { (void)data; size_t initial_alignment = current_alignment; current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - switch(data.m__d) + switch (data.m__d) { - case 0: - current_alignment += TypeLookup_getTypes_Out::getCdrSerializedSize(data.result(), current_alignment); - break; - default: - break; + case 0: + current_alignment += TypeLookup_getTypes_Out::getCdrSerializedSize(data.result(), current_alignment); + break; + default: + break; } return current_alignment - initial_alignment; } -void TypeLookup_getTypes_Result::serialize(eprosima::fastcdr::Cdr &scdr) const +void TypeLookup_getTypes_Result::serialize( + eprosima::fastcdr::Cdr& scdr) const { scdr << m__d; - switch(m__d) + switch (m__d) { - case 0: - scdr << m_result; - break; - default: - break; + case 0: + scdr << m_result; + break; + default: + break; } } -void TypeLookup_getTypes_Result::deserialize(eprosima::fastcdr::Cdr &dcdr) +void TypeLookup_getTypes_Result::deserialize( + eprosima::fastcdr::Cdr& dcdr) { dcdr >> m__d; - switch(m__d) + switch (m__d) { - case 0: - dcdr >> m_result; - break; - default: - break; + case 0: + dcdr >> m_result; + break; + default: + break; } } -size_t TypeLookup_getTypes_In::getCdrSerializedSize(const TypeLookup_getTypes_In& data, size_t current_alignment) +size_t TypeLookup_getTypes_In::getCdrSerializedSize( + const TypeLookup_getTypes_In& data, + size_t current_alignment) { (void)data; size_t initial_alignment = current_alignment; @@ -224,24 +237,31 @@ size_t TypeLookup_getTypes_In::getCdrSerializedSize(const TypeLookup_getTypes_In current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for(size_t a = 0; a < data.type_ids.size(); ++a) + for (size_t a = 0; a < data.type_ids.size(); ++a) { - current_alignment += TypeIdentifier::getCdrSerializedSize(data.type_ids.at(a), current_alignment);} + current_alignment += TypeIdentifier::getCdrSerializedSize(data.type_ids.at(a), current_alignment); + } return current_alignment - initial_alignment; } -void TypeLookup_getTypes_In::serialize(eprosima::fastcdr::Cdr &scdr) const +void TypeLookup_getTypes_In::serialize( + eprosima::fastcdr::Cdr& scdr) const { - scdr << type_ids;} + scdr << type_ids; +} -void TypeLookup_getTypes_In::deserialize(eprosima::fastcdr::Cdr &dcdr) +void TypeLookup_getTypes_In::deserialize( + eprosima::fastcdr::Cdr& dcdr) { - dcdr >> type_ids;} + dcdr >> type_ids; +} -size_t TypeLookup_getTypes_Out::getCdrSerializedSize(const TypeLookup_getTypes_Out& data, size_t current_alignment) +size_t TypeLookup_getTypes_Out::getCdrSerializedSize( + const TypeLookup_getTypes_Out& data, + size_t current_alignment) { (void)data; size_t initial_alignment = current_alignment; @@ -250,36 +270,43 @@ size_t TypeLookup_getTypes_Out::getCdrSerializedSize(const TypeLookup_getTypes_O current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for(size_t a = 0; a < data.types.size(); ++a) + for (size_t a = 0; a < data.types.size(); ++a) { - current_alignment += TypeIdentifierTypeObjectPair::getCdrSerializedSize(data.types.at(a), current_alignment);} + current_alignment += TypeIdentifierTypeObjectPair::getCdrSerializedSize(data.types.at(a), current_alignment); + } current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for(size_t a = 0; a < data.complete_to_minimal.size(); ++a) + for (size_t a = 0; a < data.complete_to_minimal.size(); ++a) { - current_alignment += TypeIdentifierPair::getCdrSerializedSize(data.complete_to_minimal.at(a), current_alignment);} + current_alignment += + TypeIdentifierPair::getCdrSerializedSize(data.complete_to_minimal.at(a), current_alignment); + } return current_alignment - initial_alignment; } -void TypeLookup_getTypes_Out::serialize(eprosima::fastcdr::Cdr &scdr) const +void TypeLookup_getTypes_Out::serialize( + eprosima::fastcdr::Cdr& scdr) const { scdr << types; scdr << complete_to_minimal; } -void TypeLookup_getTypes_Out::deserialize(eprosima::fastcdr::Cdr &dcdr) +void TypeLookup_getTypes_Out::deserialize( + eprosima::fastcdr::Cdr& dcdr) { dcdr >> types; dcdr >> complete_to_minimal; } -size_t TypeLookup_getTypeDependencies_In::getCdrSerializedSize(const TypeLookup_getTypeDependencies_In& data, size_t current_alignment) +size_t TypeLookup_getTypeDependencies_In::getCdrSerializedSize( + const TypeLookup_getTypeDependencies_In& data, + size_t current_alignment) { (void)data; size_t initial_alignment = current_alignment; @@ -288,9 +315,10 @@ size_t TypeLookup_getTypeDependencies_In::getCdrSerializedSize(const TypeLookup_ current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for(size_t a = 0; a < data.type_ids.size(); ++a) + for (size_t a = 0; a < data.type_ids.size(); ++a) { - current_alignment += TypeIdentifier::getCdrSerializedSize(data.type_ids.at(a), current_alignment);} + current_alignment += TypeIdentifier::getCdrSerializedSize(data.type_ids.at(a), current_alignment); + } current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); @@ -302,21 +330,25 @@ size_t TypeLookup_getTypeDependencies_In::getCdrSerializedSize(const TypeLookup_ return current_alignment - initial_alignment; } -void TypeLookup_getTypeDependencies_In::serialize(eprosima::fastcdr::Cdr &scdr) const +void TypeLookup_getTypeDependencies_In::serialize( + eprosima::fastcdr::Cdr& scdr) const { scdr << type_ids; scdr << continuation_point; } -void TypeLookup_getTypeDependencies_In::deserialize(eprosima::fastcdr::Cdr &dcdr) +void TypeLookup_getTypeDependencies_In::deserialize( + eprosima::fastcdr::Cdr& dcdr) { dcdr >> type_ids; dcdr >> continuation_point; } -size_t TypeLookup_getTypeDependencies_Out::getCdrSerializedSize(const TypeLookup_getTypeDependencies_Out& data, size_t current_alignment) +size_t TypeLookup_getTypeDependencies_Out::getCdrSerializedSize( + const TypeLookup_getTypeDependencies_Out& data, + size_t current_alignment) { (void)data; size_t initial_alignment = current_alignment; @@ -325,9 +357,11 @@ size_t TypeLookup_getTypeDependencies_Out::getCdrSerializedSize(const TypeLookup current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for(size_t a = 0; a < data.dependent_typeids.size(); ++a) + for (size_t a = 0; a < data.dependent_typeids.size(); ++a) { - current_alignment += TypeIdentifierWithSize::getCdrSerializedSize(data.dependent_typeids.at(a), current_alignment);} + current_alignment += TypeIdentifierWithSize::getCdrSerializedSize(data.dependent_typeids.at( + a), current_alignment); + } current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); @@ -339,14 +373,16 @@ size_t TypeLookup_getTypeDependencies_Out::getCdrSerializedSize(const TypeLookup return current_alignment - initial_alignment; } -void TypeLookup_getTypeDependencies_Out::serialize(eprosima::fastcdr::Cdr &scdr) const +void TypeLookup_getTypeDependencies_Out::serialize( + eprosima::fastcdr::Cdr& scdr) const { scdr << dependent_typeids; scdr << continuation_point; } -void TypeLookup_getTypeDependencies_Out::deserialize(eprosima::fastcdr::Cdr &dcdr) +void TypeLookup_getTypeDependencies_Out::deserialize( + eprosima::fastcdr::Cdr& dcdr) { dcdr >> dependent_typeids; @@ -362,85 +398,90 @@ TypeLookup_getTypeDependencies_Result::~TypeLookup_getTypeDependencies_Result() { } -TypeLookup_getTypeDependencies_Result::TypeLookup_getTypeDependencies_Result(const TypeLookup_getTypeDependencies_Result &x) +TypeLookup_getTypeDependencies_Result::TypeLookup_getTypeDependencies_Result( + const TypeLookup_getTypeDependencies_Result& x) { m__d = x.m__d; - switch(m__d) + switch (m__d) { - case 0 /* TODO DDS_RETCODE_OK */: - m_result = x.m_result; - break; - default: - break; + case 0 /* TODO DDS_RETCODE_OK */: + m_result = x.m_result; + break; + default: + break; } } -TypeLookup_getTypeDependencies_Result::TypeLookup_getTypeDependencies_Result(TypeLookup_getTypeDependencies_Result &&x) +TypeLookup_getTypeDependencies_Result::TypeLookup_getTypeDependencies_Result( + TypeLookup_getTypeDependencies_Result&& x) { m__d = x.m__d; - switch(m__d) + switch (m__d) { - case 0 /* TODO DDS_RETCODE_OK */: - m_result = std::move(x.m_result); - break; - default: - break; + case 0 /* TODO DDS_RETCODE_OK */: + m_result = std::move(x.m_result); + break; + default: + break; } } -TypeLookup_getTypeDependencies_Result& TypeLookup_getTypeDependencies_Result::operator=(const TypeLookup_getTypeDependencies_Result &x) +TypeLookup_getTypeDependencies_Result& TypeLookup_getTypeDependencies_Result::operator =( + const TypeLookup_getTypeDependencies_Result& x) { m__d = x.m__d; - switch(m__d) + switch (m__d) { - case 0 /* TODO DDS_RETCODE_OK */: - m_result = x.m_result; - break; - default: - break; + case 0 /* TODO DDS_RETCODE_OK */: + m_result = x.m_result; + break; + default: + break; } return *this; } -TypeLookup_getTypeDependencies_Result& TypeLookup_getTypeDependencies_Result::operator=(TypeLookup_getTypeDependencies_Result &&x) +TypeLookup_getTypeDependencies_Result& TypeLookup_getTypeDependencies_Result::operator =( + TypeLookup_getTypeDependencies_Result&& x) { m__d = x.m__d; - switch(m__d) + switch (m__d) { - case 0 /* TODO DDS_RETCODE_OK */: - m_result = std::move(x.m_result); - break; - default: - break; + case 0 /* TODO DDS_RETCODE_OK */: + m_result = std::move(x.m_result); + break; + default: + break; } return *this; } -void TypeLookup_getTypeDependencies_Result::_d(int32_t __d) +void TypeLookup_getTypeDependencies_Result::_d( + int32_t __d) { bool b = false; - switch(m__d) + switch (m__d) { - case 0 /* TODO DDS_RETCODE_OK */: - switch(__d) - { case 0 /* TODO DDS_RETCODE_OK */: - b = true; + switch (__d) + { + case 0 /* TODO DDS_RETCODE_OK */: + b = true; + break; + default: + break; + } break; - default: - break; - } - break; } - if(!b) + if (!b) { throw BadParamException("Discriminator doesn't correspond with the selected union member"); } @@ -458,13 +499,15 @@ int32_t& TypeLookup_getTypeDependencies_Result::_d() return m__d; } -void TypeLookup_getTypeDependencies_Result::result(const TypeLookup_getTypeDependencies_Out &_result) +void TypeLookup_getTypeDependencies_Result::result( + const TypeLookup_getTypeDependencies_Out& _result) { m_result = _result; m__d = 0 /* TODO DDS_RETCODE_OK */; } -void TypeLookup_getTypeDependencies_Result::result(TypeLookup_getTypeDependencies_Out &&_result) +void TypeLookup_getTypeDependencies_Result::result( + TypeLookup_getTypeDependencies_Out&& _result) { m_result = std::move(_result); m__d = 0 /* TODO DDS_RETCODE_OK */; @@ -474,15 +517,15 @@ const TypeLookup_getTypeDependencies_Out& TypeLookup_getTypeDependencies_Result: { bool b = false; - switch(m__d) + switch (m__d) { - case 0 /* TODO DDS_RETCODE_OK */: - b = true; - break; - default: - break; + case 0 /* TODO DDS_RETCODE_OK */: + b = true; + break; + default: + break; } - if(!b) + if (!b) { throw BadParamException("This member is not been selected"); } @@ -494,15 +537,15 @@ TypeLookup_getTypeDependencies_Out& TypeLookup_getTypeDependencies_Result::resul { bool b = false; - switch(m__d) + switch (m__d) { - case 0 /* TODO DDS_RETCODE_OK */: - b = true; - break; - default: - break; + case 0 /* TODO DDS_RETCODE_OK */: + b = true; + break; + default: + break; } - if(!b) + if (!b) { throw BadParamException("This member is not been selected"); } @@ -511,54 +554,58 @@ TypeLookup_getTypeDependencies_Out& TypeLookup_getTypeDependencies_Result::resul } // TODO(Ricardo) Review -size_t TypeLookup_getTypeDependencies_Result::getCdrSerializedSize(const TypeLookup_getTypeDependencies_Result& data, size_t current_alignment) +size_t TypeLookup_getTypeDependencies_Result::getCdrSerializedSize( + const TypeLookup_getTypeDependencies_Result& data, + size_t current_alignment) { (void)data; size_t initial_alignment = current_alignment; current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - switch(data.m__d) + switch (data.m__d) { - case 0 /* TODO DDS_RETCODE_OK */: - current_alignment += TypeLookup_getTypeDependencies_Out::getCdrSerializedSize(data.result(), current_alignment); - break; - default: - break; + case 0 /* TODO DDS_RETCODE_OK */: + current_alignment += TypeLookup_getTypeDependencies_Out::getCdrSerializedSize( + data.result(), current_alignment); + break; + default: + break; } return current_alignment - initial_alignment; } -void TypeLookup_getTypeDependencies_Result::serialize(eprosima::fastcdr::Cdr &scdr) const +void TypeLookup_getTypeDependencies_Result::serialize( + eprosima::fastcdr::Cdr& scdr) const { scdr << m__d; - switch(m__d) + switch (m__d) { - case 0 /* TODO DDS_RETCODE_OK */: - scdr << m_result; - break; - default: - break; + case 0 /* TODO DDS_RETCODE_OK */: + scdr << m_result; + break; + default: + break; } } -void TypeLookup_getTypeDependencies_Result::deserialize(eprosima::fastcdr::Cdr &dcdr) +void TypeLookup_getTypeDependencies_Result::deserialize( + eprosima::fastcdr::Cdr& dcdr) { dcdr >> m__d; - switch(m__d) + switch (m__d) { - case 0 /* TODO DDS_RETCODE_OK */: - dcdr >> m_result; - break; - default: - break; + case 0 /* TODO DDS_RETCODE_OK */: + dcdr >> m_result; + break; + default: + break; } } - TypeLookup_Call::TypeLookup_Call() { m__d = TypeLookup_getTypes_Hash; @@ -572,107 +619,112 @@ TypeLookup_Call::~TypeLookup_Call() { } -TypeLookup_Call::TypeLookup_Call(const TypeLookup_Call &x) +TypeLookup_Call::TypeLookup_Call( + const TypeLookup_Call& x) { m__d = x.m__d; - switch(m__d) + switch (m__d) { - case TypeLookup_getTypes_Hash: - m_getTypes = x.m_getTypes; - break; - case TypeLookup_getDependencies_Hash: - m_getTypeDependencies = x.m_getTypeDependencies; - break; - default: - break; + case TypeLookup_getTypes_Hash: + m_getTypes = x.m_getTypes; + break; + case TypeLookup_getDependencies_Hash: + m_getTypeDependencies = x.m_getTypeDependencies; + break; + default: + break; } } -TypeLookup_Call::TypeLookup_Call(TypeLookup_Call &&x) +TypeLookup_Call::TypeLookup_Call( + TypeLookup_Call&& x) { m__d = x.m__d; - switch(m__d) + switch (m__d) { - case TypeLookup_getTypes_Hash: - m_getTypes = std::move(x.m_getTypes); - break; - case TypeLookup_getDependencies_Hash: - m_getTypeDependencies = std::move(x.m_getTypeDependencies); - break; - default: - break; + case TypeLookup_getTypes_Hash: + m_getTypes = std::move(x.m_getTypes); + break; + case TypeLookup_getDependencies_Hash: + m_getTypeDependencies = std::move(x.m_getTypeDependencies); + break; + default: + break; } } -TypeLookup_Call& TypeLookup_Call::operator=(const TypeLookup_Call &x) +TypeLookup_Call& TypeLookup_Call::operator =( + const TypeLookup_Call& x) { m__d = x.m__d; - switch(m__d) + switch (m__d) { - case TypeLookup_getTypes_Hash: - m_getTypes = x.m_getTypes; - break; - case TypeLookup_getDependencies_Hash: - m_getTypeDependencies = x.m_getTypeDependencies; - break; - default: - break; + case TypeLookup_getTypes_Hash: + m_getTypes = x.m_getTypes; + break; + case TypeLookup_getDependencies_Hash: + m_getTypeDependencies = x.m_getTypeDependencies; + break; + default: + break; } return *this; } -TypeLookup_Call& TypeLookup_Call::operator=(TypeLookup_Call &&x) +TypeLookup_Call& TypeLookup_Call::operator =( + TypeLookup_Call&& x) { m__d = x.m__d; - switch(m__d) + switch (m__d) { - case TypeLookup_getTypes_Hash: - m_getTypes = std::move(x.m_getTypes); - break; - case TypeLookup_getDependencies_Hash: - m_getTypeDependencies = std::move(x.m_getTypeDependencies); - break; - default: - break; + case TypeLookup_getTypes_Hash: + m_getTypes = std::move(x.m_getTypes); + break; + case TypeLookup_getDependencies_Hash: + m_getTypeDependencies = std::move(x.m_getTypeDependencies); + break; + default: + break; } return *this; } -void TypeLookup_Call::_d(int32_t __d) +void TypeLookup_Call::_d( + int32_t __d) { bool b = false; - switch(m__d) + switch (m__d) { - case TypeLookup_getTypes_Hash: - switch(__d) - { case TypeLookup_getTypes_Hash: - b = true; - break; - default: + switch (__d) + { + case TypeLookup_getTypes_Hash: + b = true; + break; + default: + break; + } break; - } - break; - case TypeLookup_getDependencies_Hash: - switch(__d) - { case TypeLookup_getDependencies_Hash: - b = true; + switch (__d) + { + case TypeLookup_getDependencies_Hash: + b = true; + break; + default: + break; + } break; - default: - break; - } - break; } - if(!b) + if (!b) { throw BadParamException("Discriminator doesn't correspond with the selected union member"); } @@ -690,13 +742,15 @@ int32_t& TypeLookup_Call::_d() return m__d; } -void TypeLookup_Call::getTypes(const TypeLookup_getTypes_In &_getTypes) +void TypeLookup_Call::getTypes( + const TypeLookup_getTypes_In& _getTypes) { m_getTypes = _getTypes; m__d = TypeLookup_getTypes_Hash; } -void TypeLookup_Call::getTypes(TypeLookup_getTypes_In &&_getTypes) +void TypeLookup_Call::getTypes( + TypeLookup_getTypes_In&& _getTypes) { m_getTypes = std::move(_getTypes); m__d = TypeLookup_getTypes_Hash; @@ -706,15 +760,15 @@ const TypeLookup_getTypes_In& TypeLookup_Call::getTypes() const { bool b = false; - switch(m__d) + switch (m__d) { - case TypeLookup_getTypes_Hash: - b = true; - break; - default: - break; + case TypeLookup_getTypes_Hash: + b = true; + break; + default: + break; } - if(!b) + if (!b) { throw BadParamException("This member is not been selected"); } @@ -726,28 +780,31 @@ TypeLookup_getTypes_In& TypeLookup_Call::getTypes() { bool b = false; - switch(m__d) + switch (m__d) { - case TypeLookup_getTypes_Hash: - b = true; - break; - default: - break; + case TypeLookup_getTypes_Hash: + b = true; + break; + default: + break; } - if(!b) + if (!b) { throw BadParamException("This member is not been selected"); } return m_getTypes; } -void TypeLookup_Call::getTypeDependencies(const TypeLookup_getTypeDependencies_In &_getTypeDependencies) + +void TypeLookup_Call::getTypeDependencies( + const TypeLookup_getTypeDependencies_In& _getTypeDependencies) { m_getTypeDependencies = _getTypeDependencies; m__d = TypeLookup_getDependencies_Hash; } -void TypeLookup_Call::getTypeDependencies(TypeLookup_getTypeDependencies_In &&_getTypeDependencies) +void TypeLookup_Call::getTypeDependencies( + TypeLookup_getTypeDependencies_In&& _getTypeDependencies) { m_getTypeDependencies = std::move(_getTypeDependencies); m__d = TypeLookup_getDependencies_Hash; @@ -757,15 +814,15 @@ const TypeLookup_getTypeDependencies_In& TypeLookup_Call::getTypeDependencies() { bool b = false; - switch(m__d) + switch (m__d) { - case TypeLookup_getDependencies_Hash: - b = true; - break; - default: - break; + case TypeLookup_getDependencies_Hash: + b = true; + break; + default: + break; } - if(!b) + if (!b) { throw BadParamException("This member is not been selected"); } @@ -777,15 +834,15 @@ TypeLookup_getTypeDependencies_In& TypeLookup_Call::getTypeDependencies() { bool b = false; - switch(m__d) + switch (m__d) { - case TypeLookup_getDependencies_Hash: - b = true; - break; - default: - break; + case TypeLookup_getDependencies_Hash: + b = true; + break; + default: + break; } - if(!b) + if (!b) { throw BadParamException("This member is not been selected"); } @@ -794,63 +851,70 @@ TypeLookup_getTypeDependencies_In& TypeLookup_Call::getTypeDependencies() } // TODO(Ricardo) Review -size_t TypeLookup_Call::getCdrSerializedSize(const TypeLookup_Call& data, size_t current_alignment) +size_t TypeLookup_Call::getCdrSerializedSize( + const TypeLookup_Call& data, + size_t current_alignment) { (void)data; size_t initial_alignment = current_alignment; current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - switch(data.m__d) + switch (data.m__d) { - case TypeLookup_getTypes_Hash: - current_alignment += TypeLookup_getTypes_In::getCdrSerializedSize(data.getTypes(), current_alignment); - break; - case TypeLookup_getDependencies_Hash: - current_alignment += TypeLookup_getTypeDependencies_In::getCdrSerializedSize(data.getTypeDependencies(), current_alignment); - break; - default: - break; + case TypeLookup_getTypes_Hash: + current_alignment += TypeLookup_getTypes_In::getCdrSerializedSize(data.getTypes(), current_alignment); + break; + case TypeLookup_getDependencies_Hash: + current_alignment += TypeLookup_getTypeDependencies_In::getCdrSerializedSize( + data.getTypeDependencies(), current_alignment); + break; + default: + break; } return current_alignment - initial_alignment; } -void TypeLookup_Call::serialize(eprosima::fastcdr::Cdr &scdr) const +void TypeLookup_Call::serialize( + eprosima::fastcdr::Cdr& scdr) const { scdr << m__d; - switch(m__d) + switch (m__d) { - case TypeLookup_getTypes_Hash: - scdr << m_getTypes; - break; - case TypeLookup_getDependencies_Hash: - scdr << m_getTypeDependencies; - break; - default: - break; + case TypeLookup_getTypes_Hash: + scdr << m_getTypes; + break; + case TypeLookup_getDependencies_Hash: + scdr << m_getTypeDependencies; + break; + default: + break; } } -void TypeLookup_Call::deserialize(eprosima::fastcdr::Cdr &dcdr) +void TypeLookup_Call::deserialize( + eprosima::fastcdr::Cdr& dcdr) { dcdr >> m__d; - switch(m__d) + switch (m__d) { - case TypeLookup_getTypes_Hash: - dcdr >> m_getTypes; - break; - case TypeLookup_getDependencies_Hash: - dcdr >> m_getTypeDependencies; - break; - default: - break; + case TypeLookup_getTypes_Hash: + dcdr >> m_getTypes; + break; + case TypeLookup_getDependencies_Hash: + dcdr >> m_getTypeDependencies; + break; + default: + break; } } -size_t TypeLookup_Request::getCdrSerializedSize(const TypeLookup_Request& data, size_t current_alignment) +size_t TypeLookup_Request::getCdrSerializedSize( + const TypeLookup_Request& data, + size_t current_alignment) { (void)data; size_t initial_alignment = current_alignment; @@ -862,14 +926,16 @@ size_t TypeLookup_Request::getCdrSerializedSize(const TypeLookup_Request& data, return current_alignment - initial_alignment; } -void TypeLookup_Request::serialize(eprosima::fastcdr::Cdr &scdr) const +void TypeLookup_Request::serialize( + eprosima::fastcdr::Cdr& scdr) const { scdr << header; scdr << data; } -void TypeLookup_Request::deserialize(eprosima::fastcdr::Cdr &dcdr) +void TypeLookup_Request::deserialize( + eprosima::fastcdr::Cdr& dcdr) { dcdr >> header; @@ -889,107 +955,112 @@ TypeLookup_Return::~TypeLookup_Return() { } -TypeLookup_Return::TypeLookup_Return(const TypeLookup_Return &x) +TypeLookup_Return::TypeLookup_Return( + const TypeLookup_Return& x) { m__d = x.m__d; - switch(m__d) + switch (m__d) { - case TypeLookup_getTypes_Hash: - m_getType = x.m_getType; - break; - case TypeLookup_getDependencies_Hash: - m_getTypeDependencies = x.m_getTypeDependencies; - break; - default: - break; + case TypeLookup_getTypes_Hash: + m_getType = x.m_getType; + break; + case TypeLookup_getDependencies_Hash: + m_getTypeDependencies = x.m_getTypeDependencies; + break; + default: + break; } } -TypeLookup_Return::TypeLookup_Return(TypeLookup_Return &&x) +TypeLookup_Return::TypeLookup_Return( + TypeLookup_Return&& x) { m__d = x.m__d; - switch(m__d) + switch (m__d) { - case TypeLookup_getTypes_Hash: - m_getType = std::move(x.m_getType); - break; - case TypeLookup_getDependencies_Hash: - m_getTypeDependencies = std::move(x.m_getTypeDependencies); - break; - default: - break; + case TypeLookup_getTypes_Hash: + m_getType = std::move(x.m_getType); + break; + case TypeLookup_getDependencies_Hash: + m_getTypeDependencies = std::move(x.m_getTypeDependencies); + break; + default: + break; } } -TypeLookup_Return& TypeLookup_Return::operator=(const TypeLookup_Return &x) +TypeLookup_Return& TypeLookup_Return::operator =( + const TypeLookup_Return& x) { m__d = x.m__d; - switch(m__d) + switch (m__d) { - case TypeLookup_getTypes_Hash: - m_getType = x.m_getType; - break; - case TypeLookup_getDependencies_Hash: - m_getTypeDependencies = x.m_getTypeDependencies; - break; - default: - break; + case TypeLookup_getTypes_Hash: + m_getType = x.m_getType; + break; + case TypeLookup_getDependencies_Hash: + m_getTypeDependencies = x.m_getTypeDependencies; + break; + default: + break; } return *this; } -TypeLookup_Return& TypeLookup_Return::operator=(TypeLookup_Return &&x) +TypeLookup_Return& TypeLookup_Return::operator =( + TypeLookup_Return&& x) { m__d = x.m__d; - switch(m__d) + switch (m__d) { - case TypeLookup_getTypes_Hash: - m_getType = std::move(x.m_getType); - break; - case TypeLookup_getDependencies_Hash: - m_getTypeDependencies = std::move(x.m_getTypeDependencies); - break; - default: - break; + case TypeLookup_getTypes_Hash: + m_getType = std::move(x.m_getType); + break; + case TypeLookup_getDependencies_Hash: + m_getTypeDependencies = std::move(x.m_getTypeDependencies); + break; + default: + break; } return *this; } -void TypeLookup_Return::_d(int32_t __d) +void TypeLookup_Return::_d( + int32_t __d) { bool b = false; - switch(m__d) + switch (m__d) { - case TypeLookup_getTypes_Hash: - switch(__d) - { case TypeLookup_getTypes_Hash: - b = true; - break; - default: + switch (__d) + { + case TypeLookup_getTypes_Hash: + b = true; + break; + default: + break; + } break; - } - break; - case TypeLookup_getDependencies_Hash: - switch(__d) - { case TypeLookup_getDependencies_Hash: - b = true; - break; - default: + switch (__d) + { + case TypeLookup_getDependencies_Hash: + b = true; + break; + default: + break; + } break; - } - break; } - if(!b) + if (!b) { throw BadParamException("Discriminator doesn't correspond with the selected union member"); } @@ -1007,13 +1078,15 @@ int32_t& TypeLookup_Return::_d() return m__d; } -void TypeLookup_Return::getType(const TypeLookup_getTypes_Result &_getType) +void TypeLookup_Return::getType( + const TypeLookup_getTypes_Result& _getType) { m_getType = _getType; m__d = TypeLookup_getTypes_Hash; } -void TypeLookup_Return::getType(TypeLookup_getTypes_Result &&_getType) +void TypeLookup_Return::getType( + TypeLookup_getTypes_Result&& _getType) { m_getType = std::move(_getType); m__d = TypeLookup_getTypes_Hash; @@ -1023,15 +1096,15 @@ const TypeLookup_getTypes_Result& TypeLookup_Return::getType() const { bool b = false; - switch(m__d) + switch (m__d) { - case TypeLookup_getTypes_Hash: - b = true; - break; - default: - break; + case TypeLookup_getTypes_Hash: + b = true; + break; + default: + break; } - if(!b) + if (!b) { throw BadParamException("This member is not been selected"); } @@ -1043,28 +1116,31 @@ TypeLookup_getTypes_Result& TypeLookup_Return::getType() { bool b = false; - switch(m__d) + switch (m__d) { - case TypeLookup_getTypes_Hash: - b = true; - break; - default: - break; + case TypeLookup_getTypes_Hash: + b = true; + break; + default: + break; } - if(!b) + if (!b) { throw BadParamException("This member is not been selected"); } return m_getType; } -void TypeLookup_Return::getTypeDependencies(const TypeLookup_getTypeDependencies_Result &_getTypeDependencies) + +void TypeLookup_Return::getTypeDependencies( + const TypeLookup_getTypeDependencies_Result& _getTypeDependencies) { m_getTypeDependencies = _getTypeDependencies; m__d = TypeLookup_getDependencies_Hash; } -void TypeLookup_Return::getTypeDependencies(TypeLookup_getTypeDependencies_Result &&_getTypeDependencies) +void TypeLookup_Return::getTypeDependencies( + TypeLookup_getTypeDependencies_Result&& _getTypeDependencies) { m_getTypeDependencies = std::move(_getTypeDependencies); m__d = TypeLookup_getDependencies_Hash; @@ -1074,15 +1150,15 @@ const TypeLookup_getTypeDependencies_Result& TypeLookup_Return::getTypeDependenc { bool b = false; - switch(m__d) + switch (m__d) { - case TypeLookup_getDependencies_Hash: - b = true; - break; - default: - break; + case TypeLookup_getDependencies_Hash: + b = true; + break; + default: + break; } - if(!b) + if (!b) { throw BadParamException("This member is not been selected"); } @@ -1094,15 +1170,15 @@ TypeLookup_getTypeDependencies_Result& TypeLookup_Return::getTypeDependencies() { bool b = false; - switch(m__d) + switch (m__d) { - case TypeLookup_getDependencies_Hash: - b = true; - break; - default: - break; + case TypeLookup_getDependencies_Hash: + b = true; + break; + default: + break; } - if(!b) + if (!b) { throw BadParamException("This member is not been selected"); } @@ -1111,63 +1187,70 @@ TypeLookup_getTypeDependencies_Result& TypeLookup_Return::getTypeDependencies() } // TODO(Ricardo) Review -size_t TypeLookup_Return::getCdrSerializedSize(const TypeLookup_Return& data, size_t current_alignment) +size_t TypeLookup_Return::getCdrSerializedSize( + const TypeLookup_Return& data, + size_t current_alignment) { (void)data; size_t initial_alignment = current_alignment; current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - switch(data.m__d) + switch (data.m__d) { - case TypeLookup_getTypes_Hash: - current_alignment += TypeLookup_getTypes_Result::getCdrSerializedSize(data.getType(), current_alignment); - break; - case TypeLookup_getDependencies_Hash: - current_alignment += TypeLookup_getTypeDependencies_Result::getCdrSerializedSize(data.getTypeDependencies(), current_alignment); - break; - default: - break; + case TypeLookup_getTypes_Hash: + current_alignment += TypeLookup_getTypes_Result::getCdrSerializedSize(data.getType(), current_alignment); + break; + case TypeLookup_getDependencies_Hash: + current_alignment += TypeLookup_getTypeDependencies_Result::getCdrSerializedSize( + data.getTypeDependencies(), current_alignment); + break; + default: + break; } return current_alignment - initial_alignment; } -void TypeLookup_Return::serialize(eprosima::fastcdr::Cdr &scdr) const +void TypeLookup_Return::serialize( + eprosima::fastcdr::Cdr& scdr) const { scdr << m__d; - switch(m__d) + switch (m__d) { - case TypeLookup_getTypes_Hash: - scdr << m_getType; - break; - case TypeLookup_getDependencies_Hash: - scdr << m_getTypeDependencies; - break; - default: - break; + case TypeLookup_getTypes_Hash: + scdr << m_getType; + break; + case TypeLookup_getDependencies_Hash: + scdr << m_getTypeDependencies; + break; + default: + break; } } -void TypeLookup_Return::deserialize(eprosima::fastcdr::Cdr &dcdr) +void TypeLookup_Return::deserialize( + eprosima::fastcdr::Cdr& dcdr) { dcdr >> m__d; - switch(m__d) + switch (m__d) { - case TypeLookup_getTypes_Hash: - dcdr >> m_getType; - break; - case TypeLookup_getDependencies_Hash: - dcdr >> m_getTypeDependencies; - break; - default: - break; + case TypeLookup_getTypes_Hash: + dcdr >> m_getType; + break; + case TypeLookup_getDependencies_Hash: + dcdr >> m_getTypeDependencies; + break; + default: + break; } } -size_t TypeLookup_Reply::getCdrSerializedSize(const TypeLookup_Reply& data, size_t current_alignment) +size_t TypeLookup_Reply::getCdrSerializedSize( + const TypeLookup_Reply& data, + size_t current_alignment) { (void)data; size_t initial_alignment = current_alignment; @@ -1179,14 +1262,16 @@ size_t TypeLookup_Reply::getCdrSerializedSize(const TypeLookup_Reply& data, size return current_alignment - initial_alignment; } -void TypeLookup_Reply::serialize(eprosima::fastcdr::Cdr &scdr) const +void TypeLookup_Reply::serialize( + eprosima::fastcdr::Cdr& scdr) const { scdr << header; scdr << return_value; } -void TypeLookup_Reply::deserialize(eprosima::fastcdr::Cdr &dcdr) +void TypeLookup_Reply::deserialize( + eprosima::fastcdr::Cdr& dcdr) { dcdr >> header; @@ -1204,19 +1289,20 @@ bool TypeLookup_RequestTypeSupport::serialize( eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); try { - type->serialize(ser); // Serialize the object: + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object + type->serialize(ser); } - catch(eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } - payload->length = static_cast(ser.getSerializedDataLength()); //Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); //Get the serialized length return true; } @@ -1224,20 +1310,21 @@ bool TypeLookup_RequestTypeSupport::deserialize( fastrtps::rtps::SerializedPayload_t* payload, void* data) { - TypeLookup_Request* p_type = static_cast(data); //Convert DATA to pointer of your type - //eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that manages the raw buffer. + TypeLookup_Request* p_type = static_cast(data); //Convert DATA to pointer of your type + //eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer((char*)payload->data, payload->max_size); eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); // Object that deserializes the data. - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; try { - p_type->deserialize(deser); //Deserialize the object: + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Deserialize the object + p_type->deserialize(deser); } - catch(eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } @@ -1264,35 +1351,35 @@ void TypeLookup_RequestTypeSupport::delete_data( } /* -TypeLookup_ReplyPubSubType::TypeLookup_ReplyPubSubType() -{ + TypeLookup_ReplyPubSubType::TypeLookup_ReplyPubSubType() + { -} + } -TypeLookup_ReplyPubSubType::~TypeLookup_ReplyPubSubType() -{ + TypeLookup_ReplyPubSubType::~TypeLookup_ReplyPubSubType() + { -} + } -bool TypeLookup_ReplyPubSubType::serialize( + bool TypeLookup_ReplyPubSubType::serialize( void* data, fastrtps::rtps::SerializedPayload_t* payload) -{ + { -} + } -bool TypeLookup_ReplyPubSubType::deserialize( + bool TypeLookup_ReplyPubSubType::deserialize( fastrtps::rtps::SerializedPayload_t *payload, void *data) -{ + { -} + } -TypeLookup_ReplyTypeSupport::TypeLookup_ReplyTypeSupport() + TypeLookup_ReplyTypeSupport::TypeLookup_ReplyTypeSupport() : TypeSupport(new TypeLookup_Reply()) -{ -} -*/ + { + } + */ bool TypeLookup_ReplyTypeSupport::serialize( void* data, fastrtps::rtps::SerializedPayload_t* payload) @@ -1302,19 +1389,20 @@ bool TypeLookup_ReplyTypeSupport::serialize( eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); try { - type->serialize(ser); // Serialize the object: + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object + type->serialize(ser); } - catch(eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } - payload->length = static_cast(ser.getSerializedDataLength()); //Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); //Get the serialized length return true; } @@ -1322,19 +1410,20 @@ bool TypeLookup_ReplyTypeSupport::deserialize( fastrtps::rtps::SerializedPayload_t* payload, void* data) { - TypeLookup_Reply* p_type = static_cast(data); //Convert DATA to pointer of your type - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that manages the raw buffer. + TypeLookup_Reply* p_type = static_cast(data); //Convert DATA to pointer of your type + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that manages the raw buffer. eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); // Object that deserializes the data. - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; try { - p_type->deserialize(deser); //Deserialize the object: + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Deserialize the object + p_type->deserialize(deser); } - catch(eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } diff --git a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.cpp b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.cpp index cf0b3b79813..ec13fc0f04c 100644 --- a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.cpp +++ b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.cpp @@ -27,8 +27,10 @@ #include #include #include + #include #include +#include #include "DDSFilterCondition.hpp" @@ -59,7 +61,7 @@ bool DDSFilterExpression::evaluate( deser.read_encapsulation(); dyn_data_->deserialize(deser); } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } diff --git a/src/cpp/rtps/transport/tcp/TCPControlMessage.cpp b/src/cpp/rtps/transport/tcp/TCPControlMessage.cpp index b362367f640..e355eef9237 100644 --- a/src/cpp/rtps/transport/tcp/TCPControlMessage.cpp +++ b/src/cpp/rtps/transport/tcp/TCPControlMessage.cpp @@ -157,14 +157,14 @@ bool ConnectionRequest_t::serialize( eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); // Object that serializes the data. payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); try { + // Serialize encapsulation + ser.serialize_encapsulation(); p_type->serialize(ser); // Serialize the object: } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } @@ -180,15 +180,15 @@ bool ConnectionRequest_t::deserialize( eprosima::fastcdr::FastBuffer fastbuffer((char*) payload->data, payload->length + 4); // Object that manages the raw buffer. eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); // Object that deserializes the data. - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; try { + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; p_type->deserialize(deser); //Deserialize the object: } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } @@ -244,14 +244,14 @@ bool OpenLogicalPortRequest_t::serialize( eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); // Object that serializes the data. payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); try { + // Serialize encapsulation + ser.serialize_encapsulation(); p_type->serialize(ser); // Serialize the object: } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } @@ -267,15 +267,15 @@ bool OpenLogicalPortRequest_t::deserialize( eprosima::fastcdr::FastBuffer fastbuffer((char*) payload->data, payload->length + 4); // Object that manages the raw buffer. eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); // Object that deserializes the data. - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; try { + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; p_type->deserialize(deser); //Deserialize the object: } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } @@ -332,14 +332,14 @@ bool CheckLogicalPortsRequest_t::serialize( eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); // Object that serializes the data. payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); try { + // Serialize encapsulation + ser.serialize_encapsulation(); p_type->serialize(ser); // Serialize the object: } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } @@ -355,15 +355,15 @@ bool CheckLogicalPortsRequest_t::deserialize( eprosima::fastcdr::FastBuffer fastbuffer((char*) payload->data, payload->length + 4); // Object that manages the raw buffer. eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); // Object that deserializes the data. - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; try { + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; p_type->deserialize(deser); //Deserialize the object: } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } @@ -419,14 +419,14 @@ bool KeepAliveRequest_t::serialize( eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); // Object that serializes the data. payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); try { + // Serialize encapsulation + ser.serialize_encapsulation(); p_type->serialize(ser); // Serialize the object: } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } @@ -442,15 +442,15 @@ bool KeepAliveRequest_t::deserialize( eprosima::fastcdr::FastBuffer fastbuffer((char*) payload->data, payload->length + 4); // Object that manages the raw buffer. eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); // Object that deserializes the data. - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; try { + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; p_type->deserialize(deser); //Deserialize the object: } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } @@ -506,14 +506,14 @@ bool LogicalPortIsClosedRequest_t::serialize( eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); // Object that serializes the data. payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); try { + // Serialize encapsulation + ser.serialize_encapsulation(); p_type->serialize(ser); // Serialize the object: } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } @@ -529,15 +529,15 @@ bool LogicalPortIsClosedRequest_t::deserialize( eprosima::fastcdr::FastBuffer fastbuffer((char*) payload->data, payload->length + 4); // Object that manages the raw buffer. eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); // Object that deserializes the data. - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; try { + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; p_type->deserialize(deser); //Deserialize the object: } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } @@ -593,14 +593,14 @@ bool BindConnectionResponse_t::serialize( eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); // Object that serializes the data. payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); try { + // Serialize encapsulation + ser.serialize_encapsulation(); p_type->serialize(ser); // Serialize the object: } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } @@ -616,15 +616,15 @@ bool BindConnectionResponse_t::deserialize( eprosima::fastcdr::FastBuffer fastbuffer((char*) payload->data, payload->length + 4); // Object that manages the raw buffer. eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); // Object that deserializes the data. - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; try { + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; p_type->deserialize(deser); //Deserialize the object: } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } @@ -681,14 +681,14 @@ bool CheckLogicalPortsResponse_t::serialize( eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); // Object that serializes the data. payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); try { + // Serialize encapsulation + ser.serialize_encapsulation(); p_type->serialize(ser); // Serialize the object: } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } @@ -704,15 +704,15 @@ bool CheckLogicalPortsResponse_t::deserialize( eprosima::fastcdr::FastBuffer fastbuffer((char*) payload->data, payload->length + 4); // Object that manages the raw buffer. eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); // Object that deserializes the data. - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; try { + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; p_type->deserialize(deser); //Deserialize the object: } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } diff --git a/src/cpp/security/cryptography/AESGCMGMAC_Transform.cpp b/src/cpp/security/cryptography/AESGCMGMAC_Transform.cpp index c883689ea7a..9e3928aab9d 100644 --- a/src/cpp/security/cryptography/AESGCMGMAC_Transform.cpp +++ b/src/cpp/security/cryptography/AESGCMGMAC_Transform.cpp @@ -128,9 +128,9 @@ bool AESGCMGMAC_Transform::encode_serialized_payload( serialize_SecureDataHeader(serializer, keyMat.transformation_kind, keyMat.sender_key_id, session_id, initialization_vector_suffix); } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException&) + catch (eprosima::fastcdr::exception::Exception&) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to serialize SecureDataHeader"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to serialize SecureDataHeader"); return false; } @@ -145,9 +145,9 @@ bool AESGCMGMAC_Transform::encode_serialized_payload( return false; } } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException&) + catch (eprosima::fastcdr::exception::Exception&) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to serialize SecureDataBody"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to serialize SecureDataBody"); return false; } @@ -160,9 +160,9 @@ bool AESGCMGMAC_Transform::encode_serialized_payload( return false; } } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException&) + catch (eprosima::fastcdr::exception::Exception&) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to serialize SecureDataTag"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to serialize SecureDataTag"); return false; } @@ -257,7 +257,7 @@ bool AESGCMGMAC_Transform::encode_datawriter_submessage( } catch (eprosima::fastcdr::exception::NotEnoughMemoryException& ) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to serialize SecureDataHeader"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to serialize SecureDataHeader"); return false; } @@ -273,9 +273,9 @@ bool AESGCMGMAC_Transform::encode_datawriter_submessage( return false; } } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException&) + catch (eprosima::fastcdr::exception::Exception&) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to serialize SecureDataBody"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to serialize SecureDataBody"); return false; } @@ -302,9 +302,9 @@ bool AESGCMGMAC_Transform::encode_datawriter_submessage( serializer << length; serializer.setState(current_state); } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException&) + catch (eprosima::fastcdr::exception::Exception&) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to serialize SecureDataTag"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to serialize SecureDataTag"); return false; } @@ -395,9 +395,9 @@ bool AESGCMGMAC_Transform::encode_datareader_submessage( serializer << length; serializer.setState(current_state); } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException&) + catch (eprosima::fastcdr::exception::Exception&) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to serialize SecureDataHeader"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to serialize SecureDataHeader"); return false; } @@ -414,9 +414,9 @@ bool AESGCMGMAC_Transform::encode_datareader_submessage( return false; } } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException&) + catch (eprosima::fastcdr::exception::Exception&) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to serialize SecureDataBody"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to serialize SecureDataBody"); return false; } @@ -444,9 +444,9 @@ bool AESGCMGMAC_Transform::encode_datareader_submessage( serializer << length; serializer.setState(current_state); } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException&) + catch (eprosima::fastcdr::exception::Exception&) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to serialize SecureDataTag"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to serialize SecureDataTag"); return false; } @@ -536,9 +536,9 @@ bool AESGCMGMAC_Transform::encode_rtps_message( serializer << length; serializer.setState(current_state); } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException&) + catch (eprosima::fastcdr::exception::Exception&) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to serialize SecureDataHeader"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to serialize SecureDataHeader"); return false; } @@ -555,9 +555,9 @@ bool AESGCMGMAC_Transform::encode_rtps_message( return false; } } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException&) + catch (eprosima::fastcdr::exception::Exception&) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to serialize SecureDataBody"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to serialize SecureDataBody"); return false; } @@ -584,9 +584,9 @@ bool AESGCMGMAC_Transform::encode_rtps_message( serializer << length; serializer.setState(current_state); } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException&) + catch (eprosima::fastcdr::exception::Exception&) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to serialize SecureDataTag"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to serialize SecureDataTag"); return false; } @@ -672,9 +672,9 @@ bool AESGCMGMAC_Transform::decode_rtps_message( return false; } } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException&) + catch (eprosima::fastcdr::exception::Exception&) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to deserialize SecureDataHeader"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to deserialize SecureDataHeader"); return false; } @@ -701,9 +701,9 @@ bool AESGCMGMAC_Transform::decode_rtps_message( { is_encrypted = predeserialize_SecureDataBody(decoder, body_length, body_align); } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException&) + catch (eprosima::fastcdr::exception::Exception&) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to deserialize SecureDataBody header"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to deserialize SecureDataBody header"); return false; } @@ -784,9 +784,9 @@ bool AESGCMGMAC_Transform::decode_rtps_message( return false; } } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException&) + catch (eprosima::fastcdr::exception::Exception&) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to deserialize SecureDataTag length"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to deserialize SecureDataTag length"); return false; } @@ -873,9 +873,9 @@ bool AESGCMGMAC_Transform::preprocess_secure_submsg( return false; } } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException&) + catch (eprosima::fastcdr::exception::Exception&) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to deserialize SecureDataHeader"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to deserialize SecureDataHeader"); return false; } @@ -1033,9 +1033,9 @@ bool AESGCMGMAC_Transform::decode_datawriter_submessage( return false; } } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException&) + catch (eprosima::fastcdr::exception::Exception&) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to deserialize SecureDataHeader"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to deserialize SecureDataHeader"); return false; } @@ -1066,9 +1066,9 @@ bool AESGCMGMAC_Transform::decode_datawriter_submessage( { is_encrypted = predeserialize_SecureDataBody(decoder, body_length, body_align); } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException&) + catch (eprosima::fastcdr::exception::Exception&) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to deserialize SecureDataBody header"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to deserialize SecureDataBody header"); return false; } @@ -1120,9 +1120,9 @@ bool AESGCMGMAC_Transform::decode_datawriter_submessage( return false; } } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException&) + catch (eprosima::fastcdr::exception::Exception&) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to deserialize SecureDataTag length"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to deserialize SecureDataTag length"); return false; } @@ -1213,9 +1213,9 @@ bool AESGCMGMAC_Transform::decode_datareader_submessage( return false; } } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException&) + catch (eprosima::fastcdr::exception::Exception&) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to deserialize SecureDataHeader"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to deserialize SecureDataHeader"); return false; } @@ -1246,9 +1246,9 @@ bool AESGCMGMAC_Transform::decode_datareader_submessage( { is_encrypted = predeserialize_SecureDataBody(decoder, body_length, body_align); } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException&) + catch (eprosima::fastcdr::exception::Exception&) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to deserialize SecureDataBody header"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to deserialize SecureDataBody header"); return false; } @@ -1300,9 +1300,9 @@ bool AESGCMGMAC_Transform::decode_datareader_submessage( return false; } } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException&) + catch (eprosima::fastcdr::exception::Exception&) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to deserialize SecureDataTag length"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to deserialize SecureDataTag length"); return false; } @@ -1368,9 +1368,9 @@ bool AESGCMGMAC_Transform::decode_serialized_payload( { header = deserialize_SecureDataHeader(decoder); } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException&) + catch (eprosima::fastcdr::exception::Exception&) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to deserialize SecureDataHeader"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to deserialize SecureDataHeader"); return false; } @@ -1415,9 +1415,9 @@ bool AESGCMGMAC_Transform::decode_serialized_payload( body_length -= sizeof(uint32_t) + 16; } } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException&) + catch (eprosima::fastcdr::exception::Exception&) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to deserialize SecureDataBody header"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to deserialize SecureDataBody header"); return false; } @@ -1428,9 +1428,9 @@ bool AESGCMGMAC_Transform::decode_serialized_payload( { deserialize_SecureDataTag(decoder, tag, {}, {}, {}, {}, {}, 0, exception); } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException&) + catch (eprosima::fastcdr::exception::Exception&) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to deserialize SecureDataTag length"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to deserialize SecureDataTag length"); return false; } @@ -1577,7 +1577,7 @@ bool AESGCMGMAC_Transform::serialize_SecureDataBody( if ((output_buffer.getBufferSize() - (serializer.getCurrentPosition() - serializer.getBufferPointer())) < plain_buffer_len) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to copy payload"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to copy payload"); EVP_CIPHER_CTX_free(e_ctx); return false; } @@ -1639,7 +1639,7 @@ bool AESGCMGMAC_Transform::serialize_SecureDataBody( if ((output_buffer.getBufferSize() - (serializer.getCurrentPosition() - serializer.getBufferPointer())) < (plain_buffer_len + (2 * cipher_block_size) - 1)) { - EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Not enough memory to cipher payload"); + EPROSIMA_LOG_ERROR(SECURITY_CRYPTO, "Error in fastcdr trying to cipher payload"); EVP_CIPHER_CTX_free(e_ctx); return false; } @@ -2004,7 +2004,7 @@ bool AESGCMGMAC_Transform::deserialize_SecureDataBody( // - EVP_DecryptUpdate needs at maximum: body_length + cipher_block_size. if (plain_buffer_len < (protected_len + cipher_block_size)) { - EPROSIMA_LOG_WARNING(SECURITY_CRYPTO, "Not enough memory to decode payload"); + EPROSIMA_LOG_WARNING(SECURITY_CRYPTO, "Error in fastcdr trying to decode payload"); EVP_CIPHER_CTX_free(d_ctx); return false; } @@ -2034,7 +2034,7 @@ bool AESGCMGMAC_Transform::deserialize_SecureDataBody( uint32_t cnt_len = do_encryption ? static_cast(actual_size + final_size) : body_length; if (plain_buffer_len < cnt_len) { - EPROSIMA_LOG_WARNING(SECURITY_CRYPTO, "Not enough memory to decode payload"); + EPROSIMA_LOG_WARNING(SECURITY_CRYPTO, "Error in fastcdr trying to decode payload"); return false; }