diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2005-07-05 13:19:22 +0000 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2005-07-05 13:19:22 +0000 |
commit | f2240c4965b5ee019bdad39c8d6a5ddb155296a1 (patch) | |
tree | b269e25f67ee675c4dea87512b3ac79c4b0a6c3a /cpp/src | |
parent | Removed use of Ice::Context (diff) | |
download | ice-f2240c4965b5ee019bdad39c8d6a5ddb155296a1.tar.bz2 ice-f2240c4965b5ee019bdad39c8d6a5ddb155296a1.tar.xz ice-f2240c4965b5ee019bdad39c8d6a5ddb155296a1.zip |
Do not add ICEE_PURE_CLIENT around local interface definitions
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/slice2cppe/Gen.cpp | 102 | ||||
-rw-r--r-- | cpp/src/slice2cppe/Gen.h | 28 | ||||
-rw-r--r-- | cpp/src/slice2cppe/Main.cpp | 2 |
3 files changed, 53 insertions, 79 deletions
diff --git a/cpp/src/slice2cppe/Gen.cpp b/cpp/src/slice2cppe/Gen.cpp index 6e1714846ed..b7ef56f7f29 100644 --- a/cpp/src/slice2cppe/Gen.cpp +++ b/cpp/src/slice2cppe/Gen.cpp @@ -43,15 +43,14 @@ getIds(const ClassDefPtr& p, StringList& ids) Slice::Gen::Gen(const string& name, const string& base, const string& headerExtension, const string& sourceExtension, const string& include, const vector<string>& includePaths, - const string& dllExport, const string& dir, bool imp, bool ice) : + const string& dllExport, const string& dir, bool imp) : _base(base), _headerExtension(headerExtension), _sourceExtension(sourceExtension), _include(include), _includePaths(includePaths), _dllExport(dllExport), - _impl(imp), - _ice(ice) + _impl(imp) { for(vector<string>::iterator p = _includePaths.begin(); p != _includePaths.end(); ++p) { @@ -196,7 +195,9 @@ Slice::Gen::generate(const UnitPtr& p) H << "\n#include <IceE/LocalObjectF.h>"; H << "\n#include <IceE/ProxyF.h>"; - H << "\n#include <IceE/ObjectF.h>"; + H << "\n#ifndef ICEE_PURE_CLIENT"; + H << "\n# include <IceE/ObjectF.h>"; + H << "\n#endif"; H << "\n#include <IceE/Exception.h>"; H << "\n#include <IceE/LocalObject.h>"; @@ -207,7 +208,9 @@ Slice::Gen::generate(const UnitPtr& p) if(p->hasNonLocalClassDefs()) { - H << "\n#include <IceE/Object.h>"; + H << "\n#ifndef ICEE_PURE_CLIENT"; + H << "\n# include <IceE/Object.h>"; + H << "\n#endif"; H << "\n#include <IceE/Outgoing.h>"; H << "\n#include <IceE/Incoming.h>"; C << "\n#include <IceE/LocalException.h>"; @@ -252,28 +255,28 @@ Slice::Gen::generate(const UnitPtr& p) _dllExport += " "; } - ProxyDeclVisitor proxyDeclVisitor(H, C, _dllExport, _ice); + ProxyDeclVisitor proxyDeclVisitor(H, C, _dllExport); p->visit(&proxyDeclVisitor, false); - ObjectDeclVisitor objectDeclVisitor(H, C, _dllExport, _ice); + ObjectDeclVisitor objectDeclVisitor(H, C, _dllExport); p->visit(&objectDeclVisitor, false); - IceInternalVisitor iceInternalVisitor(H, C, _dllExport, _ice); + IceInternalVisitor iceInternalVisitor(H, C, _dllExport); p->visit(&iceInternalVisitor, false); - HandleVisitor handleVisitor(H, C, _dllExport, _ice); + HandleVisitor handleVisitor(H, C, _dllExport); p->visit(&handleVisitor, false); - TypesVisitor typesVisitor(H, C, _dllExport, _ice); + TypesVisitor typesVisitor(H, C, _dllExport); p->visit(&typesVisitor, false); - ObjectVisitor objectVisitor(H, C, _dllExport, _ice); + ObjectVisitor objectVisitor(H, C, _dllExport); p->visit(&objectVisitor, false); - ProxyVisitor proxyVisitor(H, C, _dllExport, _ice); + ProxyVisitor proxyVisitor(H, C, _dllExport); p->visit(&proxyVisitor, false); - DelegateVisitor delegateVisitor(H, C, _dllExport, _ice); + DelegateVisitor delegateVisitor(H, C, _dllExport); p->visit(&delegateVisitor, false); if(_impl) @@ -297,8 +300,8 @@ Slice::Gen::generate(const UnitPtr& p) } } -Slice::Gen::TypesVisitor::TypesVisitor(Output& h, Output& c, const string& dllExport, bool ice) : - H(h), C(c), _dllExport(dllExport), _ice(ice) +Slice::Gen::TypesVisitor::TypesVisitor(Output& h, Output& c, const string& dllExport) : + H(h), C(c), _dllExport(dllExport) { } @@ -1005,8 +1008,8 @@ Slice::Gen::TypesVisitor::emitUpcall(const ExceptionPtr& base, const string& cal C.restoreIndent(); } -Slice::Gen::ProxyDeclVisitor::ProxyDeclVisitor(Output& h, Output& c, const string& dllExport, bool ice) : - H(h), C(c), _dllExport(dllExport), _ice(ice) +Slice::Gen::ProxyDeclVisitor::ProxyDeclVisitor(Output& h, Output& c, const string& dllExport) : + H(h), C(c), _dllExport(dllExport) { } @@ -1066,8 +1069,8 @@ Slice::Gen::ProxyDeclVisitor::visitClassDecl(const ClassDeclPtr& p) H << nl << _dllExport << "bool operator<(const " << name << "&, const " << name << "&);"; } -Slice::Gen::ProxyVisitor::ProxyVisitor(Output& h, Output& c, const string& dllExport, bool ice) : - H(h), C(c), _dllExport(dllExport), _ice(ice) +Slice::Gen::ProxyVisitor::ProxyVisitor(Output& h, Output& c, const string& dllExport) : + H(h), C(c), _dllExport(dllExport) { } @@ -1312,8 +1315,8 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) C << eb; } -Slice::Gen::DelegateVisitor::DelegateVisitor(Output& h, Output& c, const string& dllExport, bool ice) : - H(h), C(c), _dllExport(dllExport), _ice(ice) +Slice::Gen::DelegateVisitor::DelegateVisitor(Output& h, Output& c, const string& dllExport) : + H(h), C(c), _dllExport(dllExport) { } @@ -1524,8 +1527,8 @@ Slice::Gen::DelegateVisitor::visitOperation(const OperationPtr& p) C << eb; } -Slice::Gen::ObjectDeclVisitor::ObjectDeclVisitor(Output& h, Output& c, const string& dllExport, bool ice) : - H(h), C(c), _dllExport(dllExport), _ice(ice) +Slice::Gen::ObjectDeclVisitor::ObjectDeclVisitor(Output& h, Output& c, const string& dllExport) : + H(h), C(c), _dllExport(dllExport) { } @@ -1555,7 +1558,7 @@ Slice::Gen::ObjectDeclVisitor::visitClassDecl(const ClassDeclPtr& p) { string name = fixKwd(p->name()); - if(!_ice) + if(!p->isLocal()) { H << sp << nl << "#ifndef ICEE_PURE_CLIENT"; } @@ -1565,14 +1568,14 @@ Slice::Gen::ObjectDeclVisitor::visitClassDecl(const ClassDeclPtr& p) H << nl << _dllExport << "bool operator!=(const " << name << "&, const " << name << "&);"; H << nl << _dllExport << "bool operator<(const " << name << "&, const " << name << "&);"; - if(!_ice) + if(!p->isLocal()) { H << sp << nl << "#endif // ICEE_PURE_CLIENT"; } } -Slice::Gen::ObjectVisitor::ObjectVisitor(Output& h, Output& c, const string& dllExport, bool ice) : - H(h), C(c), _dllExport(dllExport), _ice(ice) +Slice::Gen::ObjectVisitor::ObjectVisitor(Output& h, Output& c, const string& dllExport) : + H(h), C(c), _dllExport(dllExport) { } @@ -1613,7 +1616,7 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p) DataMemberList allDataMembers = p->allDataMembers(); DataMemberList::const_iterator q; - if(!_ice) + if(!p->isLocal()) { H << sp << nl << "#ifndef ICEE_PURE_CLIENT"; } @@ -1878,10 +1881,7 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p) } C << eb << ';'; - if(!_ice) - { - C << sp << nl << "#ifndef ICEE_PURE_CLIENT"; - } + C << sp << nl << "#ifndef ICEE_PURE_CLIENT"; C << sp; C << nl << "bool" << nl << fixKwd(p->scoped()).substr(2) @@ -1911,10 +1911,6 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p) C << nl << "return " << flatName << '[' << scopedPos << "];"; C << eb; } - else if(!_ice) - { - C << sp << nl << "#ifndef ICEE_PURE_CLIENT"; - } return true; } @@ -2009,7 +2005,7 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) H << eb << ';'; - if(!_ice) + if(!p->isLocal()) { H << sp << nl << "#endif // ICEE_PURE_CLIENT"; } @@ -2057,10 +2053,7 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) C << sb; C << nl << "return static_cast<const ::IceE::Object&>(l) < static_cast<const ::IceE::Object&>(r);"; C << eb; - } - if(!_ice) - { C << sp << nl << "#endif // ICEE_PURE_CLIENT"; } } @@ -2268,8 +2261,8 @@ Slice::Gen::ObjectVisitor::emitUpcall(const ClassDefPtr& base, const string& cal C.restoreIndent(); } -Slice::Gen::IceInternalVisitor::IceInternalVisitor(Output& h, Output& c, const string& dllExport, bool ice) : - H(h), C(c), _dllExport(dllExport), _ice(ice) +Slice::Gen::IceInternalVisitor::IceInternalVisitor(Output& h, Output& c, const string& dllExport) : + H(h), C(c), _dllExport(dllExport) { } @@ -2300,7 +2293,7 @@ Slice::Gen::IceInternalVisitor::visitClassDecl(const ClassDeclPtr& p) string scoped = fixKwd(p->scoped()); - if(!_ice) + if(!p->isLocal()) { H << sp << nl << "#ifndef ICEE_PURE_CLIENT"; } @@ -2309,13 +2302,10 @@ Slice::Gen::IceInternalVisitor::visitClassDecl(const ClassDeclPtr& p) H << nl << _dllExport << "void incRef(" << scoped << "*);"; H << nl << _dllExport << "void decRef(" << scoped << "*);"; - if(!_ice) + if(!p->isLocal()) { H << sp << nl << "#endif // ICEE_PURE_CLIENT"; - } - if(!p->isLocal()) - { H << sp; H << nl << _dllExport << "void incRef(::IceEProxy" << scoped << "*);"; H << nl << _dllExport << "void decRef(::IceEProxy" << scoped << "*);"; @@ -2327,7 +2317,7 @@ Slice::Gen::IceInternalVisitor::visitClassDefStart(const ClassDefPtr& p) { string scoped = fixKwd(p->scoped()); - if(!_ice) + if(!p->isLocal()) { C << sp << nl << "#ifndef ICEE_PURE_CLIENT"; } @@ -2344,13 +2334,10 @@ Slice::Gen::IceInternalVisitor::visitClassDefStart(const ClassDefPtr& p) C << nl << "p->__decRef();"; C << eb; - if(!_ice) + if(!p->isLocal()) { C << sp << nl << "#endif // ICEE_PURE_CLIENT"; - } - if(!p->isLocal()) - { C << sp; C << nl << "void" << nl << "IceEInternal::incRef(::IceEProxy" << scoped << "* p)"; C << sb; @@ -2367,8 +2354,8 @@ Slice::Gen::IceInternalVisitor::visitClassDefStart(const ClassDefPtr& p) return true; } -Slice::Gen::HandleVisitor::HandleVisitor(Output& h, Output& c, const string& dllExport, bool ice) : - H(h), C(c), _dllExport(dllExport), _ice(ice) +Slice::Gen::HandleVisitor::HandleVisitor(Output& h, Output& c, const string& dllExport) : + H(h), C(c), _dllExport(dllExport) { } @@ -2401,7 +2388,7 @@ Slice::Gen::HandleVisitor::visitClassDecl(const ClassDeclPtr& p) string name = p->name(); string scoped = fixKwd(p->scoped()); - if(!_ice) + if(!p->isLocal()) { H << sp << nl << "#ifndef ICEE_PURE_CLIENT"; } @@ -2409,13 +2396,10 @@ Slice::Gen::HandleVisitor::visitClassDecl(const ClassDeclPtr& p) H << sp; H << nl << "typedef ::IceEInternal::Handle< " << scoped << "> " << name << "Ptr;"; - if(!_ice) + if(!p->isLocal()) { H << sp << nl << "#endif // ICEE_PURE_CLIENT" << sp; - } - if(!p->isLocal()) - { H << nl << "typedef ::IceEInternal::ProxyHandle< ::IceEProxy" << scoped << "> " << name << "Prx;"; H << sp; diff --git a/cpp/src/slice2cppe/Gen.h b/cpp/src/slice2cppe/Gen.h index 8b20496e282..e3ecaeb5ddf 100644 --- a/cpp/src/slice2cppe/Gen.h +++ b/cpp/src/slice2cppe/Gen.h @@ -28,8 +28,7 @@ public: const std::vector<std::string>&, const std::string&, const std::string&, - bool, - bool); + bool); ~Gen(); bool operator!() const; // Returns true if there was a constructor error @@ -51,13 +50,12 @@ private: std::vector<std::string> _includePaths; std::string _dllExport; bool _impl; - bool _ice; class TypesVisitor : private ::IceUtil::noncopyable, public ParserVisitor { public: - TypesVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&, bool); + TypesVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&); virtual bool visitModuleStart(const ModulePtr&); virtual void visitModuleEnd(const ModulePtr&); @@ -80,14 +78,13 @@ private: ::IceUtil::Output& C; std::string _dllExport; - bool _ice; }; class ProxyDeclVisitor : private ::IceUtil::noncopyable, public ParserVisitor { public: - ProxyDeclVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&, bool); + ProxyDeclVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&); virtual bool visitUnitStart(const UnitPtr&); virtual void visitUnitEnd(const UnitPtr&); @@ -101,14 +98,13 @@ private: ::IceUtil::Output& C; std::string _dllExport; - bool _ice; }; class ProxyVisitor : private ::IceUtil::noncopyable, public ParserVisitor { public: - ProxyVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&, bool); + ProxyVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&); virtual bool visitUnitStart(const UnitPtr&); virtual void visitUnitEnd(const UnitPtr&); @@ -124,14 +120,13 @@ private: ::IceUtil::Output& C; std::string _dllExport; - bool _ice; }; class DelegateVisitor : private ::IceUtil::noncopyable, public ParserVisitor { public: - DelegateVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&, bool); + DelegateVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&); virtual bool visitUnitStart(const UnitPtr&); virtual void visitUnitEnd(const UnitPtr&); @@ -147,14 +142,13 @@ private: ::IceUtil::Output& C; std::string _dllExport; - bool _ice; }; class ObjectDeclVisitor : private ::IceUtil::noncopyable, public ParserVisitor { public: - ObjectDeclVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&, bool); + ObjectDeclVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&); virtual bool visitModuleStart(const ModulePtr&); virtual void visitModuleEnd(const ModulePtr&); @@ -166,14 +160,13 @@ private: ::IceUtil::Output& C; std::string _dllExport; - bool _ice; }; class ObjectVisitor : private ::IceUtil::noncopyable, public ParserVisitor { public: - ObjectVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&, bool); + ObjectVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&); virtual bool visitModuleStart(const ModulePtr&); virtual void visitModuleEnd(const ModulePtr&); @@ -192,14 +185,13 @@ private: ::IceUtil::Output& C; std::string _dllExport; - bool _ice; }; class IceInternalVisitor : private ::IceUtil::noncopyable, public ParserVisitor { public: - IceInternalVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&, bool); + IceInternalVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&); virtual bool visitUnitStart(const UnitPtr&); virtual void visitUnitEnd(const UnitPtr&); @@ -212,14 +204,13 @@ private: ::IceUtil::Output& C; std::string _dllExport; - bool _ice; }; class HandleVisitor : private ::IceUtil::noncopyable, public ParserVisitor { public: - HandleVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&, bool); + HandleVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&); virtual bool visitModuleStart(const ModulePtr&); virtual void visitModuleEnd(const ModulePtr&); @@ -232,7 +223,6 @@ private: ::IceUtil::Output& C; std::string _dllExport; - bool _ice; }; class ImplVisitor : private ::IceUtil::noncopyable, public ParserVisitor diff --git a/cpp/src/slice2cppe/Main.cpp b/cpp/src/slice2cppe/Main.cpp index 1a48d4b7f2f..cb8288dcda9 100644 --- a/cpp/src/slice2cppe/Main.cpp +++ b/cpp/src/slice2cppe/Main.cpp @@ -200,7 +200,7 @@ main(int argc, char* argv[]) else { Gen gen(argv[0], icecpp.getBaseName(), headerExtension, sourceExtension, include, - includePaths, dllExport, output, impl, ice); + includePaths, dllExport, output, impl); if(!gen) { u->destroy(); |