[asterisk-scf-commits] asterisk-scf/integration/routing.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue Sep 7 17:08:11 CDT 2010


branch "master" has been updated
       via  fb747a4153dcb4f0a83e9a7b0a057f21c5504f53 (commit)
      from  181d1a733eb24492f2071e8277923d92be7be1fc (commit)

Summary of changes:
 src/BasicRoutingServiceApp.cpp       |   14 +++++++-------
 src/BasicRoutingServiceDataModel.h   |    4 ++--
 src/CMakeLists.txt                   |    2 ++
 src/EndpointRegistry.cpp             |   12 ++++++------
 src/EndpointRegistry.h               |   14 +++++++-------
 src/LuaScriptProcessor.cpp           |    6 +++---
 src/LuaScriptProcessor.h             |    4 ++--
 src/RoutingAdmin.cpp                 |    6 +++---
 src/RoutingAdmin.h                   |    6 +++---
 src/RoutingServiceEventPublisher.cpp |   18 +++++++++---------
 src/RoutingServiceEventPublisher.h   |   16 ++++++++--------
 src/ScriptProcessor.h                |    4 ++--
 test/TestRouting.cpp                 |   32 +++++++++++++++++++++-----------
 13 files changed, 75 insertions(+), 63 deletions(-)


- Log -----------------------------------------------------------------
commit fb747a4153dcb4f0a83e9a7b0a057f21c5504f53
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Tue Sep 7 17:06:51 2010 -0500

    Mods to get code to compile with new slice defs.

diff --git a/src/BasicRoutingServiceApp.cpp b/src/BasicRoutingServiceApp.cpp
index c4a7356..09d186a 100644
--- a/src/BasicRoutingServiceApp.cpp
+++ b/src/BasicRoutingServiceApp.cpp
@@ -14,13 +14,13 @@
 #include "RoutingAdmin.h"
 
 using namespace std;
-using namespace Hydra::BasicRoutingService;
-using namespace Hydra::Core;
-using namespace Hydra::Core::Routing::V1;
-using namespace Hydra::Core::Discovery::V1;
-using namespace Hydra::System::Component::V1;
+using namespace AsteriskSCF::BasicRoutingService;
+using namespace AsteriskSCF::Core;
+using namespace AsteriskSCF::Core::Routing::V1;
+using namespace AsteriskSCF::Core::Discovery::V1;
+using namespace AsteriskSCF::System::Component::V1;
 
-namespace Hydra
+namespace AsteriskSCF
 {
 namespace BasicRoutingService
 {
@@ -306,7 +306,7 @@ int BasicRoutingServiceApp::run(int argc, char* argv[])
 }
 
 }; // end BasicRoutingService
-}; // end Hydra
+}; // end AsteriskSCF
 
 static BasicRoutingServiceApp app;
 // Application entry point. 
diff --git a/src/BasicRoutingServiceDataModel.h b/src/BasicRoutingServiceDataModel.h
index dc0eca4..5622890 100644
--- a/src/BasicRoutingServiceDataModel.h
+++ b/src/BasicRoutingServiceDataModel.h
@@ -2,7 +2,7 @@
 
 #include <Ice/Ice.h>
 
-namespace Hydra
+namespace AsteriskSCF
 {
 namespace BasicRoutingService
 {
@@ -27,5 +27,5 @@ protected:
 };
 
 }; // BasicRoutingService
-}; // Hydra
+}; // AsteriskSCF
 
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0204a70..1d5ddbc 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -5,6 +5,8 @@ include_directories(${LUA_INCLUDE_DIR})
 hydra_component_add_slice(BasicRoutingService RoutingIf)
 hydra_component_add_slice(BasicRoutingService ServiceLocatorIf)
 hydra_component_add_slice(BasicRoutingService EndpointIf)
+hydra_component_add_slice(BasicRoutingService SessionCommunicationsIf)
+hydra_component_add_slice(BasicRoutingService BridgingIf)
 hydra_component_add_slice(BasicRoutingService ComponentServiceIf)
 hydra_component_add_file(BasicRoutingService BasicRoutingServiceApp.cpp)
 hydra_component_add_file(BasicRoutingService BasicRoutingServiceDataModel.h)
diff --git a/src/EndpointRegistry.cpp b/src/EndpointRegistry.cpp
index 69ec646..8abdf99 100644
--- a/src/EndpointRegistry.cpp
+++ b/src/EndpointRegistry.cpp
@@ -5,10 +5,10 @@
 #include "EndpointRegistry.h"
 #include "ScriptProcessor.h"
 
