summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rwxr-xr-xcpp/src/slice2cs/Gen.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp
index 64565233035..b189e6b0f12 100755
--- a/cpp/src/slice2cs/Gen.cpp
+++ b/cpp/src/slice2cs/Gen.cpp
@@ -2708,10 +2708,30 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p)
_out << eb;
}
+ bool hasAsyncOps = false;
+
if(!ops.empty())
{
_out << sp << nl << "#endregion"; // Synchronous operations
+ if(p->hasMetaData("ami"))
+ {
+ hasAsyncOps = true;
+ }
+ else
+ {
+ for(r = ops.begin(); r != ops.end(); ++r)
+ {
+ if((*r)->hasMetaData("ami"))
+ {
+ hasAsyncOps = true;
+ }
+ }
+ }
+ }
+
+ if(hasAsyncOps)
+ {
_out << sp << nl << "#region Asynchronous operations";
}
@@ -2744,7 +2764,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p)
}
}
- if(!ops.empty())
+ if(hasAsyncOps)
{
_out << sp << nl << "#endregion"; // Asynchronous operations
}
@@ -3455,8 +3475,7 @@ Slice::Gen::DispatcherVisitor::visitClassDefStart(const ClassDefPtr& p)
}
_out << sp << nl << "public " << typeToString(ret) << " " << name << spar << params << epar;
- _out << sb;
- _out << nl;
+ _out << sb << nl;
if(ret)
{
_out << "return ";