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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue May 8 11:08:22 CDT 2012


branch "retry_deux" has been updated
       via  c403b62fa830396ec3093b9fcd13b9fd01cf0d8e (commit)
       via  d26c2fcbfac7f06a28c2c733cdf9b5fca2149290 (commit)
      from  3568870f0cd6ef05b817a378575a091495e7d002 (commit)

Summary of changes:
 src/Operations/OperationContext.cpp |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)


- Log -----------------------------------------------------------------
commit c403b62fa830396ec3093b9fcd13b9fd01cf0d8e
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Tue May 8 11:07:59 2012 -0500

    Corrected boost version comment.

diff --git a/src/Operations/OperationContext.cpp b/src/Operations/OperationContext.cpp
index f0685e9..4c4ce8a 100755
--- a/src/Operations/OperationContext.cpp
+++ b/src/Operations/OperationContext.cpp
@@ -42,7 +42,7 @@ std::string getUuid()
     }
     boost::uuids::uuid u = (*gen)();
 
-// BOOST 1.4.4 added a to_string() function which is faster than lexical_cast.
+// BOOST 1.44 added a to_string() function which is faster than lexical_cast.
 #if ((BOOST_VERSION / 100) >= 1044)
     return boost::uuids::to_string(u);
 #else

commit d26c2fcbfac7f06a28c2c733cdf9b5fca2149290
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Tue May 8 11:06:51 2012 -0500

    uuid conversion to string based on boost version number.

diff --git a/src/Operations/OperationContext.cpp b/src/Operations/OperationContext.cpp
index dbb369b..f0685e9 100755
--- a/src/Operations/OperationContext.cpp
+++ b/src/Operations/OperationContext.cpp
@@ -14,6 +14,8 @@
  * at the top of the source tree.
  */
 #include <boost/thread.hpp>
+#include <boost/version.hpp>
+#include <boost/lexical_cast.hpp>
 #include <boost/uuid/uuid.hpp>
 #include <boost/uuid/uuid_generators.hpp>
 #include <boost/uuid/uuid_io.hpp>
@@ -40,7 +42,12 @@ std::string getUuid()
     }
     boost::uuids::uuid u = (*gen)();
 
+// BOOST 1.4.4 added a to_string() function which is faster than lexical_cast.
+#if ((BOOST_VERSION / 100) >= 1044)
     return boost::uuids::to_string(u);
+#else
+    return boost::lexical_cast<std::string>(u);
+#endif
 }
 
 /**
@@ -49,6 +56,7 @@ std::string getUuid()
 OperationContextPtr createContext()
 {
     AsteriskSCF::System::V1::OperationContextPtr newContext(new AsteriskSCF::System::V1::OperationContext);
+
     newContext->id = getUuid();
 
     // To make it easy to identify the "source" operation id, we set the transaction id to the 
@@ -64,6 +72,7 @@ OperationContextPtr createContext()
 OperationContextPtr createContext(const OperationContextPtr& operationContext)
 {
     AsteriskSCF::System::V1::OperationContextPtr newContext(new AsteriskSCF::System::V1::OperationContext);
+
     newContext->id = getUuid();
     newContext->transactionId = operationContext->transactionId;
     return newContext;
@@ -74,10 +83,8 @@ OperationContextPtr calculateOperationContext(
     const std::string& modifier)
 {
     std::string calculateId = sourceContext->id + "." + modifier;
-    OperationContextPtr result = OperationContextPtr::dynamicCast(
-        sourceContext->ice_clone());
-    result->id = calculateId;
-    return result; 
+    
+    return new OperationContext(calculateId, sourceContext->transactionId);
 }
 
 } // End namespace Operations

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


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



More information about the asterisk-scf-commits mailing list