-using namespace ::Hydra::Core::Routing::V1;
+using namespace ::AsteriskSCF::Core::Routing::V1;
 using namespace ::std;
 
-namespace Hydra
+namespace AsteriskSCF
 {
 namespace BasicRoutingService
 {
@@ -124,7 +124,7 @@ void EndpointRegistry::removeEndpointLocator(const ::std::string& locatorId, con
  *     set of regular expressions completely replaces the current set. 
  */
 void EndpointRegistry::setEndpointLocatorDestinationIds(const ::std::string& locatorId, 
-                                                        const ::Hydra::Core::Routing::V1::RegExSeq& regExList, 
+                                                        const ::AsteriskSCF::Core::Routing::V1::RegExSeq& regExList, 
                                                         const ::Ice::Current&)
 {
    try
@@ -155,9 +155,9 @@ void EndpointRegistry::setEndpointLocatorDestinationIds(const ::std::string& loc
  * Returns the endpoints that match the specified destination id. 
  *   @param id String identifier of the the destination. 
  */
-::Hydra::Core::Endpoint::V1::EndpointSeq EndpointRegistry::lookup(const ::std::string& destination, const ::Ice::Current&)
+::AsteriskSCF::Core::Endpoint::V1::EndpointSeq EndpointRegistry::lookup(const ::std::string& destination, const ::Ice::Current&)
 {
-   ::Hydra::Core::Endpoint::V1::EndpointSeq endpoints;
+   ::AsteriskSCF::Core::Endpoint::V1::EndpointSeq endpoints;
 
    string modifiedDestination;
    if (!mImpl->mScriptProcessor->confirmLookup(destination, modifiedDestination))
@@ -231,5 +231,5 @@ void EndpointRegistry::setPolicy(::std::string policy)
 }
 
 }; // end BasicRoutingService
-}; // end Hydra
+}; // end AsteriskSCF
 
diff --git a/src/EndpointRegistry.h b/src/EndpointRegistry.h
index 0fa6f13..4c9e9c6 100644
--- a/src/EndpointRegistry.h
+++ b/src/EndpointRegistry.h
@@ -4,7 +4,7 @@
 
 #include "RoutingIf.h"
 
-namespace Hydra
+namespace AsteriskSCF
 {
 namespace BasicRoutingService
 {
@@ -12,7 +12,7 @@ namespace BasicRoutingService
 class EndpointRegistryPriv;
 class ScriptProcessor;
 
-class EndpointRegistry : public Hydra::Core::Routing::V1::LocatorRegistry
+class EndpointRegistry : public AsteriskSCF::Core::Routing::V1::LocatorRegistry
 {
 public:
    EndpointRegistry();
@@ -29,8 +29,8 @@ public:
     *     the locator being added supports. 
     */
    virtual void addEndpointLocator(const ::std::string& locatorId, 
-                                   const ::Hydra::Core::Routing::V1::RegExSeq& regexList, 
-                                   const ::Hydra::Core::Routing::V1::EndpointLocatorPrx& locator, 
+                                   const ::AsteriskSCF::Core::Routing::V1::RegExSeq& regexList, 
+                                   const ::AsteriskSCF::Core::Routing::V1::EndpointLocatorPrx& locator, 
                                    const ::Ice::Current& = ::Ice::Current());
 
    /**
@@ -48,7 +48,7 @@ public:
     *     set of regular expressions completely replaces the current set. 
     */
    virtual void setEndpointLocatorDestinationIds(const ::std::string& locatorId, 
-                                                 const ::Hydra::Core::Routing::V1::RegExSeq& regexList, 
+                                                 const ::AsteriskSCF::Core::Routing::V1::RegExSeq& regexList, 
                                                  const ::Ice::Current& = ::Ice::Current());
    
    // EndpointLocator overrides
@@ -57,7 +57,7 @@ public:
     * Returns the endpoints that match the specified destination id. 
     *   @param id String identifier of the the destination. 
     */
-   virtual ::Hydra::Core::Endpoint::V1::EndpointSeq lookup(const ::std::string& destination, const ::Ice::Current& = ::Ice::Current());
+   virtual ::AsteriskSCF::Core::Endpoint::V1::EndpointSeq lookup(const ::std::string& destination, const ::Ice::Current& = ::Ice::Current());
 
 public:
 
@@ -79,4 +79,4 @@ private:
 };
 
 }; // end BasicRoutingService
-}; // end Hydra
+}; // end AsteriskSCF
diff --git a/src/LuaScriptProcessor.cpp b/src/LuaScriptProcessor.cpp
index 8f1699a..c3c0125 100644
--- a/src/LuaScriptProcessor.cpp
+++ b/src/LuaScriptProcessor.cpp
@@ -5,10 +5,10 @@
 
 #include "LuaScriptProcessor.h"
 
-using namespace ::Hydra::Core::Endpoint::V1;
+using namespace ::AsteriskSCF::Core::Endpoint::V1;
 using namespace ::std;
 
-namespace Hydra
+namespace AsteriskSCF
 {
 namespace BasicRoutingService
 {
@@ -197,5 +197,5 @@ void LuaScriptProcessor::setPolicy(const string& policy)
 }
 
 }; // end BasicRoutingService
-}; // end Hydra
+}; // end AsteriskSCF
 
