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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed Jul 20 10:09:50 CDT 2011


branch "basecomponent" has been updated
       via  451718b80f8f3776f9bb1cfc1a2b4a3820665aa0 (commit)
       via  3ebc962f8239df58e386987450c3616999256f7b (commit)
      from  d1f0359e49ca1da0466886b027452960bf1f233b (commit)

Summary of changes:
 include/AsteriskSCF/Component/Component.h   |   13 ++++++++++---
 include/AsteriskSCF/Component/TestContext.h |    2 +-
 src/Component/Component.cpp                 |   14 ++++++++++++--
 3 files changed, 23 insertions(+), 6 deletions(-)


- Log -----------------------------------------------------------------
commit 451718b80f8f3776f9bb1cfc1a2b4a3820665aa0
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Wed Jul 20 10:05:22 2011 -0500

    Fix exception class def problem not spotted by VS.

diff --git a/include/AsteriskSCF/Component/TestContext.h b/include/AsteriskSCF/Component/TestContext.h
index 97331a5..edee77b 100644
--- a/include/AsteriskSCF/Component/TestContext.h
+++ b/include/AsteriskSCF/Component/TestContext.h
@@ -31,7 +31,7 @@ public:
         mMsg = "Invalid Test Mode. Mode " + mode + " is not set.";
     }
 
-    ~InvalidTestMode() throw();
+    ~InvalidTestMode() throw() {};
 
     virtual const char* what() const throw()
     {

commit 3ebc962f8239df58e386987450c3616999256f7b
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Wed Jul 20 09:53:16 2011 -0500

    Simplify an interface for most common usage.

diff --git a/include/AsteriskSCF/Component/Component.h b/include/AsteriskSCF/Component/Component.h
index e243d4b..8c7da34 100644
--- a/include/AsteriskSCF/Component/Component.h
+++ b/include/AsteriskSCF/Component/Component.h
@@ -211,14 +211,21 @@ protected:
     void manageBackplaneService(const AsteriskSCF::Discovery::LocatorRegistrationWrapperPtr& service);
     
     /** 
-     * Helper that wraps a service for registration by making some assumptions that
-     * are probably correct for most cases. 
+     * Helper that wraps a service for registration. 
      */
     AsteriskSCF::Discovery::LocatorRegistrationWrapperPtr 
         wrapServiceForRegistration(const Ice::ObjectPrx& proxy, 
                                    const std::string& category,
                                    const std::string& service,
-                                   const std::string& id = "");
+                                   const std::string& id) const;
+
+    /**
+     * Overload that uses the <adapterName>.ServiceName and <adapterName> as 
+     * the values for the service and id. 
+     */
+    AsteriskSCF::Discovery::LocatorRegistrationWrapperPtr
+        wrapServiceForRegistration(const Ice::ObjectPrx& proxy, 
+                 const std::string& category) const;
 
     /**
      * The derived component is expected to wrap each 
diff --git a/src/Component/Component.cpp b/src/Component/Component.cpp
index d75e82d..9ba65d1 100644
--- a/src/Component/Component.cpp
+++ b/src/Component/Component.cpp
@@ -304,7 +304,7 @@ void Component::standby()
 LocatorRegistrationWrapperPtr Component::wrapServiceForRegistration(const Ice::ObjectPrx& proxy, 
                  const string& category,
                  const string& service,
-                 const string& id)
+                 const string& id) const
 {
     string guid = mName + "." + category;
 
@@ -312,7 +312,7 @@ LocatorRegistrationWrapperPtr Component::wrapServiceForRegistration(const Ice::O
     ServiceLocatorParamsPtr params = new ServiceLocatorParams;
     params->category = category;
     params->service = service;
-    params->id = getName(); 
+    params->id = id; 
 
     LocatorRegistrationWrapperPtr wrapper = 
             new LocatorRegistrationWrapper(mCommunicator, getServiceLocatorManagementProperty(), proxy, 
@@ -321,6 +321,16 @@ LocatorRegistrationWrapperPtr Component::wrapServiceForRegistration(const Ice::O
     return wrapper;
 }
 
+/** 
+ * Overload for most common case.
+ */
+LocatorRegistrationWrapperPtr Component::wrapServiceForRegistration(const Ice::ObjectPrx& proxy, 
+                 const string& category) const
+{
+    return wrapServiceForRegistration(proxy, category, mServiceName, mName);
+}
+
+
 /**
  * In the required override of registerPrimaryServices(), this operation should
  * be called for each primary interface registered with the service locator.

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


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



More information about the asterisk-scf-commits mailing list