[asterisk-scf-commits] asterisk-scf/release/ice-util-cpp.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Fri Dec 3 14:07:09 CST 2010


branch "master" has been updated
       via  91df85017b172327c9464474c5a2224f0927c526 (commit)
      from  6c28b354ea95d1722f3643320a3d4054913844fb (commit)

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


- Log -----------------------------------------------------------------
commit 91df85017b172327c9464474c5a2224f0927c526
Author: David M. Lee <dlee at digium.com>
Date:   Fri Dec 3 14:05:40 2010 -0600

    Make initializeOnce public.
    
    There are cases where the user of the SmartProxy may want to try to
    safely initialize the proxy, without the ugliness of wrapping the
    operator-> call with a try {} catch block.

diff --git a/SmartProxy/src/SmartProxy.h b/SmartProxy/src/SmartProxy.h
index e0443c9..e7b6bc9 100644
--- a/SmartProxy/src/SmartProxy.h
+++ b/SmartProxy/src/SmartProxy.h
@@ -105,6 +105,25 @@ public:
         return mProxy != 0;
     }
 
+    /**
+     * Initializes this SmartProxy, but only if it hasn't already been
+     * initialized.
+     *
+     * @return True if initialization successful; false if unsuccessful.
+     */
+    bool initializeOnce()
+    {
+        // isInitialized() and initialize() are thread safe.  no need to lock
+        if (isInitialized())
+        {
+            return true;
+        }
+
+        // Try again to initialize.
+        initialize();
+        return isInitialized();
+    }
+
 private:
     /**
      * Initialization. Primarily involves acquring access to specific IceStorm
@@ -157,25 +176,6 @@ private:
         }
     }
 
-    /**
-     * Initializes this SmartProxy, but only if it hasn't already been
-     * initialized.
-     *
-     * @return True if initialization successful; false if unsuccessful.
-     */
-    bool initializeOnce()
-    {
-        // isInitialized() and initialize() are thread safe.  no need to lock
-        if (isInitialized())
-        {
-            return true;
-        }
-
-        // Try again to initialize.
-        initialize();
-        return isInitialized();
-    }
-
     void copy(const SmartProxy &rhs)
     {
         // thread safe

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


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



More information about the asterisk-scf-commits mailing list