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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed Jun 15 07:11:56 CDT 2011


branch "nat-traversal" has been updated
       via  a288dc0ebc65a1622042c1e7223d603c7b892a26 (commit)
       via  236972c3369ab9efeed1267ffacc7b308811ddb1 (commit)
       via  5c3a38ffbbde2e422ead911f894dabeee64a97fb (commit)
       via  a27b563a985f0089a1c6be375affc11c0efb7d14 (commit)
       via  0be6db12470cad85255e604034eebc3a8458c412 (commit)
       via  32e34d5c35b66bdc8804fcd10edc80c53ff434db (commit)
       via  537a379569d915267df513a52e47887a9c2d2698 (commit)
       via  79622a9346072ca971534b0d13a9452819895509 (commit)
       via  0e9d92c0f4dbb2ba8f3300ef94fe86a99c0603c0 (commit)
       via  771d52b068d4951cee223d865817a0e56e15e48d (commit)
       via  48576aabd5ea904d285e184908f1f2eb9beadfed (commit)
       via  580bbbf7d50aab0d9022b68524529014362cec1c (commit)
       via  31e4ee08495cdf8afcb3c6b27958204c477692de (commit)
      from  11eec8cf8421391efd44d28b6010afde19c67c44 (commit)

Summary of changes:
 CMakeLists.txt                                     |   11 ++-
 .../CollocatedIceStorm/CollocatedIceStorm.h        |   57 +++++++++++++
 include/AsteriskSCF/Helpers/Network.h              |   10 ++-
 include/AsteriskSCF/ThreadPool/WorkerThread.h      |    8 ++
 src/CMakeLists.txt                                 |   27 ++----
 src/CollocatedIceStorm/CollocatedIceStorm.cpp      |   88 ++++++++++++++++++++
 src/Helpers/Network.cpp                            |    8 +-
 src/ThreadPool/CMakeLists.txt                      |   27 +-----
 src/ThreadPool/ThreadPool.cpp                      |   10 ++
 src/ThreadPool/WorkerThread.cpp                    |    2 +
 src/WorkQueue/CMakeLists.txt                       |   28 +------
 test/Async/CMakeLists.txt                          |    2 -
 test/CMakeLists.txt                                |   24 ++---
 test/Replication/CMakeLists.txt                    |    2 -
 test/ThreadPool/CMakeLists.txt                     |   32 +-------
 test/ThreadPool/TestThreadPool.cpp                 |   12 ++-
 test/WorkQueue/CMakeLists.txt                      |   25 +-----
 test/WorkQueue/TestSuspendableWorkQueue.cpp        |    2 +-
 test/WorkQueue/TestWorkQueue.cpp                   |    4 +-
 19 files changed, 232 insertions(+), 147 deletions(-)
 create mode 100644 include/AsteriskSCF/CollocatedIceStorm/CollocatedIceStorm.h
 create mode 100644 src/CollocatedIceStorm/CollocatedIceStorm.cpp


- Log -----------------------------------------------------------------
commit a288dc0ebc65a1622042c1e7223d603c7b892a26
Author: Brent Eagles <beagles at digium.com>
Date:   Tue Jun 14 16:37:30 2011 -0230

    Fixup some compilation bugs.

diff --git a/src/Helpers/Network.cpp b/src/Helpers/Network.cpp
index 36c958f..5ba1334 100644
--- a/src/Helpers/Network.cpp
+++ b/src/Helpers/Network.cpp
@@ -17,7 +17,7 @@
 #include <AsteriskSCF/Helpers/Network.h>
 #include <boost/asio.hpp>
 #include <boost/lexical_cast.hpp>
-#include <strstream>
+#include <sstream>
 
 using namespace std;
 using namespace AsteriskSCF::Helpers;
@@ -48,7 +48,7 @@ bool Address::isIPV6()
 
 string Address::toString() const
 {
-    strstream os;
+    stringstream os;
     os << mHostname << ':' << mPort;
     return os.str();
 }
@@ -103,3 +103,6 @@ DNSQueryPtr DNSQuery::create(const string& hostname, const int portnumber)
     return DNSQueryPtr(new DNSQueryImpl(q));
 }
 
+DNSQuery::DNSQuery()
+{
+}

commit 236972c3369ab9efeed1267ffacc7b308811ddb1
Author: Brent Eagles <beagles at digium.com>
Date:   Tue Jun 14 15:48:33 2011 -0230

    Add a toString method to Address to aide in debugging/tracing.

diff --git a/include/AsteriskSCF/Helpers/Network.h b/include/AsteriskSCF/Helpers/Network.h
index 7a235cd..b3bfaed 100644
--- a/include/AsteriskSCF/Helpers/Network.h
+++ b/include/AsteriskSCF/Helpers/Network.h
@@ -20,6 +20,11 @@
 #include <vector>
 #include <boost/thread.hpp>
 
+#ifdef _WIN32
+#pragma warning(push)
+#pragma warning(disable: 4251)
+#endif
+
 namespace AsteriskSCF
 {
 namespace Helpers
@@ -29,7 +34,6 @@ namespace Helpers
 // NOTE: I discovered that boost asio covers this territory, only with greater detail. I decided to keep going as I was
 // planning something far more basic to use. It's implemented in terms of asio though.
 //
-
 class ASTERISK_SCF_ICEBOX_EXPORT Address
 {
     //
@@ -86,3 +90,7 @@ typedef boost::shared_ptr<DNSQuery> DNSQueryPtr;
 
 } /* End of namespace Helpers */
 } /* End of namespace AsteriskSCF */
