diff options
author | Marc Laukien <marc@zeroc.com> | 2002-07-17 20:59:55 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2002-07-17 20:59:55 +0000 |
commit | bf7cafb2217ef078c090361095c55bede810f309 (patch) | |
tree | 5aa37468086623f742c02f9c25725de5298c08b3 /cpp/src/slice2cpp/Gen.cpp | |
parent | facet path (diff) | |
download | ice-bf7cafb2217ef078c090361095c55bede810f309.tar.bz2 ice-bf7cafb2217ef078c090361095c55bede810f309.tar.xz ice-bf7cafb2217ef078c090361095c55bede810f309.zip |
facet path
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index bc506fa2cbf..611ced9f818 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -2460,8 +2460,12 @@ Slice::Gen::IceInternalVisitor::visitClassDecl(const ClassDeclPtr& p) H << nl << _dllExport << "void decRef(::IceProxy" << scoped << "*);"; H << sp; + H << nl << _dllExport << "void checkedCast(const ::Ice::ObjectPrx&, " + << "ProxyHandle< ::IceProxy" << scoped << ">&);"; H << nl << _dllExport << "void checkedCast(const ::Ice::ObjectPrx&, const ::std::string&, " << "ProxyHandle< ::IceProxy" << scoped << ">&);"; + H << nl << _dllExport << "void uncheckedCast(const ::Ice::ObjectPrx&, " + << "ProxyHandle< ::IceProxy" << scoped << ">&);"; H << nl << _dllExport << "void uncheckedCast(const ::Ice::ObjectPrx&, const ::std::string&, " << "ProxyHandle< ::IceProxy" << scoped << ">&);"; } @@ -2500,14 +2504,12 @@ Slice::Gen::IceInternalVisitor::visitClassDefStart(const ClassDefPtr& p) C << eb; C << sp; - C << nl << "void" << nl << "IceInternal::checkedCast(const ::Ice::ObjectPrx& b, const ::std::string& f, " + C << nl << "void" << nl << "IceInternal::checkedCast(const ::Ice::ObjectPrx& b, " << scoped << "Prx& d)"; C << sb; C << nl << "d = 0;"; C << nl << "if(b)"; C << sb; - C << nl << "if(f == b->ice_getFacet())"; - C << sb; C << nl << "d = dynamic_cast< ::IceProxy" << scoped << "*>(b.get());"; C << nl << "if(!d && b->ice_isA(\"" << p->scoped() << "\"))"; C << sb; @@ -2515,9 +2517,16 @@ Slice::Gen::IceInternalVisitor::visitClassDefStart(const ClassDefPtr& p) C << nl << "d->__copyFrom(b);"; C << eb; C << eb; - C << nl << "else"; + C << eb; + + C << sp; + C << nl << "void" << nl << "IceInternal::checkedCast(const ::Ice::ObjectPrx& b, const ::std::string& f, " + << scoped << "Prx& d)"; + C << sb; + C << nl << "d = 0;"; + C << nl << "if(b)"; C << sb; - C << nl << "::Ice::ObjectPrx bb = b->ice_newFacet(f);"; + C << nl << "::Ice::ObjectPrx bb = b->ice_appendFacet(f);"; C << nl << "try"; C << sb; C << nl << "if(bb->ice_isA(\"" << p->scoped() << "\"))"; @@ -2531,17 +2540,14 @@ Slice::Gen::IceInternalVisitor::visitClassDefStart(const ClassDefPtr& p) C << eb; C << eb; C << eb; - C << eb; C << sp; - C << nl << "void" << nl << "IceInternal::uncheckedCast(const ::Ice::ObjectPrx& b, const ::std::string& f, " + C << nl << "void" << nl << "IceInternal::uncheckedCast(const ::Ice::ObjectPrx& b, " << scoped << "Prx& d)"; C << sb; C << nl << "d = 0;"; C << nl << "if(b)"; C << sb; - C << nl << "if(f == b->ice_getFacet())"; - C << sb; C << nl << "d = dynamic_cast< ::IceProxy" << scoped << "*>(b.get());"; C << nl << "if(!d)"; C << sb; @@ -2549,14 +2555,20 @@ Slice::Gen::IceInternalVisitor::visitClassDefStart(const ClassDefPtr& p) C << nl << "d->__copyFrom(b);"; C << eb; C << eb; - C << nl << "else"; + C << eb; + + C << sp; + C << nl << "void" << nl << "IceInternal::uncheckedCast(const ::Ice::ObjectPrx& b, const ::std::string& f, " + << scoped << "Prx& d)"; + C << sb; + C << nl << "d = 0;"; + C << nl << "if(b)"; C << sb; - C << nl << "::Ice::ObjectPrx bb = b->ice_newFacet(f);"; + C << nl << "::Ice::ObjectPrx bb = b->ice_appendFacet(f);"; C << nl << "d = new ::IceProxy" << scoped << ";"; C << nl << "d->__copyFrom(bb);"; C << eb; C << eb; - C << eb; } return true; |