From 55527152af356fda6037f836c978c2b3a2e2f045 Mon Sep 17 00:00:00 2001 From: Mark Spruiell Date: Tue, 8 Dec 2009 14:10:38 -0800 Subject: - bug 3533: add async version of Connection/Communicator flushBatchRequests operation - Slice file cleanup in C# tests - Updating C++ dependencies --- cpp/src/slice2java/Gen.cpp | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'cpp/src/slice2java/Gen.cpp') diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp index 27d534ce518..0e41c8fd242 100644 --- a/cpp/src/slice2java/Gen.cpp +++ b/cpp/src/slice2java/Gen.cpp @@ -2277,6 +2277,52 @@ Slice::Gen::TypesVisitor::visitClassDefStart(const ClassDefPtr& p) writeThrowsClause(package, throws); } out << ';'; + + // + // Generate asynchronous API for local operations marked with XXX metadata. + // + if(p->hasMetaData("async") || op->hasMetaData("async")) + { + vector inParams = getInOutParams(op, package, InParam); + + out << sp; + writeDocCommentAMI(out, op, InParam); + out << nl; + if(!p->isInterface()) + { + out << "public abstract "; + } + out << "Ice.AsyncResult begin_" << opname << spar << inParams << epar << ';'; + + out << sp; + writeDocCommentAMI(out, op, InParam); + out << nl; + if(!p->isInterface()) + { + out << "public abstract "; + } + out << "Ice.AsyncResult begin_" << opname << spar << inParams << "Ice.Callback __cb" << epar << ';'; + + out << sp; + writeDocCommentAMI(out, op, InParam); + out << nl; + if(!p->isInterface()) + { + out << "public abstract "; + } + string cb = "Callback_" + name + "_" + opname + " __cb"; + out << "Ice.AsyncResult begin_" << opname << spar << inParams << cb << epar << ';'; + + vector outParams = getInOutParams(op, package, OutParam); + out << sp; + writeDocCommentAMI(out, op, OutParam); + out << nl; + if(!p->isInterface()) + { + out << "public abstract "; + } + out << retS << " end_" << opname << spar << outParams << "Ice.AsyncResult __result" << epar << ';'; + } } } -- cgit v1.2.3