summaryrefslogtreecommitdiff
path: root/cpp/include/Ice/StreamHelpers.h
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2016-06-20 23:59:08 +0000
committerBernard Normier <bernard@zeroc.com>2016-06-21 00:00:09 +0000
commit7cc7982f3cb6426812beb73584ffe0e4d7662a4a (patch)
tree22721f9c4b07b7e42f338937ac7e7e04dc6b954e /cpp/include/Ice/StreamHelpers.h
parentC++11 AMI custom mapping support (diff)
downloadice-7cc7982f3cb6426812beb73584ffe0e4d7662a4a.tar.bz2
ice-7cc7982f3cb6426812beb73584ffe0e4d7662a4a.tar.xz
ice-7cc7982f3cb6426812beb73584ffe0e4d7662a4a.zip
Improved InputStream and OutputStream in C++11
Diffstat (limited to 'cpp/include/Ice/StreamHelpers.h')
-rw-r--r--cpp/include/Ice/StreamHelpers.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/cpp/include/Ice/StreamHelpers.h b/cpp/include/Ice/StreamHelpers.h
index 64023759f0c..9207b428b50 100644
--- a/cpp/include/Ice/StreamHelpers.h
+++ b/cpp/include/Ice/StreamHelpers.h
@@ -136,6 +136,17 @@ struct StreamableTraits<T, typename ::std::enable_if<::std::is_base_of<::Ice::Us
//
};
+//
+// StreamableTraits specialization for arrays (std::pair<const T*, const T*>).
+//
+template<typename T>
+struct StreamableTraits<std::pair<T*, T*>>
+{
+ static const StreamHelperCategory helper = StreamHelperCategorySequence;
+ static const int minWireSize = 1;
+ static const bool fixedLength = false;
+};
+
#else
//
@@ -175,7 +186,6 @@ struct StreamableTraits<UserException>
// and no optional UserException (so no need for fixedLength)
//
};
-#endif
//
// StreamableTraits specialization for array / range mapped sequences
@@ -189,6 +199,7 @@ struct StreamableTraits< ::std::pair<T, U> >
static const int minWireSize = 1;
static const bool fixedLength = false;
};
+#endif
//
// StreamableTraits specialization for builtins (these are needed for sequence
@@ -438,7 +449,7 @@ struct StreamHelper<T, StreamHelperCategorySequence>
}
};
-// Helper for array and range:array custom sequence parameters
+// Helper for array custom sequence parameters
template<typename T>
struct StreamHelper<std::pair<const T*, const T*>, StreamHelperCategorySequence>
{
@@ -455,6 +466,8 @@ struct StreamHelper<std::pair<const T*, const T*>, StreamHelperCategorySequence>
}
};
+#ifndef ICE_CPP11_MAPPING
+
// Helper for range custom sequence parameters
template<typename T>
struct StreamHelper<std::pair<T, T>, StreamHelperCategorySequence>
@@ -490,8 +503,6 @@ struct StreamHelper<std::pair< ::std::vector<bool>::const_iterator,
stream->write(static_cast<bool>(*p));
}
}
-
- // no read: only used for marshaling
};
// Helper for zero-copy array sequence parameters
@@ -506,6 +517,8 @@ struct StreamHelper<std::pair<IceUtil::ScopedArray<T>, std::pair<const T*, const
// no write: only used for unmarshaling
};
+#endif
+
// Helper for dictionaries
template<typename T>
@@ -861,6 +874,8 @@ struct StreamOptionalHelper<std::pair<const T*, const T*>, StreamHelperCategoryS
}
};
+#ifndef ICE_CPP11_MAPPING
+
template<typename T>
struct StreamOptionalHelper<std::pair<T, T>, StreamHelperCategorySequence, false>
{
@@ -906,6 +921,7 @@ struct StreamOptionalHelper<std::pair<IceUtil::ScopedArray<T>, std::pair<const T
// no write: only used for unmarshaling
};
+#endif
//
// Helper to write dictionaries, delegates to the optional container