diff --git a/src/LuaScriptProcessor.h b/src/LuaScriptProcessor.h
index 7ff0578..f6c5150 100644
--- a/src/LuaScriptProcessor.h
+++ b/src/LuaScriptProcessor.h
@@ -5,7 +5,7 @@
 #include "ScriptProcessor.h"
 #include "RoutingIf.h"
 
-namespace Hydra
+namespace AsteriskSCF
 {
 namespace BasicRoutingService
 {
@@ -28,5 +28,5 @@ private:
 };
 
 }; // BasicRoutingService
-}; // Hydra
+}; // AsteriskSCF
 
diff --git a/src/RoutingAdmin.cpp b/src/RoutingAdmin.cpp
index 1a565a4..8ac67ba 100644
--- a/src/RoutingAdmin.cpp
+++ b/src/RoutingAdmin.cpp
@@ -4,10 +4,10 @@
 #include "BasicRoutingServiceDataModel.h"
 #include "EndpointRegistry.h"
 
-using namespace ::Hydra::Core::Routing::V1;
+using namespace ::AsteriskSCF::Core::Routing::V1;
 using namespace ::std;
 
-namespace Hydra
+namespace AsteriskSCF
 {
 namespace BasicRoutingService
 {
@@ -39,5 +39,5 @@ void RoutingAdmin::setPolicy(const ::std::string& policy, const ::Ice::Current&)
 }
 
 }; // end BasicRoutingService
-}; // end Hydra
+}; // end AsteriskSCF
 
diff --git a/src/RoutingAdmin.h b/src/RoutingAdmin.h
index 1f2e33f..5879fa0 100644
--- a/src/RoutingAdmin.h
+++ b/src/RoutingAdmin.h
@@ -4,7 +4,7 @@
 
 #include "RoutingIf.h"
 
-namespace Hydra
+namespace AsteriskSCF
 {
 namespace BasicRoutingService
 {
@@ -13,7 +13,7 @@ class EndpointRegistryPriv;
 /**
  * This class exists to provide separation between the EndpointRegistry and the administrative functions. 
  */
-class RoutingAdmin : public Hydra::Core::Routing::V1::RoutingServiceAdmin
+class RoutingAdmin : public AsteriskSCF::Core::Routing::V1::RoutingServiceAdmin
 {
 public:
    RoutingAdmin();
@@ -35,5 +35,5 @@ public:  // RoutingServiceAdmin overrides
 };
 
 }; // end BasicRoutingService
-}; // end Hydra
+}; // end AsteriskSCF
 
diff --git a/src/RoutingServiceEventPublisher.cpp b/src/RoutingServiceEventPublisher.cpp
index 44617e8..0be461e 100644
--- a/src/RoutingServiceEventPublisher.cpp
+++ b/src/RoutingServiceEventPublisher.cpp
@@ -5,9 +5,9 @@
 #include "RoutingServiceEventPublisher.h"
 
 using namespace ::std;
-using namespace ::Hydra::Core::Routing::V1;
+using namespace ::AsteriskSCF::Core::Routing::V1;
 
