15#ifndef _FASTCDR_CDRSIZECALCULATOR_HPP_
16#define _FASTCDR_CDRSIZECALCULATOR_HPP_
25#include "fastcdr_dll.h"
27#include "CdrEncoding.hpp"
28#include "cdr/fixed_size_string.hpp"
29#include "detail/container_recursive_inspector.hpp"
30#include "exceptions/BadParamException.h"
31#include "xcdr/external.hpp"
32#include "xcdr/MemberId.hpp"
33#include "xcdr/optional.hpp"
38class CdrSizeCalculator;
92 template<class _T, typename std::enable_if<!std::is_enum<_T>::value>::type* =
nullptr,
typename =
void>
95 size_t& current_alignment)
108 typename std::enable_if<std::is_enum<_T>::value>::type* =
nullptr,
109 typename std::enable_if<std::is_same<typename std::underlying_type<_T>::type,
110 int32_t>::value>::type* =
nullptr>
113 size_t& current_alignment)
126 typename std::enable_if<std::is_enum<_T>::value>::type* =
nullptr,
127 typename std::enable_if<std::is_same<typename std::underlying_type<_T>::type,
128 uint32_t>::value>::type* =
nullptr>
131 size_t& current_alignment)
144 typename std::enable_if<std::is_enum<_T>::value>::type* =
nullptr,
145 typename std::enable_if<std::is_same<typename std::underlying_type<_T>::type,
146 int16_t>::value>::type* =
nullptr>
149 size_t& current_alignment)
162 typename std::enable_if<std::is_enum<_T>::value>::type* =
nullptr,
163 typename std::enable_if<std::is_same<typename std::underlying_type<_T>::type,
164 uint16_t>::value>::type* =
nullptr>
167 size_t& current_alignment)
180 typename std::enable_if<std::is_enum<_T>::value>::type* =
nullptr,
181 typename std::enable_if<std::is_same<typename std::underlying_type<_T>::type,
182 int8_t>::value>::type* =
nullptr>
185 size_t& current_alignment)
198 typename std::enable_if<std::is_enum<_T>::value>::type* =
nullptr,
199 typename std::enable_if<std::is_same<typename std::underlying_type<_T>::type,
200 uint8_t>::value>::type* =
nullptr>
203 size_t& current_alignment)
217 size_t& current_alignment)
219 static_cast<void>(data);
233 size_t& current_alignment)
235 static_cast<void>(data);
249 size_t& current_alignment)
251 static_cast<void>(data);
265 size_t& current_alignment)
267 static_cast<void>(data);
281 size_t& current_alignment)
283 static_cast<void>(data);
284 size_t calculated_size {2 + alignment(current_alignment, 2)};
285 current_alignment += calculated_size;
286 return calculated_size;
298 size_t& current_alignment)
300 static_cast<void>(data);
301 size_t calculated_size {2 + alignment(current_alignment, 2)};
302 current_alignment += calculated_size;
303 return calculated_size;
314 const uint16_t& data,
315 size_t& current_alignment)
317 static_cast<void>(data);
318 size_t calculated_size {2 + alignment(current_alignment, 2)};
319 current_alignment += calculated_size;
320 return calculated_size;
332 size_t& current_alignment)
334 static_cast<void>(data);
335 size_t calculated_size {4 + alignment(current_alignment, 4)};
336 current_alignment += calculated_size;
337 return calculated_size;
348 const uint32_t& data,
349 size_t& current_alignment)
351 static_cast<void>(data);
352 size_t calculated_size {4 + alignment(current_alignment, 4)};
353 current_alignment += calculated_size;
354 return calculated_size;
366 size_t& current_alignment)
368 static_cast<void>(data);
369 size_t calculated_size {8 + alignment(current_alignment, align64_)};
370 current_alignment += calculated_size;
371 return calculated_size;
382 const uint64_t& data,
383 size_t& current_alignment)
385 static_cast<void>(data);
386 size_t calculated_size {8 + alignment(current_alignment, align64_)};
387 current_alignment += calculated_size;
388 return calculated_size;
400 size_t& current_alignment)
402 static_cast<void>(data);
403 size_t calculated_size {4 + alignment(current_alignment, 4)};
404 current_alignment += calculated_size;
405 return calculated_size;
417 size_t& current_alignment)
419 static_cast<void>(data);
420 size_t calculated_size {8 + alignment(current_alignment, align64_)};
421 current_alignment += calculated_size;
422 return calculated_size;
433 const long double& data,
434 size_t& current_alignment)
436 static_cast<void>(data);
437 size_t calculated_size {16 + alignment(current_alignment, align64_)};
438 current_alignment += calculated_size;
439 return calculated_size;
450 const std::string& data,
451 size_t& current_alignment)
453 size_t calculated_size {4 + alignment(current_alignment, 4) + data.size() + 1};
454 current_alignment += calculated_size;
455 serialized_member_size_ = SERIALIZED_MEMBER_SIZE;
457 return calculated_size;
468 const std::wstring& data,
469 size_t& current_alignment)
471 size_t calculated_size {4 + alignment(current_alignment, 4) + data.size() * 2};
472 current_alignment += calculated_size;
474 return calculated_size;
483 template <
size_t MAX_CHARS>
486 size_t& current_alignment)
488 size_t calculated_size {4 + alignment(current_alignment, 4) + data.
size() + 1};
489 current_alignment += calculated_size;
491 return calculated_size;
500 template<class _T, typename std::enable_if<!std::is_enum<_T>::value &&
501 !std::is_arithmetic<_T>::value>::type* =
nullptr>
503 const std::vector<_T>& data,
504 size_t& current_alignment)
506 size_t initial_alignment {current_alignment};
511 current_alignment += 4 + alignment(current_alignment, 4);
514 current_alignment += 4 + alignment(current_alignment, 4);
516 size_t calculated_size {current_alignment - initial_alignment};
522 serialized_member_size_ = SERIALIZED_MEMBER_SIZE;
525 return calculated_size;
534 template<class _T, typename std::enable_if<std::is_enum<_T>::value ||
535 std::is_arithmetic<_T>::value>::type* =
nullptr>
537 const std::vector<_T>& data,
538 size_t& current_alignment)
540 size_t initial_alignment {current_alignment};
542 current_alignment += 4 + alignment(current_alignment, 4);
544 size_t calculated_size {current_alignment - initial_alignment};
549 serialized_member_size_ = get_serialized_member_size<_T>();
552 return calculated_size;
563 const std::vector<bool>& data,
564 size_t& current_alignment)
566 size_t calculated_size {data.size() + 4 + alignment(current_alignment, 4)};
567 current_alignment += calculated_size;
569 return calculated_size;
578 template<
class _T,
size_t _Size>
580 const std::array<_T, _Size>& data,
581 size_t& current_alignment)
583 size_t initial_alignment {current_alignment};
589 current_alignment += 4 + alignment(current_alignment, 4);
592 size_t calculated_size {current_alignment - initial_alignment};
599 serialized_member_size_ = SERIALIZED_MEMBER_SIZE;
602 return calculated_size;
611 template<class _K, class _V, typename std::enable_if<!std::is_enum<_V>::value &&
612 !std::is_arithmetic<_V>::value>::type* =
nullptr>
614 const std::map<_K, _V>& data,
615 size_t& current_alignment)
617 size_t initial_alignment {current_alignment};
622 current_alignment += 4 + alignment(current_alignment, 4);
625 current_alignment += 4 + alignment(current_alignment, 4);
627 size_t calculated_size {current_alignment - initial_alignment};
628 for (
auto it = data.begin(); it != data.end(); ++it)
637 serialized_member_size_ = SERIALIZED_MEMBER_SIZE;
640 return calculated_size;
649 template<class _K, class _V, typename std::enable_if<std::is_enum<_V>::value ||
650 std::is_arithmetic<_V>::value>::type* =
nullptr>
652 const std::map<_K, _V>& data,
653 size_t& current_alignment)
655 size_t initial_alignment {current_alignment};
657 current_alignment += 4 + alignment(current_alignment, 4);
659 size_t calculated_size {current_alignment - initial_alignment};
660 for (
auto it = data.begin(); it != data.end(); ++it)
666 return calculated_size;
675 template<
size_t N,
typename std::enable_if < (N < 9) > ::type* =
nullptr>
676 size_t calculate_serialized_size(
677 const std::bitset<N>& data,
678 size_t& current_alignment)
680 static_cast<
void>(data);
691 template<
size_t N,
typename std::enable_if < (8 < N && N < 17) > ::type* =
nullptr>
692 size_t calculate_serialized_size(
693 const std::bitset<N>& data,
694 size_t& current_alignment)
696 static_cast<
void>(data);
697 size_t calculated_size {2 + alignment(current_alignment, 2)};
698 current_alignment += calculated_size;
699 return calculated_size;
708 template<
size_t N,
typename std::enable_if < (16 < N && N < 33) > ::type* =
nullptr>
709 size_t calculate_serialized_size(
710 const std::bitset<N>& data,
711 size_t& current_alignment)
713 static_cast<
void>(data);
714 size_t calculated_size {4 + alignment(current_alignment, 4)};
715 current_alignment += calculated_size;
716 return calculated_size;
725 template<
size_t N,
typename std::enable_if < (32 < N && N < 65) > ::type* =
nullptr>
726 size_t calculate_serialized_size(
727 const std::bitset<N>& data,
728 size_t& current_alignment)
730 static_cast<
void>(data);
731 size_t calculated_size {8 + alignment(current_alignment, align64_)};
732 current_alignment += calculated_size;
733 return calculated_size;
745 size_t& current_alignment)
747 size_t initial_alignment = current_alignment;
756 size_t calculated_size {current_alignment - initial_alignment};
763 return calculated_size;
776 size_t& current_alignment)
798 size_t& current_alignment)
800 size_t calculated_size {0};
802 for (
size_t count = 0; count < num_elements; ++count)
807 return calculated_size;
821 size_t& current_alignment)
823 static_cast<void>(data);
824 current_alignment += num_elements;
839 size_t& current_alignment)
841 static_cast<void>(data);
842 current_alignment += num_elements;
857 size_t& current_alignment)
859 static_cast<void>(data);
860 current_alignment += num_elements;
875 size_t& current_alignment)
877 static_cast<void>(data);
878 size_t calculated_size {num_elements* 2 + alignment(current_alignment, 2)};
879 current_alignment += calculated_size;
880 return calculated_size;
894 size_t& current_alignment)
896 static_cast<void>(data);
897 size_t calculated_size {num_elements* 2 + alignment(current_alignment, 2)};
898 current_alignment += calculated_size;
899 return calculated_size;
911 const uint16_t* data,
913 size_t& current_alignment)
915 static_cast<void>(data);
916 size_t calculated_size {num_elements* 2 + alignment(current_alignment, 2)};
917 current_alignment += calculated_size;
918 return calculated_size;
932 size_t& current_alignment)
934 static_cast<void>(data);
935 size_t calculated_size {num_elements* 4 + alignment(current_alignment, 4)};
936 current_alignment += calculated_size;
937 return calculated_size;
949 const uint32_t* data,
951 size_t& current_alignment)
953 static_cast<void>(data);
954 size_t calculated_size {num_elements* 4 + alignment(current_alignment, 4)};
955 current_alignment += calculated_size;
956 return calculated_size;
970 size_t& current_alignment)
972 static_cast<void>(data);
973 size_t calculated_size {num_elements* 8 + alignment(current_alignment, align64_)};
974 current_alignment += calculated_size;
975 return calculated_size;
987 const uint64_t* data,
989 size_t& current_alignment)
991 static_cast<void>(data);
992 size_t calculated_size {num_elements* 8 + alignment(current_alignment, align64_)};
993 current_alignment += calculated_size;
994 return calculated_size;
1007 size_t num_elements,
1008 size_t& current_alignment)
1010 static_cast<void>(data);
1011 size_t calculated_size {num_elements* 4 + alignment(current_alignment, 4)};
1012 current_alignment += calculated_size;
1013 return calculated_size;
1026 size_t num_elements,
1027 size_t& current_alignment)
1029 static_cast<void>(data);
1030 size_t calculated_size {num_elements* 8 + alignment(current_alignment, align64_)};
1031 current_alignment += calculated_size;
1032 return calculated_size;
1044 const long double* data,
1045 size_t num_elements,
1046 size_t& current_alignment)
1048 static_cast<void>(data);
1049 size_t calculated_size {num_elements* 16 + alignment(current_alignment, align64_)};
1050 current_alignment += calculated_size;
1051 return calculated_size;
1061 template<
class _T,
size_t _N>
1063 const std::array<_T, _N>* data,
1064 size_t num_elements,
1065 size_t& current_alignment)
1076 template<class _T, typename std::enable_if<std::is_enum<_T>::value ||
1077 std::is_arithmetic<_T>::value>::type* =
nullptr>
1079 const std::vector<_T>& data,
1080 size_t& current_alignment)
1091 template<class _T, typename std::enable_if<!std::is_enum<_T>::value &&
1092 !std::is_arithmetic<_T>::value>::type* =
nullptr>
1094 const std::vector<_T>& data,
1095 size_t& current_alignment)
1097 size_t initial_alignment {current_alignment};
1102 current_alignment += 4 + alignment(current_alignment, 4);
1105 size_t calculated_size {current_alignment - initial_alignment};
1111 serialized_member_size_ = SERIALIZED_MEMBER_SIZE;
1114 return calculated_size;
1125 const std::vector<bool>& data,
1126 size_t& current_alignment)
1128 current_alignment += data.size();
1144 size_t& current_alignment)
1146 size_t initial_alignment {current_alignment};
1152 current_alignment += alignment(current_alignment, 4);
1155 size_t prev_size {current_alignment - initial_alignment};
1156 size_t extra_size {0};
1160 current_alignment = 0;
1166 0 < calculated_size)
1169 if (8 < calculated_size)
1172 if (NO_SERIALIZED_MEMBER_SIZE != serialized_member_size_)
1174 calculated_size -= 4;
1183 0 < calculated_size)
1187 if (0x3F00 <
id.
id || calculated_size > std::numeric_limits<uint16_t>::max())
1194 calculated_size += prev_size + extra_size;
1197 current_alignment += extra_size;
1200 serialized_member_size_ = NO_SERIALIZED_MEMBER_SIZE;
1202 return calculated_size;
1217 size_t& current_alignment)
1219 size_t initial_alignment = current_alignment;
1227 current_alignment += alignment(current_alignment, 4);
1231 size_t prev_size = {current_alignment - initial_alignment};
1232 size_t extra_size {0};
1237 current_alignment = 0;
1243 0 < calculated_size)
1245 if (8 < calculated_size)
1248 if (NO_SERIALIZED_MEMBER_SIZE != serialized_member_size_)
1263 if (0x3F00 <
id.
id || calculated_size > std::numeric_limits<uint16_t>::max())
1270 calculated_size += prev_size + extra_size;
1273 current_alignment += extra_size;
1277 return calculated_size;
1288 size_t& current_alignment);
1298 size_t& current_alignment);
1308 enum SerializedMemberSizeForNextInt
1310 NO_SERIALIZED_MEMBER_SIZE,
1311 SERIALIZED_MEMBER_SIZE,
1312 SERIALIZED_MEMBER_SIZE_4,
1313 SERIALIZED_MEMBER_SIZE_8
1316 serialized_member_size_ {NO_SERIALIZED_MEMBER_SIZE};
1319 size_t align64_ {4};
1321 inline size_t alignment(
1322 size_t current_alignment,
1323 size_t data_size)
const
1325 return (data_size - (current_alignment % data_size)) & (data_size - 1);
1328 template<class _T, typename std::enable_if<std::is_enum<_T>::value ||
1329 std::is_arithmetic<_T>::value>::type* =
nullptr>
1330 constexpr SerializedMemberSizeForNextInt get_serialized_member_size()
const
1332 return (1 ==
sizeof(_T) ? SERIALIZED_MEMBER_SIZE :
1333 (4 == sizeof(_T) ? SERIALIZED_MEMBER_SIZE_4 :
1334 (8 == sizeof(_T) ? SERIALIZED_MEMBER_SIZE_8 : NO_SERIALIZED_MEMBER_SIZE)));
This class offers an interface to calculate the encoded size of a type serialized using a support enc...
Definition CdrSizeCalculator.hpp:52
size_t calculate_serialized_size(const _T &data, size_t ¤t_alignment)
Generic template which calculates the encoded size of an instance of an unknown type.
Definition CdrSizeCalculator.hpp:93
Cdr_DllAPI CdrSizeCalculator(CdrVersion cdr_version)
Constructor.
Cdr_DllAPI EncodingAlgorithmFlag get_encoding() const
Retrieves the current encoding algorithm used by the instance.
TEMPLATE_SPEC size_t calculate_array_serialized_size(const uint64_t *data, size_t num_elements, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of an array of uint64_t.
Definition CdrSizeCalculator.hpp:986
TEMPLATE_SPEC size_t calculate_array_serialized_size(const uint16_t *data, size_t num_elements, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of an array of uint16_t.
Definition CdrSizeCalculator.hpp:910
Cdr_DllAPI size_t end_calculate_type_serialized_size(EncodingAlgorithmFlag new_encoding, size_t ¤t_alignment)
Indicates the ending of a constructed type.
TEMPLATE_SPEC size_t calculate_array_serialized_size(const uint32_t *data, size_t num_elements, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of an array of uint32_t.
Definition CdrSizeCalculator.hpp:948
TEMPLATE_SPEC size_t calculate_serialized_size(const uint8_t &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of an uint8_t.
Definition CdrSizeCalculator.hpp:231
TEMPLATE_SPEC size_t calculate_array_serialized_size(const int64_t *data, size_t num_elements, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of an array of int64_t.
Definition CdrSizeCalculator.hpp:967
TEMPLATE_SPEC size_t calculate_array_serialized_size(const uint8_t *data, size_t num_elements, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of an array of uint8_t.
Definition CdrSizeCalculator.hpp:836
size_t calculate_serialized_size(const fixed_string< MAX_CHARS > &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of a fixed_string.
Definition CdrSizeCalculator.hpp:484
TEMPLATE_SPEC size_t calculate_array_serialized_size(const int32_t *data, size_t num_elements, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of an array of int32_t.
Definition CdrSizeCalculator.hpp:929
size_t calculate_array_serialized_size(const std::array< _T, _N > *data, size_t num_elements, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of a multi-dimensional array.
Definition CdrSizeCalculator.hpp:1062
size_t calculate_array_serialized_size(const _T *data, size_t num_elements, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of an array of unknown type.
Definition CdrSizeCalculator.hpp:795
size_t calculate_serialized_size(const optional< _T > &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of an optional type.
Definition CdrSizeCalculator.hpp:743
TEMPLATE_SPEC size_t calculate_array_serialized_size(const int8_t *data, size_t num_elements, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of an array of int8_t.
Definition CdrSizeCalculator.hpp:818
TEMPLATE_SPEC size_t calculate_array_serialized_size(const long double *data, size_t num_elements, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of an array of long double.
Definition CdrSizeCalculator.hpp:1043
TEMPLATE_SPEC size_t calculate_serialized_size(const long double &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of a long double.
Definition CdrSizeCalculator.hpp:432
TEMPLATE_SPEC size_t calculate_array_serialized_size(const int16_t *data, size_t num_elements, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of an array of int16_t.
Definition CdrSizeCalculator.hpp:891
size_t calculate_array_serialized_size(const std::vector< _T > &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an std::vector of primitives as an array.
Definition CdrSizeCalculator.hpp:1078
TEMPLATE_SPEC size_t calculate_serialized_size(const int8_t &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of an int8_t.
Definition CdrSizeCalculator.hpp:215
Cdr_DllAPI size_t begin_calculate_type_serialized_size(EncodingAlgorithmFlag new_encoding, size_t ¤t_alignment)
Indicates a new constructed type will be calculated.
TEMPLATE_SPEC size_t calculate_serialized_size(const double &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of a double.
Definition CdrSizeCalculator.hpp:415
TEMPLATE_SPEC size_t calculate_array_serialized_size(const char *data, size_t num_elements, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of an array of char.
Definition CdrSizeCalculator.hpp:854
size_t calculate_member_serialized_size(const MemberId &id, const _T &data, size_t ¤t_alignment)
Generic template which calculates the encoded size of the constructed type's member of a unknown type...
Definition CdrSizeCalculator.hpp:1141
TEMPLATE_SPEC size_t calculate_serialized_size(const int16_t &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of a int16_t.
Definition CdrSizeCalculator.hpp:296
TEMPLATE_SPEC size_t calculate_serialized_size(const std::vector< bool > &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of a sequence of bool.
Definition CdrSizeCalculator.hpp:562
TEMPLATE_SPEC size_t calculate_array_serialized_size(const std::vector< bool > &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an std::vector of bool as an array.
Definition CdrSizeCalculator.hpp:1124
size_t calculate_serialized_size(const std::array< _T, _Size > &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of an array.
Definition CdrSizeCalculator.hpp:579
TEMPLATE_SPEC size_t calculate_array_serialized_size(const float *data, size_t num_elements, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of an array of float.
Definition CdrSizeCalculator.hpp:1005
TEMPLATE_SPEC size_t calculate_serialized_size(const float &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of a float.
Definition CdrSizeCalculator.hpp:398
TEMPLATE_SPEC size_t calculate_array_serialized_size(const double *data, size_t num_elements, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of an array of double.
Definition CdrSizeCalculator.hpp:1024
TEMPLATE_SPEC size_t calculate_serialized_size(const int32_t &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of a int32_t.
Definition CdrSizeCalculator.hpp:330
TEMPLATE_SPEC size_t calculate_array_serialized_size(const wchar_t *data, size_t num_elements, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of an array of wchar.
Definition CdrSizeCalculator.hpp:872
TEMPLATE_SPEC size_t calculate_serialized_size(const uint64_t &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of a uint64_t.
Definition CdrSizeCalculator.hpp:381
TEMPLATE_SPEC size_t calculate_serialized_size(const std::wstring &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of a std::wstring.
Definition CdrSizeCalculator.hpp:467
TEMPLATE_SPEC size_t calculate_serialized_size(const bool &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of a bool.
Definition CdrSizeCalculator.hpp:263
TEMPLATE_SPEC size_t calculate_serialized_size(const char &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of a char.
Definition CdrSizeCalculator.hpp:247
TEMPLATE_SPEC size_t calculate_serialized_size(const uint32_t &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of a uint32_t.
Definition CdrSizeCalculator.hpp:347
size_t calculate_serialized_size(const std::vector< _T > &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of a sequence of non-primitives.
Definition CdrSizeCalculator.hpp:502
TEMPLATE_SPEC size_t calculate_serialized_size(const int64_t &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of a int64_t.
Definition CdrSizeCalculator.hpp:364
Cdr_DllAPI CdrVersion get_cdr_version() const
Retrieves the version of the encoding algorithm used by the instance.
TEMPLATE_SPEC size_t calculate_serialized_size(const std::string &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of a std::string.
Definition CdrSizeCalculator.hpp:449
size_t calculate_serialized_size(const std::map< _K, _V > &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of a map of non-primitives.
Definition CdrSizeCalculator.hpp:613
size_t calculate_serialized_size(const external< _T > &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of an external type.
Definition CdrSizeCalculator.hpp:774
TEMPLATE_SPEC size_t calculate_serialized_size(const wchar_t &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of a wchar.
Definition CdrSizeCalculator.hpp:279
size_t calculate_member_serialized_size(const MemberId &id, const optional< _T > &data, size_t ¤t_alignment)
Generic template which calculates the encoded size of the constructed type's member of type optional.
Definition CdrSizeCalculator.hpp:1214
Cdr_DllAPI CdrSizeCalculator(CdrVersion cdr_version, EncodingAlgorithmFlag encoding)
Constructor.
TEMPLATE_SPEC size_t calculate_serialized_size(const uint16_t &data, size_t ¤t_alignment)
Specific template which calculates the encoded size of an instance of a uint16_t.
Definition CdrSizeCalculator.hpp:313
Definition MemberId.hpp:28
This class is thrown as an exception when an invalid parameter is being serialized.
Definition BadParamException.h:28
This class template manages an external member, a member declared to be external to the storage of a ...
Definition external.hpp:30
This class template manages an optional contained value, i.e.
Definition optional.hpp:47
T & value() &
Returns the contained value.
Definition optional.hpp:129
bool has_value() const
Checks whether the optional contains a value.
Definition optional.hpp:196
EncodingAlgorithmFlag
This enumeration represents the supported XCDR encoding algorithms.
Definition CdrEncoding.hpp:38
@ PL_CDR2
Specifies that the content is PL_CDR2.
Definition CdrEncoding.hpp:48
@ PL_CDR
Specifies that the content is PL_CDR,.
Definition CdrEncoding.hpp:42
@ PLAIN_CDR
Specifies that the content is PLAIN_CDR.
Definition CdrEncoding.hpp:40
@ PLAIN_CDR2
Specifies that the content is PLAIN_CDR2.
Definition CdrEncoding.hpp:44
constexpr bool is_multi_array_primitive(...)
Basis.
Definition container_recursive_inspector.hpp:27
size_t calculate_serialized_size(CdrSizeCalculator &, const _T &, size_t &)
CdrVersion
This enumeration represents the kinds of CDR serialization supported by eprosima::fastcdr::CDR.
Definition CdrEncoding.hpp:25
@ XCDRv2
XCDRv2 encoding defined by standard DDS X-Types 1.3.
Definition CdrEncoding.hpp:33
@ XCDRv1
XCDRv1 encoding defined by standard DDS X-Types 1.3.
Definition CdrEncoding.hpp:31
Template class for non-alloc strings.
Definition fixed_size_string.hpp:45
size_t size() const noexcept
Returns the size of the string.
Definition fixed_size_string.hpp:288