+
+#ifdef _WIN32
+#pragma warning(pop)
+#endif
diff --git a/src/Helpers/Network.cpp b/src/Helpers/Network.cpp
index e34e33d..36c958f 100644
--- a/src/Helpers/Network.cpp
+++ b/src/Helpers/Network.cpp
@@ -17,6 +17,7 @@
 #include <AsteriskSCF/Helpers/Network.h>
 #include <boost/asio.hpp>
 #include <boost/lexical_cast.hpp>
+#include <strstream>
 
 using namespace std;
 using namespace AsteriskSCF::Helpers;
@@ -47,7 +48,9 @@ bool Address::isIPV6()
 
 string Address::toString() const
 {
-    return mHostname + ':' + boost::lexical_cast<string>(mPort);
+    strstream os;
+    os << mHostname << ':' << mPort;
+    return os.str();
 }
 
 class DNSQueryImpl : public DNSQuery

commit 5c3a38ffbbde2e422ead911f894dabeee64a97fb
Author: Brent Eagles <beagles at digium.com>
Date:   Wed May 18 14:55:26 2011 -0230

    Fix missing distructor and libraries in link line.

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 185113d..1d46dad 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -35,7 +35,15 @@ asterisk_scf_component_add_file(ice-util-cpp ../include/AsteriskSCF/Testing/IceB
 asterisk_scf_component_add_file(ice-util-cpp IceUtilCpp.cpp)
 asterisk_scf_component_add_ice_libraries(ice-util-cpp IceStorm)
 asterisk_scf_component_add_ice_libraries(ice-util-cpp IceBox)
+asterisk_scf_component_add_boost_libraries(ice-util-cpp core thread date_time)
 asterisk_scf_component_add_boost_libraries(ice-util-cpp core system thread date_time)
+
+if(NOT logger_dir)
+   message(FATAL_ERROR "The logger directory could not be found ${logger_dir}")
+endif()
+include_directories(${logger_dir}/include)
+include_directories(${API_INCLUDE_DIR})
+
 asterisk_scf_component_build_library(ice-util-cpp)
 target_link_libraries(ice-util-cpp logging-client)
 target_link_libraries(ice-util-cpp asterisk-scf-api)

commit a27b563a985f0089a1c6be375affc11c0efb7d14
Author: Brent Eagles <beagles at digium.com>
Date:   Sun May 15 17:56:26 2011 -0230

    Adding network helper classes.

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index af842e5..185113d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -24,6 +24,9 @@ asterisk_scf_component_add_file(ice-util-cpp ../include/AsteriskSCF/Helpers/Netw
 asterisk_scf_component_add_file(ice-util-cpp Helpers/Network.cpp)
 asterisk_scf_component_add_file(ice-util-cpp ../include/AsteriskSCF/CollocatedIceStorm/CollocatedIceStorm.h)
 asterisk_scf_component_add_file(ice-util-cpp CollocatedIceStorm/CollocatedIceStorm.cpp)
+asterisk_scf_component_add_file(ice-util-cpp ../include/AsteriskSCF/Helpers/Network.h)
+asterisk_scf_component_add_file(ice-util-cpp Helpers/Network.cpp)
+
 #
 # Note, strictly speaking this isn't for component development, but as it is part of this
 # library it sort of belongs here.
diff --git a/src/Helpers/Network.cpp b/src/Helpers/Network.cpp
index fc670c3..e34e33d 100644
--- a/src/Helpers/Network.cpp
+++ b/src/Helpers/Network.cpp
@@ -100,9 +100,3 @@ DNSQueryPtr DNSQuery::create(const string& hostname, const int portnumber)
     return DNSQueryPtr(new DNSQueryImpl(q));
 }
 
-DNSQuery::DNSQuery()
-{
-    //
-    // No-op.
-    //
-}

commit 0be6db12470cad85255e604034eebc3a8458c412
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Wed Jun 1 17:04:46 2011 -0500

    We need to install the ice-util-cpp library.

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c612303..af842e5 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -36,5 +36,5 @@ asterisk_scf_component_add_boost_libraries(ice-util-cpp core system thread date_
 asterisk_scf_component_build_library(ice-util-cpp)
 target_link_libraries(ice-util-cpp logging-client)
 target_link_libraries(ice-util-cpp asterisk-scf-api)
+asterisk_scf_component_install(ice-util-cpp)
 
-# don't install the component.  it's just there to make Visual Studio happy

commit 32e34d5c35b66bdc8804fcd10edc80c53ff434db
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Wed Jun 1 16:57:22 2011 -0500

    More CMake script cleanup.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 74b1a43..3690011 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,14 +1,9 @@
 asterisk_scf_project(ice-util-cpp 3.4)
 
-if (integrated_build STREQUAL "true")
-  set(utils_dir ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE)
-endif()
+set(ice-util-cpp_dir ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE)
 
 include_directories(include)
 include_directories(${API_INCLUDE_DIR})
-if(NOT logger_dir)
-   message(FATAL_ERROR "The logger directory could not be found ${logger_dir}")
-endif()
 include_directories(${logger_dir}/include)
 asterisk_scf_slice_include_directories(${API_SLICE_DIR})
 
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6bc95ff..c612303 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,11 +1,3 @@
-#
-# Asterisk Scalable Communications Framework
-#
-# Copyright (C) 2010 -- Digium, Inc.
-#
-# All rights reserved.
-#
-
 # Ice Utilities for C++
 
 asterisk_scf_component_init(ice-util-cpp)
diff --git a/src/ThreadPool/CMakeLists.txt b/src/ThreadPool/CMakeLists.txt
index 28fd27f..f20e468 100644
--- a/src/ThreadPool/CMakeLists.txt
+++ b/src/ThreadPool/CMakeLists.txt
@@ -1,11 +1,3 @@
-#
-# Asterisk Scalable Communications Framework
-#
-# Copyright (C) 2011 -- Digium, Inc.
-#
-# All rights reserved.
-#
-
 asterisk_scf_component_init(ThreadPool)
 asterisk_scf_component_add_file(ThreadPool ../include/AsteriskSCF/ThreadPool.h)
 asterisk_scf_component_add_file(ThreadPool ../include/AsteriskSCF/WorkerThread.h)
@@ -15,3 +7,4 @@ asterisk_scf_component_add_boost_libraries(ThreadPool thread date_time)
 asterisk_scf_component_build_library(ThreadPool)
 target_link_libraries(ThreadPool WorkQueue)
 target_link_libraries(ThreadPool asterisk-scf-api)
+asterisk_scf_component_install(ThreadPool)
diff --git a/src/WorkQueue/CMakeLists.txt b/src/WorkQueue/CMakeLists.txt
index d642f69..6ca491d 100644
--- a/src/WorkQueue/CMakeLists.txt
+++ b/src/WorkQueue/CMakeLists.txt
@@ -1,11 +1,3 @@
-#
-# Asterisk Scalable Communications Framework
-#
-# Copyright (C) 2011 -- Digium, Inc.
-#
-# All rights reserved.
-#
-
 asterisk_scf_component_init(WorkQueue)
 asterisk_scf_component_add_file(WorkQueue ../include/AsteriskSCF/WorkQueue.h)
 asterisk_scf_component_add_file(WorkQueue ../include/AsteriskSCF/SuspendableWorkQueue.h)
diff --git a/test/ThreadPool/CMakeLists.txt b/test/ThreadPool/CMakeLists.txt
index f7a2c70..ec1a786 100644
--- a/test/ThreadPool/CMakeLists.txt
+++ b/test/ThreadPool/CMakeLists.txt
@@ -1,13 +1,3 @@
-#
-# Asterisk Scalable Communications Framework
-#
-# Copyright (C) 2011 -- Digium, Inc.
-#
-# All rights reserved.
-#
-
-include_directories(../../src/ThreadPool)
-
 asterisk_scf_component_init(ThreadPoolTest)
 asterisk_scf_component_add_file(ThreadPoolTest TestThreadPool.cpp)
 asterisk_scf_component_add_file(ThreadPoolTest test.cpp)
diff --git a/test/WorkQueue/CMakeLists.txt b/test/WorkQueue/CMakeLists.txt
index 8747c05..c0006f4 100644
--- a/test/WorkQueue/CMakeLists.txt
+++ b/test/WorkQueue/CMakeLists.txt
@@ -1,13 +1,3 @@
-#
-# Asterisk Scalable Communications Framework
-#
-# Copyright (C) 2011 -- Digium, Inc.
-#
-# All rights reserved.
-#
-
-include_directories(../../src/WorkQueue)
-
 asterisk_scf_component_init(WorkQueueTest)
 asterisk_scf_component_add_file(WorkQueueTest TestWorkQueue.cpp)
 asterisk_scf_component_add_file(WorkQueueTest test.cpp)
@@ -15,6 +5,7 @@ asterisk_scf_component_add_boost_libraries(WorkQueueTest unit_test_framework)
 asterisk_scf_component_build_standalone(WorkQueueTest)
 target_link_libraries(WorkQueueTest asterisk-scf-api)
 target_link_libraries(WorkQueueTest ice-util-cpp)
+asterisk_scf_test_boost(WorkQueueTest)
 
 asterisk_scf_component_init(SuspendableWorkQueueTest)
 asterisk_scf_component_add_file(SuspendableWorkQueueTest TestSuspendableWorkQueue.cpp)
@@ -23,6 +14,4 @@ asterisk_scf_component_add_boost_libraries(SuspendableWorkQueueTest unit_test_fr
 asterisk_scf_component_build_standalone(SuspendableWorkQueueTest)
 target_link_libraries(SuspendableWorkQueueTest asterisk-scf-api)
 target_link_libraries(SuspendableWorkQueueTest ice-util-cpp)
-
-asterisk_scf_test_boost(WorkQueueTest)
 asterisk_scf_test_boost(SuspendableWorkQueueTest)

commit 537a379569d915267df513a52e47887a9c2d2698
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Wed Jun 1 13:10:59 2011 -0500

    Get TestThreadPool, TestWorkQueue and TestSuspendableWorkQueue to actually
    compile and run

diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index d81da48..b26ab49 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -14,4 +14,5 @@ target_link_libraries(ice-util-cpp-test asterisk-scf-api)
 
 add_subdirectory(Async)
 add_subdirectory(Replication)
-
+add_subdirectory(ThreadPool)
+add_subdirectory(WorkQueue)
diff --git a/test/ThreadPool/CMakeLists.txt b/test/ThreadPool/CMakeLists.txt
index eff9e7f..f7a2c70 100644
--- a/test/ThreadPool/CMakeLists.txt
+++ b/test/ThreadPool/CMakeLists.txt
@@ -6,31 +6,13 @@
 # All rights reserved.
 #
 
-asterisk_scf_component_init(ThreadPoolTest CXX)
-
-include_directories(${API_INCLUDE_DIR})
 include_directories(../../src/ThreadPool)
-# The test requires a work queue
-include_directories(../../include)
-
 
+asterisk_scf_component_init(ThreadPoolTest)
 asterisk_scf_component_add_file(ThreadPoolTest TestThreadPool.cpp)
 asterisk_scf_component_add_file(ThreadPoolTest test.cpp)
 asterisk_scf_component_add_boost_libraries(ThreadPoolTest unit_test_framework)
-
-# asterisk_scf_component_add_file(ProofOfConcept ProofOfConcept.cpp)
-# asterisk_scf_component_add_file(ProofOfConcept test.cpp)
-# asterisk_scf_component_add_boost_libraries(ProofOfConcept unit_test_framework)
-
 asterisk_scf_component_build_standalone(ThreadPoolTest)
 target_link_libraries(ThreadPoolTest asterisk-scf-api)
-target_link_libraries(ThreadPoolTest ThreadPool)
-target_link_libraries(ThreadPoolTest WorkQueue)
-
-# asterisk_scf_component_build_standalone(ProofOfConcept)
-# target_link_libraries(ProofOfConcept asterisk-scf-api)
-# target_link_libraries(ProofOfConcept ThreadPool)
-# target_link_libraries(ProofOfConcept WorkQueue)
-
+target_link_libraries(ThreadPoolTest ice-util-cpp)
 asterisk_scf_test_boost(ThreadPoolTest)
-# asterisk_scf_test_boost(ProofOfConcept)
diff --git a/test/ThreadPool/TestThreadPool.cpp b/test/ThreadPool/TestThreadPool.cpp
index 8f2c2d7..05b032f 100644
--- a/test/ThreadPool/TestThreadPool.cpp
+++ b/test/ThreadPool/TestThreadPool.cpp
@@ -18,8 +18,8 @@
 #include <boost/thread.hpp>
 #include <boost/thread/locks.hpp>
 
-#include <AsteriskSCF/WorkQueue.h>
-#include <AsteriskSCF/ThreadPool.h>
+#include <AsteriskSCF/WorkQueue/WorkQueue.h>
+#include <AsteriskSCF/ThreadPool/ThreadPool.h>
 
 using namespace AsteriskSCF::System::ThreadPool::V1;
 using namespace AsteriskSCF::ThreadPool;
@@ -57,6 +57,14 @@ public:
         mEmptyNotice = true;
     }
 
+    void threadStart()
+    {
+    }
+
+    void threadStop()
+    {
+    }
+
     Ice::Long mActive;
     Ice::Long mIdle;
     Ice::Long mZombie;
diff --git a/test/WorkQueue/CMakeLists.txt b/test/WorkQueue/CMakeLists.txt
index 87185b4..8747c05 100644
--- a/test/WorkQueue/CMakeLists.txt
+++ b/test/WorkQueue/CMakeLists.txt
@@ -6,27 +6,23 @@
 # All rights reserved.
 #
 
-asterisk_scf_component_init(WorkQueueTest CXX)
-
-include_directories(${API_INCLUDE_DIR})
 include_directories(../../src/WorkQueue)
-include_directories(../../include)
 
+asterisk_scf_component_init(WorkQueueTest)
 asterisk_scf_component_add_file(WorkQueueTest TestWorkQueue.cpp)
 asterisk_scf_component_add_file(WorkQueueTest test.cpp)
 asterisk_scf_component_add_boost_libraries(WorkQueueTest unit_test_framework)
-
 asterisk_scf_component_build_standalone(WorkQueueTest)
 target_link_libraries(WorkQueueTest asterisk-scf-api)
-target_link_libraries(WorkQueueTest WorkQueue)
+target_link_libraries(WorkQueueTest ice-util-cpp)
 
+asterisk_scf_component_init(SuspendableWorkQueueTest)
 asterisk_scf_component_add_file(SuspendableWorkQueueTest TestSuspendableWorkQueue.cpp)
 asterisk_scf_component_add_file(SuspendableWorkQueueTest test2.cpp)
 asterisk_scf_component_add_boost_libraries(SuspendableWorkQueueTest unit_test_framework thread)
-
 asterisk_scf_component_build_standalone(SuspendableWorkQueueTest)
 target_link_libraries(SuspendableWorkQueueTest asterisk-scf-api)
-target_link_libraries(SuspendableWorkQueueTest WorkQueue)
+target_link_libraries(SuspendableWorkQueueTest ice-util-cpp)
 
 asterisk_scf_test_boost(WorkQueueTest)
 asterisk_scf_test_boost(SuspendableWorkQueueTest)
diff --git a/test/WorkQueue/TestSuspendableWorkQueue.cpp b/test/WorkQueue/TestSuspendableWorkQueue.cpp
index 9894193..78276ee 100644
--- a/test/WorkQueue/TestSuspendableWorkQueue.cpp
+++ b/test/WorkQueue/TestSuspendableWorkQueue.cpp
@@ -17,7 +17,7 @@
 #include <boost/test/unit_test.hpp>
 #include <boost/thread.hpp>
 
-#include <AsteriskSCF/SuspendableWorkQueue.h>
+#include <AsteriskSCF/WorkQueue/SuspendableWorkQueue.h>
 
 using namespace AsteriskSCF::System::WorkQueue::V1;
 using namespace AsteriskSCF::WorkQueue;
diff --git a/test/WorkQueue/TestWorkQueue.cpp b/test/WorkQueue/TestWorkQueue.cpp
index 08a9cea..535cece 100644
--- a/test/WorkQueue/TestWorkQueue.cpp
+++ b/test/WorkQueue/TestWorkQueue.cpp
@@ -17,8 +17,8 @@
 #include <boost/test/unit_test.hpp>
 #include <boost/thread.hpp>
 
-#include <AsteriskSCF/WorkQueue.h>
-#include <AsteriskSCF/DefaultQueueListener.h>
+#include <AsteriskSCF/WorkQueue/WorkQueue.h>
+#include <AsteriskSCF/WorkQueue/DefaultQueueListener.h>
 
 using namespace AsteriskSCF::System::WorkQueue::V1;
 using namespace AsteriskSCF::WorkQueue;

commit 79622a9346072ca971534b0d13a9452819895509
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Wed Jun 1 13:10:24 2011 -0500

    More CMake script cleanups, this time for the ice-util-cpp unit tests

diff --git a/test/Async/CMakeLists.txt b/test/Async/CMakeLists.txt
index 4079ce4..5477439 100644
--- a/test/Async/CMakeLists.txt
+++ b/test/Async/CMakeLists.txt
@@ -1,5 +1,3 @@
-include_directories("../src")
-
 asterisk_scf_component_init(ami-collector-test)
 asterisk_scf_component_add_file(ami-collector-test ResponseCollector-test.cpp)
 asterisk_scf_component_add_file(ami-collector-test IceIntegration-test.cpp)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 40b9f87..d81da48 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,19 +1,14 @@
-asterisk_scf_slice_include_directories(${API_SLICE_DIR})
-asterisk_scf_component_init(ice-util-cpp-test CXX)
-include_directories("../include")
-asterisk_scf_component_add_slice(ice-util-cpp-test ./ProxyHelper/SimpleIf.ice)
-asterisk_scf_component_add_file(ice-util-cpp-test ./LocatorRegistration/LocatorRegistrationTest.cpp)
-asterisk_scf_component_add_file(ice-util-cpp-test ./LocatorRegistration/LocatorRegistrationTest.h)
-asterisk_scf_component_add_file(ice-util-cpp-test ./PropertyHelper/PropertyHelperTest.cpp)
-asterisk_scf_component_add_file(ice-util-cpp-test ./PropertyHelper/PropertyHelperTest.h)
-asterisk_scf_component_add_file(ice-util-cpp-test ./ProxyHelper/ProxyHelperTests.cpp)
-asterisk_scf_component_add_file(ice-util-cpp-test ./ProxyHelper/ProxyHelperTests.h)
+asterisk_scf_component_init(ice-util-cpp-test)
+asterisk_scf_component_add_slice(ice-util-cpp-test ProxyHelper/SimpleIf.ice)
+asterisk_scf_component_add_file(ice-util-cpp-test LocatorRegistration/LocatorRegistrationTest.cpp)
+asterisk_scf_component_add_file(ice-util-cpp-test LocatorRegistration/LocatorRegistrationTest.h)
+asterisk_scf_component_add_file(ice-util-cpp-test PropertyHelper/PropertyHelperTest.cpp)
+asterisk_scf_component_add_file(ice-util-cpp-test PropertyHelper/PropertyHelperTest.h)
+asterisk_scf_component_add_file(ice-util-cpp-test ProxyHelper/ProxyHelperTests.cpp)
+asterisk_scf_component_add_file(ice-util-cpp-test ProxyHelper/ProxyHelperTests.h)
 asterisk_scf_component_add_file(ice-util-cpp-test UtilityTests.cpp)
-
 asterisk_scf_component_add_ice_libraries(ice-util-cpp-test IceBox)
 asterisk_scf_component_add_boost_libraries(ice-util-cpp-test unit_test_framework date_time thread)
-
-include_directories(${API_INCLUDE_DIR})
 asterisk_scf_component_build_icebox(ice-util-cpp-test)
 target_link_libraries(ice-util-cpp-test asterisk-scf-api)
 
diff --git a/test/Replication/CMakeLists.txt b/test/Replication/CMakeLists.txt
index d054323..829e50d 100644
--- a/test/Replication/CMakeLists.txt
+++ b/test/Replication/CMakeLists.txt
@@ -1,5 +1,3 @@
-include_directories("../include")
-
 asterisk_scf_component_init(StateReplicatorTest)
 asterisk_scf_component_add_file(StateReplicatorTest TestStateReplicator.cpp)
 asterisk_scf_component_add_file(StateReplicatorTest SharedTestData.h)

commit 0e9d92c0f4dbb2ba8f3300ef94fe86a99c0603c0
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Wed Jun 1 11:25:12 2011 -0500

    Clean up CMake scripts:
    
    * Move common steps to top-level script
    * Remove duplicate function calls
    * Remove unnecessary function calls

diff --git a/CMakeLists.txt b/CMakeLists.txt
index bbaf307..74b1a43 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,5 +4,15 @@ if (integrated_build STREQUAL "true")
   set(utils_dir ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE)
 endif()
 
+include_directories(include)
+include_directories(${API_INCLUDE_DIR})
+if(NOT logger_dir)
+   message(FATAL_ERROR "The logger directory could not be found ${logger_dir}")
+endif()
+include_directories(${logger_dir}/include)
+asterisk_scf_slice_include_directories(${API_SLICE_DIR})
+
 add_subdirectory(src)
 add_subdirectory(test)
+
+asterisk_scf_headers_install(include/)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5258a44..6bc95ff 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -9,10 +9,6 @@
 # Ice Utilities for C++
 
 asterisk_scf_component_init(ice-util-cpp)
-
-include_directories(../include)
-asterisk_scf_slice_include_directories(${API_SLICE_DIR})
-
 asterisk_scf_component_add_file(ice-util-cpp ../include/AsteriskSCF/Discovery/SmartProxy.h)
 asterisk_scf_component_add_file(ice-util-cpp ../include/AsteriskSCF/Discovery/LocatorRegistrationWrapper.h)
 asterisk_scf_component_add_file(ice-util-cpp ../include/AsteriskSCF/Async/AmiCollector.h)
@@ -36,32 +32,17 @@ asterisk_scf_component_add_file(ice-util-cpp ../include/AsteriskSCF/Helpers/Netw
 asterisk_scf_component_add_file(ice-util-cpp Helpers/Network.cpp)
 asterisk_scf_component_add_file(ice-util-cpp ../include/AsteriskSCF/CollocatedIceStorm/CollocatedIceStorm.h)
 asterisk_scf_component_add_file(ice-util-cpp CollocatedIceStorm/CollocatedIceStorm.cpp)
-
 #
 # Note, strictly speaking this isn't for component development, but as it is part of this
 # library it sort of belongs here.
 #
 asterisk_scf_component_add_file(ice-util-cpp ../include/AsteriskSCF/Testing/IceBoxBoostTest.h)
-
 asterisk_scf_component_add_file(ice-util-cpp IceUtilCpp.cpp)
-
 asterisk_scf_component_add_ice_libraries(ice-util-cpp IceStorm)
 asterisk_scf_component_add_ice_libraries(ice-util-cpp IceBox)
-
 asterisk_scf_component_add_boost_libraries(ice-util-cpp core system thread date_time)
-
-if(NOT logger_dir)
-   message(FATAL_ERROR "The logger directory could not be found ${logger_dir}")
-endif()
-include_directories(${logger_dir}/include)
-include_directories(${API_INCLUDE_DIR})
-
 asterisk_scf_component_build_library(ice-util-cpp)
-
-include_directories(${API_INCLUDE_DIR})
 target_link_libraries(ice-util-cpp logging-client)
 target_link_libraries(ice-util-cpp asterisk-scf-api)
 
 # don't install the component.  it's just there to make Visual Studio happy
-# _do_ install the header files
-asterisk_scf_headers_install(include/)
diff --git a/src/ThreadPool/CMakeLists.txt b/src/ThreadPool/CMakeLists.txt
index 584d4d4..28fd27f 100644
--- a/src/ThreadPool/CMakeLists.txt
+++ b/src/ThreadPool/CMakeLists.txt
@@ -6,24 +6,12 @@
 # All rights reserved.
 #
 
-asterisk_scf_slice_include_directories(${API_SLICE_DIR})
-
-asterisk_scf_component_init(ThreadPool CXX)
-
-include_directories(../include)
-include_directories(../../WorkQueue/include)
-include_directories(${API_INCLUDE_DIR})
-
-asterisk_scf_component_add_file(ThreadPool
-    ../include/AsteriskSCF/ThreadPool.h)
-asterisk_scf_component_add_file(ThreadPool
-    ../include/AsteriskSCF/WorkerThread.h)
+asterisk_scf_component_init(ThreadPool)
+asterisk_scf_component_add_file(ThreadPool ../include/AsteriskSCF/ThreadPool.h)
+asterisk_scf_component_add_file(ThreadPool ../include/AsteriskSCF/WorkerThread.h)
 asterisk_scf_component_add_file(ThreadPool ThreadPool.cpp)
 asterisk_scf_component_add_file(ThreadPool WorkerThread.cpp)
 asterisk_scf_component_add_boost_libraries(ThreadPool thread date_time)
-
 asterisk_scf_component_build_library(ThreadPool)
 target_link_libraries(ThreadPool WorkQueue)
 target_link_libraries(ThreadPool asterisk-scf-api)
-
-asterisk_scf_headers_install(../include/)
diff --git a/src/WorkQueue/CMakeLists.txt b/src/WorkQueue/CMakeLists.txt
index 31d8d88..d642f69 100644
--- a/src/WorkQueue/CMakeLists.txt
+++ b/src/WorkQueue/CMakeLists.txt
@@ -6,26 +6,14 @@
 # All rights reserved.
 #
 
-asterisk_scf_slice_include_directories(${API_SLICE_DIR})
-
-asterisk_scf_component_init(WorkQueue CXX)
-
-include_directories(../include)
-include_directories(${API_INCLUDE_DIR})
-
-asterisk_scf_component_add_file(WorkQueue
-    ../include/AsteriskSCF/WorkQueue.h)
-asterisk_scf_component_add_file(WorkQueue
-    ../include/AsteriskSCF/SuspendableWorkQueue.h)
-asterisk_scf_component_add_file(WorkQueue
-    ../include/AsteriskSCF/DefaultQueueListener.h)
+asterisk_scf_component_init(WorkQueue)
+asterisk_scf_component_add_file(WorkQueue ../include/AsteriskSCF/WorkQueue.h)
+asterisk_scf_component_add_file(WorkQueue ../include/AsteriskSCF/SuspendableWorkQueue.h)
+asterisk_scf_component_add_file(WorkQueue ../include/AsteriskSCF/DefaultQueueListener.h)
 asterisk_scf_component_add_file(WorkQueue WorkQueue.cpp)
 asterisk_scf_component_add_file(WorkQueue SuspendableWorkQueue.cpp)
 asterisk_scf_component_add_file(WorkQueue DefaultQueueListener.cpp)
 asterisk_scf_component_add_boost_libraries(WorkQueue thread date_time)
-
 asterisk_scf_component_build_library(WorkQueue)
 target_link_libraries(WorkQueue asterisk-scf-api)
-
-asterisk_scf_headers_install(../include/)
 asterisk_scf_component_install(WorkQueue)

commit 771d52b068d4951cee223d865817a0e56e15e48d
Author: Joshua Colp <jcolp at digium.com>
Date:   Mon May 23 19:15:37 2011 -0300

    Add required exports as the great Mark Michelson said.

diff --git a/include/AsteriskSCF/CollocatedIceStorm/CollocatedIceStorm.h b/include/AsteriskSCF/CollocatedIceStorm/CollocatedIceStorm.h
index f135838..02ea2b4 100644
--- a/include/AsteriskSCF/CollocatedIceStorm/CollocatedIceStorm.h
+++ b/include/AsteriskSCF/CollocatedIceStorm/CollocatedIceStorm.h
@@ -32,7 +32,7 @@ namespace CollocatedIceStorm
  * a separate process to access IceStorm services.
  */
 
-class CollocatedIceStorm : public IceUtil::Shared
+class ASTERISK_SCF_ICEBOX_EXPORT CollocatedIceStorm : public IceUtil::Shared
 {
 public:
     CollocatedIceStorm(const std::string&, const Ice::PropertiesPtr&);
diff --git a/src/CollocatedIceStorm/CollocatedIceStorm.cpp b/src/CollocatedIceStorm/CollocatedIceStorm.cpp
index 8903918..e3fe6c2 100644
--- a/src/CollocatedIceStorm/CollocatedIceStorm.cpp
+++ b/src/CollocatedIceStorm/CollocatedIceStorm.cpp
@@ -69,7 +69,7 @@ CollocatedIceStorm::~CollocatedIceStorm()
     }
 }
 
-void CollocatedIceStorm::stop()
+ASTERISK_SCF_ICEBOX_EXPORT void CollocatedIceStorm::stop()
 {
     //
     // NOTE: there isn't any mutex protection here. It can be added later if needed, but at the moment multiple threads

commit 48576aabd5ea904d285e184908f1f2eb9beadfed
Author: Joshua Colp <jcolp at digium.com>
Date:   Mon May 23 19:03:20 2011 -0300

    Please, please, fix building on Windows.

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 8bba4be..5258a44 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -44,6 +44,10 @@ asterisk_scf_component_add_file(ice-util-cpp CollocatedIceStorm/CollocatedIceSto
 asterisk_scf_component_add_file(ice-util-cpp ../include/AsteriskSCF/Testing/IceBoxBoostTest.h)
 
 asterisk_scf_component_add_file(ice-util-cpp IceUtilCpp.cpp)
+
+asterisk_scf_component_add_ice_libraries(ice-util-cpp IceStorm)
+asterisk_scf_component_add_ice_libraries(ice-util-cpp IceBox)
+
 asterisk_scf_component_add_boost_libraries(ice-util-cpp core system thread date_time)
 
 if(NOT logger_dir)

commit 580bbbf7d50aab0d9022b68524529014362cec1c
Author: Mark Michelson <mmichelson at digium.com>
Date:   Thu May 19 19:03:09 2011 -0500

    Implement new threadStart and threadStop calls.

diff --git a/include/AsteriskSCF/ThreadPool/WorkerThread.h b/include/AsteriskSCF/ThreadPool/WorkerThread.h
index 4597a11..6bf1a4d 100644
--- a/include/AsteriskSCF/ThreadPool/WorkerThread.h
+++ b/include/AsteriskSCF/ThreadPool/WorkerThread.h
@@ -84,6 +84,14 @@ public:
      * A zombie thread has died
      */
     virtual void zombieThreadDead(WorkerThreadPtr thread) = 0;
+    /**
+     * A new thread has been created
+     */
+    virtual void threadStarted() = 0;
+    /**
+     * A thread has finished its execution
+     */
+    virtual void threadFinished() = 0;
 };
 
 }; // end namespace ThreadPool
diff --git a/src/ThreadPool/ThreadPool.cpp b/src/ThreadPool/ThreadPool.cpp
index fb7e601..ac9aff3 100644
--- a/src/ThreadPool/ThreadPool.cpp
+++ b/src/ThreadPool/ThreadPool.cpp
@@ -196,6 +196,16 @@ public:
         }
     }
 
