summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp/Gen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index b68946529a9..1e9688b7f6f 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -3536,8 +3536,10 @@ Slice::Gen::AsyncImplVisitor::visitOperation(const OperationPtr& p)
H.dec();
H << nl << "public:";
H.inc();
+
H << sp;
H << nl << classNameAMD << '_' << name << "(::IceInternal::Incoming&);";
+
H << sp;
H << nl << "virtual void ice_response(" << params << ");";
H << nl << "virtual void ice_exception(const ::Ice::Exception&);";
@@ -3552,9 +3554,12 @@ Slice::Gen::AsyncImplVisitor::visitOperation(const OperationPtr& p)
C.dec();
C << sb;
C << eb;
+
C << sp << nl << "void" << nl << "::IceAsync" << classScopedAMD << '_' << name << "::ice_response("
<< paramsDecl << ')';
C << sb;
+ C << nl << "if(!_finished)";
+ C << sb;
if(ret || !outParams.empty())
{
C << nl << "try";
@@ -3570,9 +3575,13 @@ Slice::Gen::AsyncImplVisitor::visitOperation(const OperationPtr& p)
}
C << nl << "__response(true);";
C << eb;
+ C << eb;
+
C << sp << nl << "void" << nl << "::IceAsync" << classScopedAMD << '_' << name
<< "::ice_exception(const ::Ice::Exception& ex)";
C << sb;
+ C << nl << "if(!_finished)";
+ C << sb;
if(throws.empty())
{
C << nl << "__exception(ex);";
@@ -3598,15 +3607,24 @@ Slice::Gen::AsyncImplVisitor::visitOperation(const OperationPtr& p)
C << eb;
}
C << eb;
+ C << eb;
+
C << sp << nl << "void" << nl << "::IceAsync" << classScopedAMD << '_' << name
<< "::ice_exception(const ::std::exception& ex)";
C << sb;
+ C << nl << "if(!_finished)";
+ C << sb;
C << nl << "__exception(ex);";
C << eb;
+ C << eb;
+
C << sp << nl << "void" << nl << "::IceAsync" << classScopedAMD << '_' << name
<< "::ice_exception()";
C << sb;
+ C << nl << "if(!_finished)";
+ C << sb;
C << nl << "__exception();";
C << eb;
+ C << eb;
}
}