diff options
author | Benoit Foucher <benoit@zeroc.com> | 2015-12-22 18:47:43 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2015-12-22 18:47:43 +0100 |
commit | 453472876e72f76e25132f1f8975829807e31944 (patch) | |
tree | e3275c6b64acc66c2ac00243dbb5ca643ae3bb25 /cpp/src/Ice/ObserverHelper.cpp | |
parent | C++11 cpp:comparable for local classes (diff) | |
download | ice-453472876e72f76e25132f1f8975829807e31944.tar.bz2 ice-453472876e72f76e25132f1f8975829807e31944.tar.xz ice-453472876e72f76e25132f1f8975829807e31944.zip |
Fixed C++98 to get rid of Ice::Context pointers now that we use Ice::noExplicitContext, other minor style fixes
Diffstat (limited to 'cpp/src/Ice/ObserverHelper.cpp')
-rw-r--r-- | cpp/src/Ice/ObserverHelper.cpp | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/cpp/src/Ice/ObserverHelper.cpp b/cpp/src/Ice/ObserverHelper.cpp index 9fe1ed7f520..0538fd48498 100644 --- a/cpp/src/Ice/ObserverHelper.cpp +++ b/cpp/src/Ice/ObserverHelper.cpp @@ -16,29 +16,14 @@ using namespace std; using namespace Ice; using namespace Ice::Instrumentation; -namespace -{ - -Ice::Context emptyCtx; - -} - -IceInternal::InvocationObserver::InvocationObserver(const Ice::ObjectPrxPtr& proxy, const string& op, const Context* ctx) +IceInternal::InvocationObserver::InvocationObserver(const Ice::ObjectPrxPtr& proxy, const string& op, const Context& ctx) { const CommunicatorObserverPtr& obsv = proxy->__reference()->getInstance()->initializationData().observer; if(!obsv) { return; } - - if(ctx) - { - attach(obsv->getInvocationObserver(proxy, op, *ctx)); - } - else - { - attach(obsv->getInvocationObserver(proxy, op, emptyCtx)); - } + attach(obsv->getInvocationObserver(proxy, op, ctx)); } IceInternal::InvocationObserver::InvocationObserver(IceInternal::Instance* instance, const string& op) @@ -49,26 +34,18 @@ IceInternal::InvocationObserver::InvocationObserver(IceInternal::Instance* insta return; } - attach(obsv->getInvocationObserver(0, op, emptyCtx)); + attach(obsv->getInvocationObserver(0, op, noExplicitContext)); } void -IceInternal::InvocationObserver::attach(const Ice::ObjectPrxPtr& proxy, const string& op, const Context* ctx) +IceInternal::InvocationObserver::attach(const Ice::ObjectPrxPtr& proxy, const string& op, const Context& ctx) { const CommunicatorObserverPtr& obsv = proxy->__reference()->getInstance()->initializationData().observer; if(!obsv) { return; } - - if(ctx) - { - attach(obsv->getInvocationObserver(proxy, op, *ctx)); - } - else - { - attach(obsv->getInvocationObserver(proxy, op, emptyCtx)); - } + attach(obsv->getInvocationObserver(proxy, op, ctx)); } void @@ -80,5 +57,5 @@ IceInternal::InvocationObserver::attach(IceInternal::Instance* instance, const s return; } - attach(obsv->getInvocationObserver(0, op, emptyCtx)); + attach(obsv->getInvocationObserver(0, op, Ice::noExplicitContext)); } |