-namespace Hydra
+namespace AsteriskSCF
 {
 namespace BasicRoutingService
 {
@@ -103,7 +103,7 @@ RoutingServiceEventPublisher::RoutingServiceEventPublisher()
  * Send a message to the service's event topic to report a lookup event.
  */
 void RoutingServiceEventPublisher::sendLookupEvent(const ::std::string& destination, 
-                                               ::Hydra::Core::Routing::V1::Event::OperationResult result) const
+                                               ::AsteriskSCF::Core::Routing::V1::Event::OperationResult result) const
 {
    if (!mImpl->isInitialized())
    {
@@ -118,8 +118,8 @@ void RoutingServiceEventPublisher::sendLookupEvent(const ::std::string& destinat
  * Send a message to the service's event topic to report the addEndpointLocator event.
  */
 void RoutingServiceEventPublisher::sendAddEndpointLocatorEvent(const ::std::string& locatorId, 
-                                                           const ::Hydra::Core::Routing::V1::RegExSeq& regexList, 
-                                                           ::Hydra::Core::Routing::V1::Event::OperationResult result) const
+                                                           const ::AsteriskSCF::Core::Routing::V1::RegExSeq& regexList, 
+                                                           ::AsteriskSCF::Core::Routing::V1::Event::OperationResult result) const
 {
    if (!mImpl->isInitialized())
    {
@@ -133,7 +133,7 @@ void RoutingServiceEventPublisher::sendAddEndpointLocatorEvent(const ::std::stri
  * Send a message to the service's event topic to report the removeEndpointLocator event.
  */
 void RoutingServiceEventPublisher::sendRemoveEndpointLocatorEvent(const ::std::string& locatorId, 
-                                                              ::Hydra::Core::Routing::V1::Event::OperationResult result) const
+                                                              ::AsteriskSCF::Core::Routing::V1::Event::OperationResult result) const
 {
    if (!mImpl->isInitialized())
    {
@@ -147,8 +147,8 @@ void RoutingServiceEventPublisher::sendRemoveEndpointLocatorEvent(const ::std::s
  * Send a message to the service's event topic to report the setEndpointLocatorDestinationIds event.
  */
 void RoutingServiceEventPublisher::sendSetEndpointLocatorDestinationIdsEvent(const ::std::string& locatorId, 
-                                                               const ::Hydra::Core::Routing::V1::RegExSeq& regexList, 
-                                                               ::Hydra::Core::Routing::V1::Event::OperationResult result) const
+                                                               const ::AsteriskSCF::Core::Routing::V1::RegExSeq& regexList, 
+                                                               ::AsteriskSCF::Core::Routing::V1::Event::OperationResult result) const
 {
    if (!mImpl->isInitialized())
    {
@@ -185,5 +185,5 @@ void RoutingServiceEventPublisher::sendSetPolicyEvent(const ::std::string& polic
 }
 
 }; // end BasicRoutingService
-}; // end Hydra
+}; // end AsteriskSCF
 
diff --git a/src/RoutingServiceEventPublisher.h b/src/RoutingServiceEventPublisher.h
index f512d3f..ff45422 100644
--- a/src/RoutingServiceEventPublisher.h
+++ b/src/RoutingServiceEventPublisher.h
@@ -4,7 +4,7 @@
 
 #include "RoutingIf.h"
 
-namespace Hydra
+namespace AsteriskSCF
 {
 namespace BasicRoutingService
 {
@@ -24,7 +24,7 @@ public:
     *  @param result Informs event listeners of the operations success or failure. 
     */
    void sendLookupEvent(const ::std::string& destination, 
-                        ::Hydra::Core::Routing::V1::Event::OperationResult result) const;
+                        ::AsteriskSCF::Core::Routing::V1::Event::OperationResult result) const;
 
    /**
     * Send a message to the service's event topic to report an addEndpointLocator event.
@@ -33,8 +33,8 @@ public:
     *  @param result Informs event listeners of the operations success or failure. 
     */
    void sendAddEndpointLocatorEvent(const ::std::string& locatorId, 
-                                    const ::Hydra::Core::Routing::V1::RegExSeq& regexList, 
-                                    ::Hydra::Core::Routing::V1::Event::OperationResult result) const;
+                                    const ::AsteriskSCF::Core::Routing::V1::RegExSeq& regexList, 
+                                    ::AsteriskSCF::Core::Routing::V1::Event::OperationResult result) const;
 
    /**
     * Send a message to the service's event topic to report a removeEndpointLocator event.
@@ -42,7 +42,7 @@ public:
     *  @param result Informs event listeners of the operations success or failure. 
     */
    void sendRemoveEndpointLocatorEvent(const ::std::string& locatorId, 
-                                       ::Hydra::Core::Routing::V1::Event::OperationResult result) const;
+                                       ::AsteriskSCF::Core::Routing::V1::Event::OperationResult result) const;
 
    /**
     * Send a message to the service's event topic to report a aetEndpointLocatorDestinationIds event.
@@ -51,8 +51,8 @@ public:
     *  @param result Informs event listeners of the operations success or failure. 
     */
    void sendSetEndpointLocatorDestinationIdsEvent(const ::std::string& locatorId, 
-                                                  const ::Hydra::Core::Routing::V1::RegExSeq& regexList, 
-                                                  ::Hydra::Core::Routing::V1::Event::OperationResult result) const;
+                                                  const ::AsteriskSCF::Core::Routing::V1::RegExSeq& regexList, 
+                                                  ::AsteriskSCF::Core::Routing::V1::Event::OperationResult result) const;
 
 
    /**
@@ -70,4 +70,4 @@ private:
 };
 
 }; // end BasicRoutingService
-}; // end Hydra
+}; // end AsteriskSCF
diff --git a/src/ScriptProcessor.h b/src/ScriptProcessor.h
index 359e0c0..e03c80c 100644
--- a/src/ScriptProcessor.h
+++ b/src/ScriptProcessor.h
@@ -2,7 +2,7 @@
 
 #include "RoutingIf.h"
 
-namespace Hydra
+namespace AsteriskSCF
 {
 namespace BasicRoutingService
 {
@@ -21,5 +21,5 @@ public:
 };
 
 }; // BasicRoutingService
-}; // Hydra
+}; // AsteriskSCF
 
diff --git a/test/TestRouting.cpp b/test/TestRouting.cpp
index 60ea0c3..a475595 100644
--- a/test/TestRouting.cpp
+++ b/test/TestRouting.cpp
@@ -11,8 +11,21 @@
 #include "Core/Discovery/ServiceLocatorIf.h"
 
 using namespace std;
-using namespace Hydra::Core::Routing::V1;
-using namespace Hydra::Core::Endpoint::V1;
+using namespace AsteriskSCF::Core::Routing::V1;
+using namespace AsteriskSCF::Core::Endpoint::V1;
+
+/**
+ * A BaseEndpoint implemenation.
+ */
+class BaseEndpointImpl : public BaseEndpoint
+{
+public:
+   BaseEndpointImpl(const std::string& id) : mId(id) {}
+
+   std::string getId(const Ice::Current&) {return mId;}
+private:
+   std::string mId;
+};
 
 /**
  * A locator for our test channel's endpoints.
@@ -28,10 +41,10 @@ public:
 
       for (EndpointIterator e=mEndpoints.begin(); e!= mEndpoints.end(); e++)
       {
-         cout << "TestEndpointLocatorImpl::lookup() comparing destination to " << (*e)->id->destinationId << endl << flush;
+         cout << "TestEndpointLocatorImpl::lookup() comparing destination to " << (*e)->getId() << endl << flush;
 
          BaseEndpointPtr ep = *e;
-         if ((*e)->id->destinationId == destination)
+         if ((*e)->getId() == destination)
          {
             cout << "TestEndpointLocatorImpl::lookup() found a match." << endl << flush;
             endpoints.push_back(ep);
@@ -160,16 +173,13 @@ struct GlobalIceFixture
    {
       Testbed.mEndpointLocator->mEndpoints.clear();
 
-      BaseEndpointPtr endpoint = new BaseEndpoint();
-      endpoint->id = new EndpointId("TestChannel", "101");
+      BaseEndpointPtr endpoint = new BaseEndpointImpl("101");
       Testbed.mEndpointLocator->mEndpoints.push_back(endpoint);
 
-      endpoint = new BaseEndpoint();
-      endpoint->id = new EndpointId("TestChannel", "102");
+      endpoint = new BaseEndpointImpl("102");
       Testbed.mEndpointLocator->mEndpoints.push_back(endpoint);
 
-      endpoint = new BaseEndpoint();
-      endpoint->id = new EndpointId("TestChannel", "103");
+      endpoint = new BaseEndpointImpl("103");
       Testbed.mEndpointLocator->mEndpoints.push_back(endpoint);
 
       // Initialize the regular expressions for the ids that this channel will support.
@@ -282,7 +292,7 @@ BOOST_FIXTURE_TEST_CASE(LookupOwnEndpoint, PerTestFixture)
       EndpointSeq seq = Testbed.locatorRegistry->lookup(lookupVal);
     
       BOOST_CHECK(seq.size() > 0);
-      BOOST_CHECK(seq[0]->id->destinationId == lookupVal);
+      BOOST_CHECK(seq[0]->getId() == lookupVal);
    }
    catch(const IceUtil::Exception &ie)
    {

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


-- 
asterisk-scf/integration/routing.git



More information about the asterisk-scf-commits mailing list