[asterisk-scf-commits] asterisk-scf/integration/ice-util-cpp.git branch "smart-proxy" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Nov 29 09:02:42 CST 2010


branch "smart-proxy" has been updated
       via  f5e31dfba81ff92cec22ba81e36ff333afd38fa4 (commit)
      from  909b2ff2d9b7796c1533718af692fe3cd2d69e01 (commit)

Summary of changes:
 SmartProxy/src/SmartProxy.h |   16 +++++-----------
 1 files changed, 5 insertions(+), 11 deletions(-)


- Log -----------------------------------------------------------------
commit f5e31dfba81ff92cec22ba81e36ff333afd38fa4
Author: David M. Lee <dlee at digium.com>
Date:   Mon Nov 29 08:54:27 2010 -0600

    Got rid of extra bool to track state.

diff --git a/SmartProxy/src/SmartProxy.h b/SmartProxy/src/SmartProxy.h
index 8e5da1f..dd0d8bb 100644
--- a/SmartProxy/src/SmartProxy.h
+++ b/SmartProxy/src/SmartProxy.h
@@ -44,7 +44,7 @@ template <class P>
 class SmartProxy
 {
 public:
-    SmartProxy() : mServiceLocator(0), mLocatorParams(0), mInitialized(false), mLg(0) {}
+    SmartProxy() : mServiceLocator(0), mLocatorParams(0), mLg(0) {}
 
     SmartProxy(const SmartProxy &rhs)
     {
@@ -54,7 +54,7 @@ public:
     SmartProxy(const AsteriskSCF::Core::Discovery::V1::ServiceLocatorPrx& locator,
         AsteriskSCF::Core::Discovery::V1::ServiceLocatorParamsPtr params,
         AsteriskSCF::System::Logging::Logger const &lg)
-        :  mServiceLocator(locator), mLocatorParams(params), mInitialized(false), mLg(&lg)
+        :  mServiceLocator(locator), mLocatorParams(params), mLg(&lg)
     {
         initialize();
     }
@@ -89,7 +89,7 @@ public:
 
     bool isInitialized()
     {
-        return mInitialized;
+        return mProxy != 0;
     }
 
 private:
@@ -126,10 +126,6 @@ private:
         {
             (*mLg)(Error) << "Unable to locate " << mLocatorParams->category;
         }
-        else
-        {
-            mInitialized = true;
-        }
     }
 
     /**
@@ -137,14 +133,14 @@ private:
      */
     bool verifyInitialized()
     {
-        if (mInitialized)
+        if (isInitialized())
         {
             return true;
         }
 
         // Try again to initialize.
         initialize();
-        return mInitialized;
+        return isInitialized();
     }
 
     void copy(const SmartProxy &rhs)
@@ -153,14 +149,12 @@ private:
         mServiceLocator = rhs.mServiceLocator;
         mLocatorParams = rhs.mLocatorParams;
         mLg = rhs.mLg;
-        mInitialized = rhs.mInitialized;
     }
 
     P mProxy;
     AsteriskSCF::Core::Discovery::V1::ServiceLocatorPrx mServiceLocator;
     AsteriskSCF::Core::Discovery::V1::ServiceLocatorParamsPtr mLocatorParams;
     AsteriskSCF::System::Logging::Logger const *mLg;
-    bool mInitialized;
 };
 
 }; // end SmartProxy

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/ice-util-cpp.git



More information about the asterisk-scf-commits mailing list