summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp/GenUtil.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2001-07-06 21:19:04 +0000
committerMarc Laukien <marc@zeroc.com>2001-07-06 21:19:04 +0000
commit3330a193df2550dff331238080a5920923a681b8 (patch)
treeb6ff9c6e05be6807b56d38366de99367cb0c81a2 /cpp/src/slice2cpp/GenUtil.cpp
parentaddTemporary (diff)
downloadice-3330a193df2550dff331238080a5920923a681b8.tar.bz2
ice-3330a193df2550dff331238080a5920923a681b8.tar.xz
ice-3330a193df2550dff331238080a5920923a681b8.zip
enums
Diffstat (limited to 'cpp/src/slice2cpp/GenUtil.cpp')
-rw-r--r--cpp/src/slice2cpp/GenUtil.cpp40
1 files changed, 25 insertions, 15 deletions
diff --git a/cpp/src/slice2cpp/GenUtil.cpp b/cpp/src/slice2cpp/GenUtil.cpp
index 1fa9a009d91..c1adfddd283 100644
--- a/cpp/src/slice2cpp/GenUtil.cpp
+++ b/cpp/src/slice2cpp/GenUtil.cpp
@@ -9,6 +9,7 @@
// **********************************************************************
#include <GenUtil.h>
+#include <limits>
using namespace std;
using namespace Slice;
@@ -91,6 +92,10 @@ Slice::inputTypeToString(const Type_ptr& type)
if(proxy)
return "const " + proxy -> _class() -> scoped() + "_prx&";
+ Enum_ptr en = Enum_ptr::dynamicCast(type);
+ if(en)
+ return en -> scoped();
+
Native_ptr native = Native_ptr::dynamicCast(type);
if(native)
return native -> scoped();
@@ -146,7 +151,7 @@ Slice::outputTypeToString(const Type_ptr& type)
void
Slice::writeMarshalUnmarshalCode(Output& out, const Type_ptr& type,
- const string& param, bool marshal)
+ const string& param, bool marshal)
{
const char* func = marshal ? "write(" : "read(";
const char* stream = marshal ? "__os" : "__is";
@@ -157,16 +162,6 @@ Slice::writeMarshalUnmarshalCode(Output& out, const Type_ptr& type,
return;
}
- Vector_ptr vector = Vector_ptr::dynamicCast(type);
- if(vector && Builtin_ptr::dynamicCast(vector -> type()))
- {
- out << nl << stream << " -> " << func << param << ");";
- return;
- }
-
- Native_ptr native = Native_ptr::dynamicCast(type);
- assert(!native); // TODO
-
ClassDecl_ptr cl = ClassDecl_ptr::dynamicCast(type);
if(cl)
{
@@ -210,6 +205,21 @@ Slice::writeMarshalUnmarshalCode(Output& out, const Type_ptr& type,
return;
}
+ Vector_ptr vec = Vector_ptr::dynamicCast(type);
+ if(vec)
+ {
+ if(Builtin_ptr::dynamicCast(vec -> type()))
+ out << nl << stream << " -> " << func << param << ");";
+ else
+ out << nl << vec -> scope() << "::__" << func << stream\
+ << ", " << param << ", " << vec -> scope()
+ << "::__U__" << vec -> name() << "());";
+ return;
+ }
+
+ Native_ptr native = Native_ptr::dynamicCast(type);
+ assert(!native); // TODO
+
Constructed_ptr constructed = Constructed_ptr::dynamicCast(type);
if(!constructed)
{
@@ -224,8 +234,8 @@ Slice::writeMarshalUnmarshalCode(Output& out, const Type_ptr& type,
void
Slice::writeMarshalCode(Output& out,
- const list<pair<Type_ptr, string> >& params,
- const Type_ptr& ret)
+ const list<pair<Type_ptr, string> >& params,
+ const Type_ptr& ret)
{
list<pair<Type_ptr, string> >::const_iterator p;
for(p = params.begin(); p != params.end(); ++p)
@@ -248,8 +258,8 @@ Slice::writeUnmarshalCode(Output& out,
void
Slice::writeAllocateCode(Output& out,
- const list<pair<Type_ptr, string> >& params,
- const Type_ptr& ret)
+ const list<pair<Type_ptr, string> >& params,
+ const Type_ptr& ret)
{
list<pair<Type_ptr, string> > ps = params;
if(ret)