+    void threadStarted()
+    {
+        mListener->threadStart();
+    }
+
+    void threadFinished()
+    {
+        mListener->threadStop();
+    }
+
     /**
      * Queued task that causes the thread pool to gain or lose threads
      *
diff --git a/src/ThreadPool/WorkerThread.cpp b/src/ThreadPool/WorkerThread.cpp
index 6f8b59f..d8a68b8 100644
--- a/src/ThreadPool/WorkerThread.cpp
+++ b/src/ThreadPool/WorkerThread.cpp
@@ -37,6 +37,7 @@ public:
 
     void active()
     {
+        mListener->threadStarted();
         /**
          * For all intents and purposes, localAlive
          * should evaluate to (mState == Alive). We use
@@ -64,6 +65,7 @@ public:
         {
             mListener->zombieThreadDead(mWorkerThread);
         }
+        mListener->threadFinished();
     }
 
     bool idle()

commit 31e4ee08495cdf8afcb3c6b27958204c477692de
Author: Joshua Colp <jcolp at digium.com>
Date:   Tue May 17 10:20:02 2011 -0300

    Make the collocated icestorm available to all.

diff --git a/include/AsteriskSCF/CollocatedIceStorm/CollocatedIceStorm.h b/include/AsteriskSCF/CollocatedIceStorm/CollocatedIceStorm.h
new file mode 100644
index 0000000..f135838
--- /dev/null
+++ b/include/AsteriskSCF/CollocatedIceStorm/CollocatedIceStorm.h
@@ -0,0 +1,57 @@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2010, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+#pragma once
+
+#include <IceUtil/DynamicLibrary.h>
+#include <Ice/Service.h>
+#include <IceBox/IceBox.h>
+#include <Ice/Ice.h>
+#include <IceStorm/IceStorm.h>
+#include <string>
+
+namespace AsteriskSCF
+{
+namespace CollocatedIceStorm
+{
+
+/**
+ * A helper class that instantiates IceStorm in-process, removing the need to launch
+ * a separate process to access IceStorm services.
+ */
+
+class CollocatedIceStorm : public IceUtil::Shared
+{
+public:
+    CollocatedIceStorm(const std::string&, const Ice::PropertiesPtr&);
+    ~CollocatedIceStorm();
+
+    /**
+     * "nice" applications should explictly call stop !
+     */
+    void stop();
+
+private:
+    IceUtilInternal::DynamicLibraryPtr mLibrary;
+    IceBox::ServicePtr mService;
+    Ice::CommunicatorPtr mCommunicator;
+    bool mStopped;
+};
+
+typedef IceUtil::Handle<CollocatedIceStorm> CollocatedIceStormPtr;
+
+} /* end of CollocatedIceStorm */
+} /* end of AsteriskSCF */
+
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0065973..8bba4be 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -34,7 +34,8 @@ asterisk_scf_component_add_file(ice-util-cpp ThreadPool/ThreadPool.cpp)
 asterisk_scf_component_add_file(ice-util-cpp ThreadPool/WorkerThread.cpp)
 asterisk_scf_component_add_file(ice-util-cpp ../include/AsteriskSCF/Helpers/Network.h)
 asterisk_scf_component_add_file(ice-util-cpp Helpers/Network.cpp)
