From 06612945a67e56fb5924f903fdf815b1ca8491bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Gonz=C3=A1lez=20Moreno?= Date: Tue, 20 Feb 2024 07:57:12 +0100 Subject: [PATCH] Refs #17138. Fix std::vector as array MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ricardo González Moreno --- include/fastcdr/CdrSizeCalculator.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/fastcdr/CdrSizeCalculator.hpp b/include/fastcdr/CdrSizeCalculator.hpp index 280357a8..67860e2a 100644 --- a/include/fastcdr/CdrSizeCalculator.hpp +++ b/include/fastcdr/CdrSizeCalculator.hpp @@ -1114,6 +1114,21 @@ class CdrSizeCalculator return calculated_size; } + /*! + * @brief Specific template which calculates the encoded size of an std::vector of bool as an array. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_array_serialized_size( + const std::vector& data, + size_t& current_alignment) + { + current_alignment += data.size(); + return data.size(); + } + /*! * @brief Generic template which calculates the encoded size of the constructed type's member of a unknown type. * @tparam _T Member's type.