diff options
author | Bernard Normier <bernard@zeroc.com> | 2017-02-08 18:02:47 -0500 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2017-02-08 18:02:47 -0500 |
commit | cee5e5067eff15b5a22a247805edb6c8dda77074 (patch) | |
tree | e67d772a753e3ffa491571a101afb43a24824e5e /cpp/include/Ice/StreamHelpers.h | |
parent | Update Debug settings for VS 2017 (VC141) (diff) | |
download | ice-cee5e5067eff15b5a22a247805edb6c8dda77074.tar.bz2 ice-cee5e5067eff15b5a22a247805edb6c8dda77074.tar.xz ice-cee5e5067eff15b5a22a247805edb6c8dda77074.zip |
Removed cpp:unscoped from all Ice enums
CompressBatch is now "scoped" in C++98 and ObjC
Diffstat (limited to 'cpp/include/Ice/StreamHelpers.h')
-rw-r--r-- | cpp/include/Ice/StreamHelpers.h | 56 |
1 files changed, 35 insertions, 21 deletions
diff --git a/cpp/include/Ice/StreamHelpers.h b/cpp/include/Ice/StreamHelpers.h index 991ba55e703..bc1a972f3d7 100644 --- a/cpp/include/Ice/StreamHelpers.h +++ b/cpp/include/Ice/StreamHelpers.h @@ -46,19 +46,33 @@ const StreamHelperCategory StreamHelperCategoryUserException = 9; // and how it can be skipped by the unmarshaling code if the optional // isn't known to the receiver. // + +#ifdef ICE_CPP11_MAPPING +enum class OptionalFormat : unsigned char +{ + F1 = 0, // Fixed 1-byte encoding + F2 = 1, // Fixed 2 bytes encoding + F4 = 2, // Fixed 4 bytes encoding + F8 = 3, // Fixed 8 bytes encoding + Size = 4, // "Size encoding" on 1 to 5 bytes, e.g. enum, class identifier + VSize = 5, // "Size encoding" on 1 to 5 bytes followed by data, e.g. string, fixed size + // struct, or containers whose size can be computed prior to marshaling + FSize = 6, // Fixed size on 4 bytes followed by data, e.g. variable-size struct, container. + Class = 7 +}; +#else enum OptionalFormat { - OptionalFormatF1 = 0, // Fixed 1-byte encoding - OptionalFormatF2 = 1, // Fixed 2 bytes encoding - OptionalFormatF4 = 2, // Fixed 4 bytes encoding - OptionalFormatF8 = 3, // Fixed 8 bytes encoding - OptionalFormatSize = 4, // "Size encoding" on 1 to 5 bytes, e.g. enum, class identifier - OptionalFormatVSize = 5, // "Size encoding" on 1 to 5 bytes followed by data, e.g. string, fixed size - // struct, or containers whose size can be computed prior to marshaling - OptionalFormatFSize = 6, // Fixed size on 4 bytes followed by data, e.g. variable-size struct, container. + OptionalFormatF1 = 0, // see above + OptionalFormatF2 = 1, + OptionalFormatF4 = 2, + OptionalFormatF8 = 3, + OptionalFormatSize = 4, + OptionalFormatVSize = 5, + OptionalFormatFSize = 6, OptionalFormatClass = 7 }; - +#endif // // Is the provided type a container? @@ -636,43 +650,43 @@ struct GetOptionalFormat; template<> struct GetOptionalFormat<StreamHelperCategoryBuiltin, 1, true> { - static const OptionalFormat value = OptionalFormatF1; + static const OptionalFormat value = ICE_SCOPED_ENUM(OptionalFormat, F1); }; template<> struct GetOptionalFormat<StreamHelperCategoryBuiltin, 2, true> { - static const OptionalFormat value = OptionalFormatF2; + static const OptionalFormat value = ICE_SCOPED_ENUM(OptionalFormat, F2); }; template<> struct GetOptionalFormat<StreamHelperCategoryBuiltin, 4, true> { - static const OptionalFormat value = OptionalFormatF4; + static const OptionalFormat value = ICE_SCOPED_ENUM(OptionalFormat, F4); }; template<> struct GetOptionalFormat<StreamHelperCategoryBuiltin, 8, true> { - static const OptionalFormat value = OptionalFormatF8; + static const OptionalFormat value = ICE_SCOPED_ENUM(OptionalFormat, F8); }; template<> struct GetOptionalFormat<StreamHelperCategoryBuiltin, 1, false> { - static const OptionalFormat value = OptionalFormatVSize; + static const OptionalFormat value = ICE_SCOPED_ENUM(OptionalFormat, VSize); }; template<> struct GetOptionalFormat<StreamHelperCategoryClass, 1, false> { - static const OptionalFormat value = OptionalFormatClass; + static const OptionalFormat value = ICE_SCOPED_ENUM(OptionalFormat, Class); }; template<int minWireSize> struct GetOptionalFormat<StreamHelperCategoryEnum, minWireSize, false> { - static const OptionalFormat value = OptionalFormatSize; + static const OptionalFormat value = ICE_SCOPED_ENUM(OptionalFormat, Size); }; @@ -706,7 +720,7 @@ struct StreamOptionalHelper template<typename T> struct StreamOptionalHelper<T, StreamHelperCategoryStruct, true> { - static const OptionalFormat optionalFormat = OptionalFormatVSize; + static const OptionalFormat optionalFormat = ICE_SCOPED_ENUM(OptionalFormat, VSize); template<class S> static inline void write(S* stream, const T& v) @@ -727,7 +741,7 @@ struct StreamOptionalHelper<T, StreamHelperCategoryStruct, true> template<typename T> struct StreamOptionalHelper<T, StreamHelperCategoryStruct, false> { - static const OptionalFormat optionalFormat = OptionalFormatFSize; + static const OptionalFormat optionalFormat = ICE_SCOPED_ENUM(OptionalFormat, FSize); template<class S> static inline void write(S* stream, const T& v) @@ -773,7 +787,7 @@ struct StreamOptionalContainerHelper; template<typename T, int sz> struct StreamOptionalContainerHelper<T, false, sz> { - static const OptionalFormat optionalFormat = OptionalFormatFSize; + static const OptionalFormat optionalFormat = ICE_SCOPED_ENUM(OptionalFormat, FSize); template<class S> static inline void write(S* stream, const T& v, Int) @@ -796,7 +810,7 @@ struct StreamOptionalContainerHelper<T, false, sz> template<typename T, int sz> struct StreamOptionalContainerHelper<T, true, sz> { - static const OptionalFormat optionalFormat = OptionalFormatVSize; + static const OptionalFormat optionalFormat = ICE_SCOPED_ENUM(OptionalFormat, VSize); template<class S> static inline void write(S* stream, const T& v, Int n) @@ -827,7 +841,7 @@ struct StreamOptionalContainerHelper<T, true, sz> template<typename T> struct StreamOptionalContainerHelper<T, true, 1> { - static const OptionalFormat optionalFormat = OptionalFormatVSize; + static const OptionalFormat optionalFormat = ICE_SCOPED_ENUM(OptionalFormat, VSize); template<class S> static inline void write(S* stream, const T& v, Int) |