@@ -1896,6 +1896,25 @@ class Cdr_DllAPI Cdr
1896
1896
return *this ;
1897
1897
}
1898
1898
1899
+ /* !
1900
+ * @brief This function template serializes an array of maps of objects.
1901
+ * @param map_t The array of maps of objects that will be serialized in the buffer.
1902
+ * @param numElements Number of the elements in the array.
1903
+ * @return Reference to the eprosima::fastcdr::Cdr object.
1904
+ * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
1905
+ */
1906
+ template <class _K , class _T >
1907
+ Cdr& serializeArray (
1908
+ const std::map<_K, _T>* map_t ,
1909
+ size_t numElements)
1910
+ {
1911
+ for (size_t count = 0 ; count < numElements; ++count)
1912
+ {
1913
+ serialize (map_t [count]);
1914
+ }
1915
+ return *this ;
1916
+ }
1917
+
1899
1918
/* !
1900
1919
* @brief This function template serializes an array of non-basic objects.
1901
1920
* @param type_t The array of objects that will be serialized in the buffer.
@@ -3184,6 +3203,25 @@ class Cdr_DllAPI Cdr
3184
3203
return *this ;
3185
3204
}
3186
3205
3206
+ /* !
3207
+ * @brief This function deserializes an array of maps of objects.
3208
+ * @param map_t The variable that will store the array of maps of objects read from the buffer.
3209
+ * @param numElements Number of the elements in the array.
3210
+ * @return Reference to the eprosima::fastcdr::Cdr object.
3211
+ * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size.
3212
+ */
3213
+ template <class _K , class _T >
3214
+ Cdr& deserializeArray (
3215
+ std::map<_K, _T>* map_t ,
3216
+ size_t numElements)
3217
+ {
3218
+ for (size_t count = 0 ; count < numElements; ++count)
3219
+ {
3220
+ deserialize (map_t [count]);
3221
+ }
3222
+ return *this ;
3223
+ }
3224
+
3187
3225
/* !
3188
3226
* @brief This function template deserializes an array of non-basic objects.
3189
3227
* @param type_t The variable that will store the array of objects read from the buffer.
0 commit comments