diff options
author | Mark Spruiell <mes@zeroc.com> | 2009-12-08 14:10:38 -0800 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2009-12-08 14:10:38 -0800 |
commit | 55527152af356fda6037f836c978c2b3a2e2f045 (patch) | |
tree | d1872fe6e2d01fa15455a462df090ef94799cb5b /cpp/src/slice2java/Gen.cpp | |
parent | vsplugin fxcop issues (diff) | |
download | ice-55527152af356fda6037f836c978c2b3a2e2f045.tar.bz2 ice-55527152af356fda6037f836c978c2b3a2e2f045.tar.xz ice-55527152af356fda6037f836c978c2b3a2e2f045.zip |
- bug 3533: add async version of Connection/Communicator
flushBatchRequests operation
- Slice file cleanup in C# tests
- Updating C++ dependencies
Diffstat (limited to 'cpp/src/slice2java/Gen.cpp')
-rw-r--r-- | cpp/src/slice2java/Gen.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
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<string> 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<string> 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 << ';'; + } } } |