diff options
Diffstat (limited to 'cpp/include/Slice/JavaUtil.h')
-rw-r--r-- | cpp/include/Slice/JavaUtil.h | 46 |
1 files changed, 37 insertions, 9 deletions
diff --git a/cpp/include/Slice/JavaUtil.h b/cpp/include/Slice/JavaUtil.h index b6f43517f51..d7023490b78 100644 --- a/cpp/include/Slice/JavaUtil.h +++ b/cpp/include/Slice/JavaUtil.h @@ -112,6 +112,21 @@ protected: const std::string& = std::string()) const; // + // Return the method call necessary to obtain the static type ID for an object type. + // + std::string getStaticId(const TypePtr&, const std::string&) const; + + // + // Determines whether an operation should use the optional mapping. + // + bool useOptionalMapping(const OperationPtr&); + + // + // Returns the optional type corresponding to the given Slice type. + // + std::string getOptionalType(const TypePtr&); + + // // Get the Java name for a type. If an optional scope is provided, // the scope will be removed from the result if possible. // @@ -123,7 +138,7 @@ protected: TypeModeReturn }; std::string typeToString(const TypePtr&, TypeMode, const std::string& = std::string(), - const StringList& = StringList(), bool = true) const; + const StringList& = StringList(), bool = true, bool = false) const; // // Get the Java object name for a type. For primitive types, this returns the @@ -136,9 +151,18 @@ protected: // // Generate code to marshal or unmarshal a type. // - void writeMarshalUnmarshalCode(::IceUtilInternal::Output&, const std::string&, const TypePtr&, const std::string&, - bool, int&, bool = false, const StringList& = StringList(), - const std::string& patchParams = ""); + enum OptionalMode + { + OptionalNone, + OptionalInParam, + OptionalOutParam, + OptionalReturnParam, + OptionalMember + }; + + void writeMarshalUnmarshalCode(::IceUtilInternal::Output&, const std::string&, const TypePtr&, OptionalMode, + bool, int, const std::string&, bool, int&, bool = false, + const StringList& = StringList(), const std::string& patchParams = ""); // // Generate code to marshal or unmarshal a dictionary type. @@ -151,15 +175,14 @@ protected: // Generate code to marshal or unmarshal a sequence type. // void writeSequenceMarshalUnmarshalCode(::IceUtilInternal::Output&, const std::string&, const SequencePtr&, - const std::string&, bool, int&, bool, - const StringList& = StringList()); + const std::string&, bool, int&, bool, const StringList& = StringList()); // // Generate code to marshal or unmarshal a type using the public stream API. // - void writeStreamMarshalUnmarshalCode(::IceUtilInternal::Output&, const std::string&, const TypePtr&, const std::string&, - bool, int&, bool = false, const StringList& = StringList(), - const std::string& patchParams = ""); + void writeStreamMarshalUnmarshalCode(::IceUtilInternal::Output&, const std::string&, const TypePtr&, bool, int, + const std::string&, bool, int&, bool = false, + const StringList& = StringList(), const std::string& patchParams = ""); // // Generate code to marshal or unmarshal a dictionary type using the public stream API. @@ -176,6 +199,11 @@ protected: const StringList& = StringList()); // + // Search metadata for an entry with the given prefix and return the entire string. + // + static bool findMetaData(const std::string&, const StringList&, std::string&); + + // // Get custom type metadata. If metadata is found, the abstract and // concrete types are extracted and the function returns true. If an // abstract type is not specified, it is set to an empty string. |