diff options
author | Michi Henning <michi@zeroc.com> | 2002-10-08 04:11:04 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2002-10-08 04:11:04 +0000 |
commit | 4c149416a4694ab04580b469239676c348381469 (patch) | |
tree | 39be0c373f6ce22c4b6cf74e601924381768747a /cpp/src/slice2cpp/Gen.cpp | |
parent | use import paths when loading schemas (diff) | |
download | ice-4c149416a4694ab04580b469239676c348381469.tar.bz2 ice-4c149416a4694ab04580b469239676c348381469.tar.xz ice-4c149416a4694ab04580b469239676c348381469.zip |
Changed C++ code generator to generate a Prx for a class only if that class
has (or inherits) operations.
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index f2e32296300..86d37fd5756 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -2425,7 +2425,7 @@ Slice::Gen::IceInternalVisitor::visitClassDefStart(const ClassDefPtr& p) C << nl << "p->__decRef();"; C << eb; - if(!p->isLocal()) + if(!p->isLocal() && (p->isInterface() || p->allOperations().size() != 0)) { C << sp; C << nl << "void" << nl << "IceInternal::incRef(::IceProxy" << scoped << "* p)"; @@ -2548,24 +2548,27 @@ Slice::Gen::HandleVisitor::visitClassDecl(const ClassDeclPtr& p) H << nl << "typedef ::IceInternal::Handle< " << scoped << "> " << name << "Ptr;"; if(!p->isLocal()) { - H << nl << "typedef ::IceInternal::ProxyHandle< ::IceProxy" << scoped << "> " << name << "Prx;"; + if(p->isInterface() || (p->definition() && p->definition()->allOperations().size() != 0)) + { + H << nl << "typedef ::IceInternal::ProxyHandle< ::IceProxy" << scoped << "> " << name << "Prx;"; - H << sp; - H << nl << _dllExport << "void __write(::IceInternal::BasicStream*, const " << name << "Prx&);"; - H << nl << _dllExport << "void __read(::IceInternal::BasicStream*, " << name << "Prx&);"; + H << sp; + H << nl << _dllExport << "void __write(::IceInternal::BasicStream*, const " << name << "Prx&);"; + H << nl << _dllExport << "void __read(::IceInternal::BasicStream*, " << name << "Prx&);"; - H << sp; - H << nl << _dllExport << "void ice_marshal(const ::std::string&, const ::Ice::StreamPtr&, const " - << name << "Prx&);"; - H << nl << _dllExport << "void ice_unmarshal(const ::std::string&, const ::Ice::StreamPtr&, " - << name << "Prx&);"; + H << sp; + H << nl << _dllExport << "void ice_marshal(const ::std::string&, const ::Ice::StreamPtr&, const " + << name << "Prx&);"; + H << nl << _dllExport << "void ice_unmarshal(const ::std::string&, const ::Ice::StreamPtr&, " + << name << "Prx&);"; + } } } bool Slice::Gen::HandleVisitor::visitClassDefStart(const ClassDefPtr& p) { - if(!p->isLocal()) + if(!p->isLocal() && (p->isInterface() || p->allOperations().size()) != 0) { string scoped = fixKwd(p->scoped()); string scope = fixKwd(p->scope()); |