diff options
author | Jose <jose@zeroc.com> | 2017-01-27 19:12:46 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2017-01-27 19:12:46 +0100 |
commit | 5a5f5676a2d4af74d213eb7835a5613538b49a7c (patch) | |
tree | cebb4145ada0c5b155df01ca9ebcd09f8d41b967 /cpp/src/slice2cs/Gen.cpp | |
parent | Fixed Python controller dispatch interfaces (diff) | |
download | ice-5a5f5676a2d4af74d213eb7835a5613538b49a7c.tar.bz2 ice-5a5f5676a2d4af74d213eb7835a5613538b49a7c.tar.xz ice-5a5f5676a2d4af74d213eb7835a5613538b49a7c.zip |
CSharp do not generate proxy for class without operations
Diffstat (limited to 'cpp/src/slice2cs/Gen.cpp')
-rw-r--r-- | cpp/src/slice2cs/Gen.cpp | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp index 83ba89df350..0008249211a 100644 --- a/cpp/src/slice2cs/Gen.cpp +++ b/cpp/src/slice2cs/Gen.cpp @@ -3951,7 +3951,7 @@ Slice::Gen::ProxyVisitor::visitModuleEnd(const ModulePtr&) bool Slice::Gen::ProxyVisitor::visitClassDefStart(const ClassDefPtr& p) { - if(p->isLocal()) + if(p->isLocal() || (!p->isInterface() && p->allOperations().size() == 0)) { return false; } @@ -3963,20 +3963,28 @@ Slice::Gen::ProxyVisitor::visitClassDefStart(const ClassDefPtr& p) writeDocComment(p, getDeprecateReason(p, 0, p->isInterface() ? "interface" : "class")); emitGeneratedCodeAttribute(); _out << nl << "public interface " << name << "Prx : "; - if(bases.empty()) + + vector<string> baseInterfaces; + for(ClassList::const_iterator q = bases.begin(); q != bases.end(); ++q) { - _out << "Ice.ObjectPrx"; + ClassDefPtr def = *q; + if(def->isInterface() || def->allOperations().size() > 0) + { + baseInterfaces.push_back(fixId((*q)->scoped() + "Prx")); + } } - else + + if(baseInterfaces.empty()) { - ClassList::const_iterator q = bases.begin(); - while(q != bases.end()) + baseInterfaces.push_back("Ice.ObjectPrx"); + } + + for(vector<string>::const_iterator q = baseInterfaces.begin(); q != baseInterfaces.end();) + { + _out << *q; + if(++q != baseInterfaces.end()) { - _out << fixId((*q)->scoped() + "Prx"); - if(++q != bases.end()) - { - _out << ", "; - } + _out << ", "; } } _out << sb; @@ -4286,7 +4294,7 @@ Slice::Gen::HelperVisitor::visitModuleEnd(const ModulePtr&) bool Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) { - if(p->isLocal()) + if(p->isLocal() || (!p->isInterface() && p->allOperations().size() == 0)) { return false; } @@ -5540,7 +5548,7 @@ Slice::Gen::ImplVisitor::visitModuleEnd(const ModulePtr&) bool Slice::Gen::ImplVisitor::visitClassDefStart(const ClassDefPtr& p) { - if(!p->isAbstract()) + if(p->allOperations().size() == 0) { return false; } |