summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/slice2cpp')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp16
-rw-r--r--cpp/src/slice2cpp/Gen.h1
-rw-r--r--cpp/src/slice2cpp/GenUtil.cpp11
3 files changed, 25 insertions, 3 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index ef82ed084a5..c57edcd6bed 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -99,10 +99,12 @@ Slice::Gen::generate(const Parser_ptr& parser)
C << include_ << '/';
C << base_ << ".h>";
+ H << "\n#include <Ice/ProxyF.h>";
+ H << "\n#include <Ice/ObjectF.h>";
+ H << "\n#include <Ice/LocalObjectF.h>";
+ H << "\n#include <Ice/Native.h>";
if(parser -> hasProxies())
{
-// H << "\n#include <Ice/ProxyF.h>";
-// H << "\n#include <Ice/ObjectF.h>";
H << "\n#include <Ice/Proxy.h>";
H << "\n#include <Ice/Object.h>";
H << "\n#include <Ice/Outgoing.h>";
@@ -111,7 +113,6 @@ Slice::Gen::generate(const Parser_ptr& parser)
}
else
{
-// H << "\n#include <Ice/LocalObjectF.h>";
H << "\n#include <Ice/LocalObject.h>";
C << "\n#include <Ice/Stream.h>";
}
@@ -285,6 +286,15 @@ Slice::Gen::TypesVisitor::visitVector(const Vector_ptr& p)
}
}
+void
+Slice::Gen::TypesVisitor::visitNative(const Native_ptr& p)
+{
+ string name = p -> name();
+
+ H << sp;
+ H << nl << "typedef ::__IceNative::" << name << ' ' << name << ';';
+}
+
Slice::Gen::ProxyDeclVisitor::ProxyDeclVisitor(Output& h, Output& c,
const string& dllExport)
: H(h), C(c), dllExport_(dllExport)
diff --git a/cpp/src/slice2cpp/Gen.h b/cpp/src/slice2cpp/Gen.h
index 7e7b203e17f..c2299529fb5 100644
--- a/cpp/src/slice2cpp/Gen.h
+++ b/cpp/src/slice2cpp/Gen.h
@@ -55,6 +55,7 @@ private:
virtual void visitModuleStart(const Module_ptr&);
virtual void visitModuleEnd(const Module_ptr&);
virtual void visitVector(const Vector_ptr&);
+ virtual void visitNative(const Native_ptr&);
private:
diff --git a/cpp/src/slice2cpp/GenUtil.cpp b/cpp/src/slice2cpp/GenUtil.cpp
index 08eb26129d0..1fa9a009d91 100644
--- a/cpp/src/slice2cpp/GenUtil.cpp
+++ b/cpp/src/slice2cpp/GenUtil.cpp
@@ -91,6 +91,10 @@ Slice::inputTypeToString(const Type_ptr& type)
if(proxy)
return "const " + proxy -> _class() -> scoped() + "_prx&";
+ Native_ptr native = Native_ptr::dynamicCast(type);
+ if(native)
+ return native -> scoped();
+
Contained_ptr contained = Contained_ptr::dynamicCast(type);
if(contained)
return "const " + contained -> scoped() + "&";
@@ -129,6 +133,10 @@ Slice::outputTypeToString(const Type_ptr& type)
if(proxy)
return proxy -> _class() -> scoped() + "_prx&";
+ Native_ptr native = Native_ptr::dynamicCast(type);
+ if(native)
+ return native -> scoped();
+
Contained_ptr contained = Contained_ptr::dynamicCast(type);
if(contained)
return contained -> scoped() + "&";
@@ -156,6 +164,9 @@ Slice::writeMarshalUnmarshalCode(Output& out, const Type_ptr& type,
return;
}
+ Native_ptr native = Native_ptr::dynamicCast(type);
+ assert(!native); // TODO
+
ClassDecl_ptr cl = ClassDecl_ptr::dynamicCast(type);
if(cl)
{