-
+asterisk_scf_component_add_file(ice-util-cpp ../include/AsteriskSCF/CollocatedIceStorm/CollocatedIceStorm.h)
+asterisk_scf_component_add_file(ice-util-cpp CollocatedIceStorm/CollocatedIceStorm.cpp)
 
 #
 # Note, strictly speaking this isn't for component development, but as it is part of this
diff --git a/src/CollocatedIceStorm/CollocatedIceStorm.cpp b/src/CollocatedIceStorm/CollocatedIceStorm.cpp
new file mode 100644
index 0000000..8903918
--- /dev/null
+++ b/src/CollocatedIceStorm/CollocatedIceStorm.cpp
@@ -0,0 +1,88 @@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2010, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+#include <Ice/Ice.h>
+#include <IceStorm/IceStorm.h>
+#include <assert.h>
+#include <algorithm>
+
+#include <AsteriskSCF/CollocatedIceStorm/CollocatedIceStorm.h>
+
+using namespace AsteriskSCF::CollocatedIceStorm;
+
+//
+// The idea behind this class is that it needs to access the entry point that IceBox would
+// have used and then invoke the methods that are needed to start and stop the IceStorm
+// service.
+//
+typedef IceBox::Service* (*FACTORY)(Ice::CommunicatorPtr);
+
+CollocatedIceStorm::CollocatedIceStorm(const std::string& namePrefix, const Ice::PropertiesPtr& properties) :
+    mStopped(false)
+{
+    //
+    // We create our own communicator to avoid issues with call order on shutdown.
+    //
+    Ice::InitializationData initData;
+    initData.properties = properties;
+    mCommunicator = Ice::initialize(initData);
+
+    std::string loadString = mCommunicator->getProperties()->getPropertyWithDefault("IceStorm.EntryPoint", "IceStormService:createIceStorm");
+
+    mLibrary = new IceUtilInternal::DynamicLibrary;
+    IceUtilInternal::DynamicLibrary::symbol_type entry = mLibrary->loadEntryPoint(loadString);
+    if(entry == 0)
+    {
+        throw mLibrary->getErrorMessage();
+    }
+    FACTORY factory = (FACTORY)entry;
+    mService = factory(mCommunicator);
+    assert(mService != 0);
+    Ice::StringSeq options;
+    mService->start(namePrefix, mCommunicator, options);
+}
+
+CollocatedIceStorm::~CollocatedIceStorm()
+{
+    if(!mStopped)
+    {
+        try
+        {
+            stop();
+            mCommunicator->destroy();
+        }
+        catch(...)
+        {
+        }
+    }
+}
+
+void CollocatedIceStorm::stop()
+{
+    //
+    // NOTE: there isn't any mutex protection here. It can be added later if needed, but at the moment multiple threads
+    // do not have access to this object instance.
+    //
+    if(!mStopped)
+    {
+        if(mService)
+        {
+            mService->stop();
+        }
+        mCommunicator->shutdown();
+        mCommunicator->waitForShutdown();
+        mStopped = true;
+    }
+}

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


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



More information about the asterisk-scf-commits mailing list