diff options
Diffstat (limited to 'cppe/src/IceE/Proxy.cpp')
-rw-r--r-- | cppe/src/IceE/Proxy.cpp | 90 |
1 files changed, 52 insertions, 38 deletions
diff --git a/cppe/src/IceE/Proxy.cpp b/cppe/src/IceE/Proxy.cpp index 9ae070e8d79..05de7bbd16b 100644 --- a/cppe/src/IceE/Proxy.cpp +++ b/cppe/src/IceE/Proxy.cpp @@ -18,6 +18,9 @@ #ifdef ICEE_HAS_ROUTER # include <IceE/RouterInfo.h> #endif +#ifdef ICEE_HAS_LOCATOR +# include <IceE/LocatorInfo.h> +#endif using namespace std; using namespace Ice; @@ -503,10 +506,19 @@ IceProxy::Ice::Object::ice_newFacet(const string& newFacet) const return ice_facet(newFacet); } +#ifdef ICEE_HAS_ROUTER + +RouterPrx +IceProxy::Ice::Object::ice_getRouter() const +{ + RouterInfoPtr ri = _reference->getRouterInfo(); + return ri ? ri->getRouter() : RouterPrx(); +} + ObjectPrx -IceProxy::Ice::Object::ice_twoway() const +IceProxy::Ice::Object::ice_router(const RouterPrx& router) const { - ReferencePtr ref = _reference->changeMode(Reference::ModeTwoway); + ReferencePtr ref = _reference->changeRouter(router); if(ref == _reference) { return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); @@ -519,16 +531,21 @@ IceProxy::Ice::Object::ice_twoway() const } } -bool -IceProxy::Ice::Object::ice_isTwoway() const +#endif + +#ifdef ICEE_HAS_LOCATOR + +LocatorPrx +IceProxy::Ice::Object::ice_getLocator() const { - return _reference->getMode() == Reference::ModeTwoway; + LocatorInfoPtr ri = _reference->getLocatorInfo(); + return ri ? ri->getLocator() : LocatorPrx(); } ObjectPrx -IceProxy::Ice::Object::ice_oneway() const +IceProxy::Ice::Object::ice_locator(const LocatorPrx& locator) const { - ReferencePtr ref = _reference->changeMode(Reference::ModeOneway); + ReferencePtr ref = _reference->changeLocator(locator); if(ref == _reference) { return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); @@ -541,78 +558,77 @@ IceProxy::Ice::Object::ice_oneway() const } } -bool -IceProxy::Ice::Object::ice_isOneway() const -{ - return _reference->getMode() == Reference::ModeOneway; -} +#endif -#ifdef ICEE_HAS_BATCH ObjectPrx -IceProxy::Ice::Object::ice_batchOneway() const +IceProxy::Ice::Object::ice_twoway() const { - ReferencePtr ref = _reference->changeMode(Reference::ModeBatchOneway); - if(ref == _reference) + if(_reference->getMode() == Reference::ModeTwoway) { return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); } else { ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(ref); + proxy->setup(_reference->changeMode(Reference::ModeTwoway)); return proxy; } } bool -IceProxy::Ice::Object::ice_isBatchOneway() const +IceProxy::Ice::Object::ice_isTwoway() const { - return _reference->getMode() == Reference::ModeBatchOneway; + return _reference->getMode() == Reference::ModeTwoway; } -#endif ObjectPrx -IceProxy::Ice::Object::ice_timeout(int t) const +IceProxy::Ice::Object::ice_oneway() const { - ReferencePtr ref = _reference->changeTimeout(t); - if(ref == _reference) + if(_reference->getMode() == Reference::ModeOneway) { return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); } else { ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(ref); + proxy->setup(_reference->changeMode(Reference::ModeOneway)); return proxy; } } -#ifdef ICEE_HAS_ROUTER +bool +IceProxy::Ice::Object::ice_isOneway() const +{ + return _reference->getMode() == Reference::ModeOneway; +} +#ifdef ICEE_HAS_BATCH ObjectPrx -IceProxy::Ice::Object::ice_router(const RouterPrx& router) const +IceProxy::Ice::Object::ice_batchOneway() const { - ReferencePtr ref = _reference->changeRouter(router); - if(ref == _reference) + if(_reference->getMode() == Reference::ModeBatchOneway) { return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); } else { ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(ref); + proxy->setup(_reference->changeMode(Reference::ModeBatchOneway)); return proxy; } } +bool +IceProxy::Ice::Object::ice_isBatchOneway() const +{ + return _reference->getMode() == Reference::ModeBatchOneway; +} #endif -#ifdef ICEE_HAS_LOCATOR - ObjectPrx -IceProxy::Ice::Object::ice_locator(const LocatorPrx& locator) const +IceProxy::Ice::Object::ice_timeout(int t) const { - ReferencePtr ref = _reference->changeLocator(locator); + ReferencePtr ref = _reference->changeTimeout(t); if(ref == _reference) { return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); @@ -625,8 +641,6 @@ IceProxy::Ice::Object::ice_locator(const LocatorPrx& locator) const } } -#endif - ConnectionPtr IceProxy::Ice::Object::ice_connection() { @@ -642,10 +656,10 @@ IceProxy::Ice::Object::ice_connection() // object. // #ifdef ICEE_HAS_ROUTER - RoutableReferencePtr rr = RoutableReferencePtr::dynamicCast(_reference); - if(rr && rr->getRouterInfo()) + RouterInfoPtr ri = _reference->getRouterInfo(); + if(ri) { - rr->getRouterInfo()->addProxy(this); + ri->addProxy(this); } #endif } |