Add templated input/output stream methods
authorJuergen Gehring <juergen.gehring@bmw.de>
Tue, 5 Nov 2013 16:44:17 +0000 (17:44 +0100)
committerJuergen Gehring <juergen.gehring@bmw.de>
Tue, 5 Nov 2013 16:44:17 +0000 (17:44 +0100)
for maps with three template parameters

src/CommonAPI/InputStream.h
src/CommonAPI/OutputStream.h

index 6f3444e..a1987f2 100644 (file)
@@ -277,11 +277,17 @@ private:
         inputStream.beginReadVectorOfVectors();
     }
 
-    template<typename _InnerKeyType, typename _InnerValueType>
+    template<typename _InnerKeyType, typename _InnerValueType, typename _InnerHashType>
     static inline void doBeginReadVector(InputStream& inputStream,
-                                         const std::vector<std::unordered_map<_InnerKeyType, _InnerValueType>>& vectorValue) {
+                                         const std::vector<std::unordered_map<_InnerKeyType, _InnerValueType, _InnerHashType>>& vectorValue) {
         inputStream.beginReadVectorOfMaps();
     }
+
+    template<typename _InnerKeyType, typename _InnerValueType>
+        static inline void doBeginReadVector(InputStream& inputStream,
+                                             const std::vector<std::unordered_map<_InnerKeyType, _InnerValueType>>& vectorValue) {
+            inputStream.beginReadVectorOfMaps();
+        }
 };
 
 template<typename _VectorElementType, bool _IsSerializableStruct = false>
index 92c7cd9..3cedf27 100644 (file)
@@ -460,11 +460,17 @@ private:
         outputStream.beginWriteVectorOfVectors(vectorValue.size());
     }
 
-    template<typename _InnerKeyType, typename _InnerValueType>
+    template<typename _InnerKeyType, typename _InnerValueType, typename _InnerHashType>
     static inline void doBeginWriteVector(OutputStream& outputStream,
-                                          const std::vector<std::unordered_map<_InnerKeyType, _InnerValueType>>& vectorValue) {
+                                          const std::vector<std::unordered_map<_InnerKeyType, _InnerValueType, _InnerHashType>>& vectorValue) {
         outputStream.beginWriteVectorOfMaps(vectorValue.size());
     }
+
+    template<typename _InnerKeyType, typename _InnerValueType>
+        static inline void doBeginWriteVector(OutputStream& outputStream,
+                                              const std::vector<std::unordered_map<_InnerKeyType, _InnerValueType>>& vectorValue) {
+            outputStream.beginWriteVectorOfMaps(vectorValue.size());
+        }
 };
 
 template<typename _VectorElementType, bool _IsSerializableStruct = false>