]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3668] Moved the definition of IOServicePtr to asiolink/io_service.h
authorMarcin Siodelski <marcin@isc.org>
Mon, 12 Jan 2015 17:06:41 +0000 (18:06 +0100)
committerMarcin Siodelski <marcin@isc.org>
Mon, 12 Jan 2015 17:06:41 +0000 (18:06 +0100)
32 files changed:
src/bin/d2/Makefile.am
src/bin/d2/bundy_d2_controller.h
src/bin/d2/d2_asio.h [deleted file]
src/bin/d2/d2_cfg_mgr.h
src/bin/d2/d2_config.h
src/bin/d2/d2_process.cc
src/bin/d2/d2_process.h
src/bin/d2/d2_queue_mgr.cc
src/bin/d2/d2_queue_mgr.h
src/bin/d2/d2_update_mgr.cc
src/bin/d2/d2_update_mgr.h
src/bin/d2/d_controller.h
src/bin/d2/d_process.h
src/bin/d2/io_service_signal.cc
src/bin/d2/io_service_signal.h
src/bin/d2/nc_add.cc
src/bin/d2/nc_add.h
src/bin/d2/nc_remove.cc
src/bin/d2/nc_remove.h
src/bin/d2/nc_trans.cc
src/bin/d2/nc_trans.h
src/bin/d2/tests/d2_process_unittests.cc
src/bin/d2/tests/d2_queue_mgr_unittests.cc
src/bin/d2/tests/d2_update_mgr_unittests.cc
src/bin/d2/tests/d_test_stubs.cc
src/bin/d2/tests/d_test_stubs.h
src/bin/d2/tests/io_service_signal_unittests.cc
src/bin/d2/tests/nc_add_unittests.cc
src/bin/d2/tests/nc_remove_unittests.cc
src/bin/d2/tests/nc_test_utils.h
src/bin/d2/tests/nc_trans_unittests.cc
src/lib/asiolink/io_service.h

index e1ba538653535c1377f6b9e83af1ee94b0d17644..b90e6fd490dba6e6e383741dadf13b8045fcbe39 100644 (file)
@@ -53,7 +53,6 @@ libd2_la_SOURCES  =
 libd2_la_SOURCES += d_process.h
 libd2_la_SOURCES += d_controller.cc d_controller.h
 libd2_la_SOURCES += d_cfg_mgr.cc d_cfg_mgr.h
-libd2_la_SOURCES += d2_asio.h
 libd2_la_SOURCES += d2_log.cc d2_log.h
 libd2_la_SOURCES += d2_process.cc d2_process.h
 libd2_la_SOURCES += d2_config.cc d2_config.h
index 0c8831da20b52bec30bd7b5adefb6801daa73cdc..8ea0337f573ec8dbfbc23a97e56a7d5a6111de77 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
 #ifndef BUNDY_D2_CONTROLLER_H
 #define BUNDY_D2_CONTROLLER_H
 
+#include <asiolink/io_service.h>
 #include <cc/data.h>
 #include <cc/session.h>
 #include <config/ccsession.h>
-#include <d2/d2_asio.h>
 #include <d2/d2_log.h>
 #include <d2/d_controller.h>
 #include <d2/d_process.h>
diff --git a/src/bin/d2/d2_asio.h b/src/bin/d2/d2_asio.h
deleted file mode 100644 (file)
index c9458f6..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (C) 2013  Internet Systems Consortium, Inc. ("ISC")
-//
-// Permission to use, copy, modify, and/or distribute this software for any
-// purpose with or without fee is hereby granted, provided that the above
-// copyright notice and this permission notice appear in all copies.
-//
-// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-// PERFORMANCE OF THIS SOFTWARE.
-
-#ifndef D2_ASIO_H
-#define D2_ASIO_H
-
-#include <asiolink/asiolink.h>
-
-#include <boost/shared_ptr.hpp>
-
-namespace isc {
-namespace d2 {
-
-/// @brief Defines a smart pointer to an IOService instance.
-typedef boost::shared_ptr<isc::asiolink::IOService> IOServicePtr;
-
-}; // namespace isc::d2
-}; // namespace isc
-
-#endif
index e1afa6778e1d5b21198dc7df3882a5409275d61a..75333bff5670d3b5910cdc631d61efae2b0de49b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -15,9 +15,9 @@
 #ifndef D2_CFG_MGR_H
 #define D2_CFG_MGR_H
 
+#include <asiolink/io_service.h>
 #include <cc/data.h>
 #include <exceptions/exceptions.h>
-#include <d2/d2_asio.h>
 #include <d2/d_cfg_mgr.h>
 #include <d2/d2_config.h>
 
index bde1217b315651b71cc6a0d88f14d5ae0b6d8c0d..5e4f204f690ded42bebc710a3853c2a5a96452c8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -15,8 +15,8 @@
 #ifndef D2_CONFIG_H
 #define D2_CONFIG_H
 
+#include <asiolink/io_service.h>
 #include <cc/data.h>
-#include <d2/d2_asio.h>
 #include <d2/d_cfg_mgr.h>
 #include <dhcpsrv/parsers/dhcp_parsers.h>
 #include <dns/tsig.h>
index c31dc674e02cb83f6bd34e26de0109daba146c3f..970543bccd381c039380bec00dce16f7ab48a4eb 100644 (file)
@@ -26,7 +26,7 @@ namespace d2 {
 // be configurable.
 const unsigned int D2Process::QUEUE_RESTART_PERCENT =  80;
 
-D2Process::D2Process(const char* name, IOServicePtr io_service)
+D2Process::D2Process(const char* name, asiolink::IOServicePtr io_service)
     : DProcessBase(name, io_service, DCfgMgrBasePtr(new D2CfgMgr())),
      reconf_queue_flag_(false), shutdown_type_(SD_NORMAL) {
 
@@ -101,7 +101,7 @@ D2Process::runIO() {
     // service.  Secondly, asiolink::IOService does not provide the poll
     // method.  This is a handy method which runs all ready handlers without
     // blocking.
-    IOServicePtr& io = getIoService();
+    asiolink::IOServicePtr& io = getIoService();
     asio::io_service& asio_io_service  = io->get_io_service();
 
     // Poll runs all that are ready. If none are ready it returns immediately
index 5c76af572c56c74ae4458bc79a032a08c622dcc3..96d860e299e3fb8288a117f74e396f35e9d941e8 100644 (file)
@@ -66,7 +66,7 @@ public:
     /// asynchronous event handling.
     ///
     /// @throw DProcessBaseError is io_service is NULL.
-    D2Process(const char* name, IOServicePtr io_service);
+    D2Process(const char* name, asiolink::IOServicePtr io_service);
 
     /// @brief Called after instantiation to perform initialization unique to
     /// D2.
index 54c88a0e814824ddb415166ae5d0f0ec3704f43c..25f792ec91c89ea245c546104e96f06b62fb7458 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -22,7 +22,7 @@ namespace d2 {
 // Makes constant visible to Google test macros.
 const size_t D2QueueMgr::MAX_QUEUE_DEFAULT;
 
-D2QueueMgr::D2QueueMgr(IOServicePtr& io_service, const size_t max_queue_size)
+D2QueueMgr::D2QueueMgr(asiolink::IOServicePtr& io_service, const size_t max_queue_size)
     : io_service_(io_service), max_queue_size_(max_queue_size),
       mgr_state_(NOT_INITTED), target_stop_state_(NOT_INITTED) {
     if (!io_service_) {
index c9b0298c86d76fd11adcff8591f79ab9800a1a1c..58ddce1c368499236fc40b22784be9f85b1ede6c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013, 2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -17,8 +17,8 @@
 
 /// @file d2_queue_mgr.h This file defines the class D2QueueMgr.
 
+#include <asiolink/io_service.h>
 #include <exceptions/exceptions.h>
-#include <d2/d2_asio.h>
 #include <dhcp_ddns/ncr_msg.h>
 #include <dhcp_ddns/ncr_io.h>
 
@@ -165,7 +165,7 @@ public:
     /// This value must be greater than zero. It defaults to MAX_QUEUE_DEFAULT.
     ///
     /// @throw D2QueueMgrError if max_queue_size is zero.
-    D2QueueMgr(IOServicePtr& io_service,
+    D2QueueMgr(asiolink::IOServicePtr& io_service,
                const size_t max_queue_size = MAX_QUEUE_DEFAULT);
 
     /// @brief Destructor
@@ -327,7 +327,7 @@ public:
     void updateStopState();
 
     /// @brief IOService that our listener should use for IO management.
-    IOServicePtr io_service_;
+    asiolink::IOServicePtr io_service_;
 
     /// @brief Dictates the maximum number of entries allowed in the queue.
     size_t max_queue_size_;
index 7b0438dc9665c8dfa9fc94484a08f49259aba39b..da84945b26493595ba0553caf24cd2ca121c3bab 100644 (file)
@@ -26,7 +26,7 @@ namespace d2 {
 const size_t D2UpdateMgr::MAX_TRANSACTIONS_DEFAULT;
 
 D2UpdateMgr::D2UpdateMgr(D2QueueMgrPtr& queue_mgr, D2CfgMgrPtr& cfg_mgr,
-                         IOServicePtr& io_service,
+                         asiolink::IOServicePtr& io_service,
                          const size_t max_transactions)
     :queue_mgr_(queue_mgr), cfg_mgr_(cfg_mgr), io_service_(io_service) {
     if (!queue_mgr_) {
index 740efa80192336587715fa31648a6f03eabcff7c..f5f0023bdc7b58870ae35fa3f14035de4ded0a44 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013, 2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -17,8 +17,8 @@
 
 /// @file d2_update_mgr.h This file defines the class D2UpdateMgr.
 
+#include <asiolink/io_service.h>
 #include <exceptions/exceptions.h>
-#include <d2/d2_asio.h>
 #include <d2/d2_log.h>
 #include <d2/d2_queue_mgr.h>
 #include <d2/d2_cfg_mgr.h>
@@ -100,7 +100,7 @@ public:
     /// @throw D2UpdateMgrError if either the queue manager or configuration
     /// managers are NULL, or max transactions is less than one.
     D2UpdateMgr(D2QueueMgrPtr& queue_mgr, D2CfgMgrPtr& cfg_mgr,
-                IOServicePtr& io_service,
+                asiolink::IOServicePtr& io_service,
                 const size_t max_transactions = MAX_TRANSACTIONS_DEFAULT);
 
     /// @brief Destructor
@@ -173,7 +173,7 @@ public:
     /// @brief Gets the D2UpdateMgr's IOService.
     ///
     /// @return returns a reference to the IOService
-    const IOServicePtr& getIOService() {
+    const asiolink::IOServicePtr& getIOService() {
         return (io_service_);
     }
 
@@ -246,7 +246,7 @@ private:
     /// passed into transactions to manager their IO events.
     /// (For future reference, multi-threaded transactions would each use their
     /// own IOService instance.)
-    IOServicePtr io_service_;
+    asiolink::IOServicePtr io_service_;
 
     /// @brief Maximum number of concurrent transactions.
     size_t max_transactions_;
index c1e35c9e0ddc397013f43827da5ab4238fdbe5a7..574162d1409aff8e748ac49e915dcf3bb9b604f0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -15,8 +15,8 @@
 #ifndef D_CONTROLLER_H
 #define D_CONTROLLER_H
 
+#include <asiolink/io_service.h>
 #include <cc/data.h>
-#include <d2/d2_asio.h>
 #include <d2/d2_log.h>
 #include <d2/d_process.h>
 #include <d2/io_service_signal.h>
@@ -320,7 +320,7 @@ protected:
     /// @brief Getter for fetching the controller's IOService
     ///
     /// @return returns a pointer reference to the IOService.
-    IOServicePtr& getIOService() {
+    asiolink::IOServicePtr& getIOService() {
         return (io_service_);
     }
 
@@ -481,7 +481,7 @@ private:
     DProcessBasePtr process_;
 
     /// @brief Shared pointer to an IOService object, used for ASIO operations.
-    IOServicePtr io_service_;
+    asiolink::IOServicePtr io_service_;
 
     /// @brief Set of registered signals to handle.
     util::SignalSetPtr signal_set_;
index 7ba74f9d1a4affea1dd81c4899e51624ac44e381..c24b70e5b3af21d9c82d94ed84c039e9ea4b8088 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013, 2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -15,8 +15,8 @@
 #ifndef D_PROCESS_H
 #define D_PROCESS_H
 
+#include <asiolink/io_service.h>
 #include <cc/data.h>
-#include <d2/d2_asio.h>
 #include <d2/d_cfg_mgr.h>
 
 #include <boost/shared_ptr.hpp>
@@ -69,7 +69,7 @@ public:
     /// configuration parsing.
     ///
     /// @throw DProcessBaseError is io_service is NULL.
-    DProcessBase(const char* app_name, IOServicePtr io_service, 
+    DProcessBase(const char* app_name, asiolink::IOServicePtr io_service, 
                  DCfgMgrBasePtr cfg_mgr)
         : app_name_(app_name), io_service_(io_service), shut_down_flag_(false),
         cfg_mgr_(cfg_mgr) {
@@ -174,7 +174,7 @@ public:
     /// @brief Fetches the controller's IOService.
     ///
     /// @return a reference to the controller's IOService.
-    IOServicePtr& getIoService() {
+    asiolink::IOServicePtr& getIoService() {
         return (io_service_);
     }
 
@@ -199,7 +199,7 @@ private:
     std::string app_name_;
 
     /// @brief The IOService to be used for asynchronous event handling.
-    IOServicePtr io_service_;
+    asiolink::IOServicePtr io_service_;
 
     /// @brief Boolean flag set when shutdown has been requested.
     bool shut_down_flag_;
index d5ea2e8e4a0d83f2cca2f8a752cc0980695ad936..e4c835d93475368b19510c51e983eb253500e41f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -65,7 +65,7 @@ IOSignal::TimerCallback::operator()() {
     return;
 }
 
-IOSignalQueue::IOSignalQueue(IOServicePtr& io_service)
+IOSignalQueue::IOSignalQueue(asiolink::IOServicePtr& io_service)
     : io_service_(io_service), signals_() {
     if (!io_service_) {
         isc_throw(IOSignalError, "IOSignalQueue - io_serivce cannot be NULL");
index 4b5fad8ea9edc5a2192ac99f54d574dbb695f876..8b440d9e8c06029fe0d61017020bf662128bdcbc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -15,7 +15,8 @@
 #ifndef IO_SERVICE_SIGNAL_H
 #define IO_SERVICE_SIGNAL_H
 
-#include <d2/d2_asio.h>
+#include <asiolink/io_service.h>
+#include <asiolink/interval_timer.h>
 #include <exceptions/exceptions.h>
 
 #include <map>
@@ -202,7 +203,7 @@ public:
     ///
     /// @param io_service the IOService to which to send signals.
     /// @throw IOSignalError if io_service is NULL.
-    IOSignalQueue (IOServicePtr& io_service);
+    IOSignalQueue (asiolink::IOServicePtr& io_service);
 
     /// @brief Destructor.
     ~IOSignalQueue();
@@ -248,7 +249,7 @@ public:
 
 private:
     /// @brief Pointer to the IOService which will receive the signals.
-    IOServicePtr io_service_;
+    asiolink::IOServicePtr io_service_;
 
     /// @brief A map of the IOSignals pushed through this queue.
     IOSignalMap signals_;
index 70fff23c9969d39200d0c3b9bddaafbdb8d2e0eb..9135b7ee72f58c43c2aab6c5facf537a0651a6f6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -35,7 +35,7 @@ const int NameAddTransaction::FQDN_IN_USE_EVT;
 const int NameAddTransaction::FQDN_NOT_IN_USE_EVT;
 
 NameAddTransaction::
-NameAddTransaction(IOServicePtr& io_service,
+NameAddTransaction(asiolink::IOServicePtr& io_service,
                    dhcp_ddns::NameChangeRequestPtr& ncr,
                    DdnsDomainPtr& forward_domain,
                    DdnsDomainPtr& reverse_domain,
index 7fcdf1f98dc83fd049eadb1d638d2d9be7c05291..f9b92d57d931da5d6ff79c28065fe31b2e44c464 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013, 2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -91,7 +91,7 @@ public:
     ///
     /// @throw NameAddTransaction error if given request is not a CHG_ADD,
     /// NameChangeTransaction error for base class construction errors.
-    NameAddTransaction(IOServicePtr& io_service,
+    NameAddTransaction(asiolink::IOServicePtr& io_service,
                        dhcp_ddns::NameChangeRequestPtr& ncr,
                        DdnsDomainPtr& forward_domain,
                        DdnsDomainPtr& reverse_domain,
index 224974ad2df95e8997fca4ab262c33d797479c20..325289b4dacfc315aa28130d4c16b5322daa86d2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -32,7 +32,7 @@ const int NameRemoveTransaction::REMOVING_REV_PTRS_ST;
 // Currently NameRemoveTransaction does not define any events.
 
 NameRemoveTransaction::
-NameRemoveTransaction(IOServicePtr& io_service,
+NameRemoveTransaction(asiolink::IOServicePtr& io_service,
                    dhcp_ddns::NameChangeRequestPtr& ncr,
                    DdnsDomainPtr& forward_domain,
                    DdnsDomainPtr& reverse_domain,
index fb79eb495d40bb3f9723b7a5c445a14fe344e581..96a18677bbd3c30a5a4b078bdca64afdf4ca2361 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013, 2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -87,7 +87,7 @@ public:
     ///
     /// @throw NameRemoveTransaction error if given request is not a CHG_REMOVE,
     /// NameChangeTransaction error for base class construction errors.
-    NameRemoveTransaction(IOServicePtr& io_service,
+    NameRemoveTransaction(asiolink::IOServicePtr& io_service,
                           dhcp_ddns::NameChangeRequestPtr& ncr,
                           DdnsDomainPtr& forward_domain,
                           DdnsDomainPtr& reverse_domain,
index da82ab7160a69df996ea74839c9220e7e34d0586..4640eda4923b2fbe0fb003f9b7a8fa4e6b072ea6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -44,7 +44,7 @@ const int NameChangeTransaction::NCT_DERIVED_EVENT_MIN;
 const unsigned int NameChangeTransaction::MAX_UPDATE_TRIES_PER_SERVER;
 
 NameChangeTransaction::
-NameChangeTransaction(IOServicePtr& io_service,
+NameChangeTransaction(asiolink::IOServicePtr& io_service,
                       dhcp_ddns::NameChangeRequestPtr& ncr,
                       DdnsDomainPtr& forward_domain,
                       DdnsDomainPtr& reverse_domain,
index 7f1b62ae68051ba4169bf373ef11c434246e6044..384b76703a6c346469ddeed5db7585c445cf791c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -17,8 +17,8 @@
 
 /// @file nc_trans.h This file defines the class NameChangeTransaction.
 
+#include <asiolink/io_service.h>
 #include <exceptions/exceptions.h>
-#include <d2/d2_asio.h>
 #include <d2/d2_cfg_mgr.h>
 #include <d2/dns_client.h>
 #include <d2/state_model.h>
@@ -174,7 +174,7 @@ public:
     /// @throw NameChangeTransactionError if given an null request,
     /// if forward change is enabled but forward domain is null, if
     /// reverse change is enabled but reverse domain is null.
-    NameChangeTransaction(IOServicePtr& io_service,
+    NameChangeTransaction(asiolink::IOServicePtr& io_service,
                           dhcp_ddns::NameChangeRequestPtr& ncr,
                           DdnsDomainPtr& forward_domain,
                           DdnsDomainPtr& reverse_domain,
@@ -359,7 +359,7 @@ protected:
     /// @brief Fetches the IOService the transaction uses for IO processing.
     ///
     /// @return returns a const pointer to the IOService.
-    const IOServicePtr& getIOService() {
+    const asiolink::IOServicePtr& getIOService() {
         return (io_service_);
     }
 
@@ -523,7 +523,7 @@ public:
 
 private:
     /// @brief The IOService which should be used to for IO processing.
-    IOServicePtr io_service_;
+    asiolink::IOServicePtr io_service_;
 
     /// @brief The NameChangeRequest that the transaction is to fulfill.
     dhcp_ddns::NameChangeRequestPtr ncr_;
index 8f7b188c8e3a7a73dd29e60edbe5a5f4e16cd3d9..60ae635e0332ae048d1f66b5a9b49dc2a8b25eaa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -13,6 +13,7 @@
 // PERFORMANCE OF THIS SOFTWARE.
 
 
+#include <asiolink/io_service.h>
 #include <config/ccsession.h>
 #include <d2/d2_process.h>
 #include <dhcp_ddns/ncr_io.h>
@@ -64,8 +65,9 @@ class D2ProcessTest : public D2Process, public ConfigParseTest {
 public:
 
     /// @brief Constructor
-    D2ProcessTest() : D2Process("d2test",
-                                IOServicePtr(new isc::asiolink::IOService())) {
+    D2ProcessTest() :
+        D2Process("d2test",
+                  asiolink::IOServicePtr(new isc::asiolink::IOService())) {
     }
 
     /// @brief Destructor
@@ -143,7 +145,7 @@ public:
 TEST(D2Process, construction) {
     // Verify that the constructor will fail if given an empty
     // io service.
-    IOServicePtr lcl_io_service;
+    asiolink::IOServicePtr lcl_io_service;
     EXPECT_THROW (D2Process("TestProcess", lcl_io_service), DProcessBaseError);
 
     // Verify that the constructor succeeds with a valid io_service
index a49ab65754c80090d1f5d24589c16b1cf9939933..bb8a93c3761d1b4aa6691543bdd6fea439935749 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013, 2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -12,7 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
-#include <d2/d2_asio.h>
+#include <asiolink/io_service.h>
+#include <asiolink/interval_timer.h>
 #include <d2/d2_queue_mgr.h>
 #include <dhcp_ddns/ncr_udp.h>
 #include <util/time_utilities.h>
@@ -78,7 +79,7 @@ const long TEST_TIMEOUT = 5 * 1000;
 
 /// @brief Tests that construction with max queue size of zero is not allowed.
 TEST(D2QueueMgrBasicTest, construction1) {
-    IOServicePtr io_service;
+    asiolink::IOServicePtr io_service;
 
     // Verify that constructing with null IOServicePtr is not allowed.
     EXPECT_THROW((D2QueueMgr(io_service)), D2QueueMgrError);
@@ -90,7 +91,7 @@ TEST(D2QueueMgrBasicTest, construction1) {
 
 /// @brief Tests default construction works.
 TEST(D2QueueMgrBasicTest, construction2) {
-    IOServicePtr io_service(new isc::asiolink::IOService());
+    asiolink::IOServicePtr io_service(new isc::asiolink::IOService());
 
     // Verify that valid constructor works.
     D2QueueMgrPtr queue_mgr;
@@ -101,7 +102,7 @@ TEST(D2QueueMgrBasicTest, construction2) {
 
 /// @brief Tests construction with custom queue size works properly
 TEST(D2QueueMgrBasicTest, construction3) {
-    IOServicePtr io_service(new isc::asiolink::IOService());
+    asiolink::IOServicePtr io_service(new isc::asiolink::IOService());
 
     // Verify that custom queue size constructor works.
     D2QueueMgrPtr queue_mgr;
@@ -118,7 +119,7 @@ TEST(D2QueueMgrBasicTest, construction3) {
 /// 4. Peek returns the first entry on the queue without altering queue content
 /// 5. Dequeue removes the first entry on the queue
 TEST(D2QueueMgrBasicTest, basicQueue) {
-    IOServicePtr io_service(new isc::asiolink::IOService());
+    asiolink::IOServicePtr io_service(new isc::asiolink::IOService());
 
     // Construct the manager with max queue size set to number of messages
     // we'll use.
@@ -210,7 +211,7 @@ bool checkSendVsReceived(NameChangeRequestPtr sent_ncr,
 class QueueMgrUDPTest : public virtual ::testing::Test,
                         NameChangeSender::RequestSendHandler {
 public:
-    IOServicePtr io_service_;
+    asiolink::IOServicePtr io_service_;
     NameChangeSenderPtr   sender_;
     isc::asiolink::IntervalTimer test_timer_;
     D2QueueMgrPtr queue_mgr_;
index 9718a4ae88afd0c574a5f1f7bfb4b67a276ecd1f..fd96bc54f3267be59dc1dcf8e5d09479710cd6a1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -12,7 +12,7 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
-#include <d2/d2_asio.h>
+#include <asiolink/io_service.h>
 #include <d2/d2_update_mgr.h>
 #include <util/time_utilities.h>
 #include <d_test_stubs.h>
@@ -42,7 +42,7 @@ public:
     ///
     /// Parameters match those needed by D2UpdateMgr.
     D2UpdateMgrWrapper(D2QueueMgrPtr& queue_mgr, D2CfgMgrPtr& cfg_mgr,
-                       IOServicePtr& io_service,
+                       asiolink::IOServicePtr& io_service,
                        const size_t max_transactions = MAX_TRANSACTIONS_DEFAULT)
         : D2UpdateMgr(queue_mgr, cfg_mgr, io_service, max_transactions) {
     }
@@ -250,7 +250,7 @@ public:
 /// 4. Default construction works and max transactions is defaulted properly
 /// 5. Construction with custom max transactions works properly
 TEST(D2UpdateMgr, construction) {
-    IOServicePtr io_service(new isc::asiolink::IOService());
+    asiolink::IOServicePtr io_service(new isc::asiolink::IOService());
     D2QueueMgrPtr queue_mgr;
     D2CfgMgrPtr cfg_mgr;
     D2UpdateMgrPtr update_mgr;
index 1cc215255f15be70d8e5359e3eaacde4e1581e94..1a317ebffda8271b8f37b76151528e18d174c130 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -12,6 +12,7 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <asiolink/io_service.h>
 #include <d2/d2_log.h>
 #include <d2/spec_config.h>
 #include <d2/tests/d_test_stubs.h>
@@ -51,7 +52,7 @@ SimFailure::FailureType SimFailure::failure_type_ = SimFailure::ftNoFailure;
 // Define custom process command supported by DStubProcess.
 const char*  DStubProcess::stub_proc_command_("cool_proc_cmd");
 
-DStubProcess::DStubProcess(const char* name, IOServicePtr io_service)
+DStubProcess::DStubProcess(const char* name, asiolink::IOServicePtr io_service)
     : DProcessBase(name, io_service, DCfgMgrBasePtr(new DStubCfgMgr())) {
 };
 
@@ -72,7 +73,7 @@ DStubProcess::run() {
     // To use run(), the "managing" layer must issue an io_service::stop
     // or the call to run will continue to block, and shutdown will not
     // occur.
-    IOServicePtr& io_service = getIoService();
+    asiolink::IOServicePtr& io_service = getIoService();
     while (!shouldShutdown()) {
         try {
             io_service->run_one();
index f45b8fc35e415a45512acbec3b9b1f0ce1e600ff..23d4efcd29f2358da40d98fa212999f5b7191768 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
 #ifndef D_TEST_STUBS_H
 #define D_TEST_STUBS_H
 
+#include <asiolink/io_service.h>
+
 #include <cc/data.h>
 #include <cc/session.h>
 #include <config/ccsession.h>
 
-#include <d2/d2_asio.h>
 #include <d2/d_controller.h>
 #include <d2/d_cfg_mgr.h>
 
@@ -128,7 +129,7 @@ public:
     /// asynchronous event handling.
     ///
     /// @throw DProcessBaseError is io_service is NULL.
-    DStubProcess(const char* name, IOServicePtr io_service);
+    DStubProcess(const char* name, asiolink::IOServicePtr io_service);
 
     /// @brief Invoked after process instantiation to perform initialization.
     /// This implementation supports simulating an error initializing the
@@ -423,7 +424,7 @@ public:
     /// @brief Gets the Controller's IOService.
     ///
     /// @return returns a reference to the IOService
-    IOServicePtr& getIOService() {
+    asiolink::IOServicePtr& getIOService() {
         return (getController()->io_service_);
     }
 
index cd2cba5cc8472ef4349de7580b83f2a61bacdc0e..4d06c2122aab7e8ed0ab97390b3fc9ff8b7fbaf6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -12,6 +12,7 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <asiolink/io_service.h>
 #include <d_test_stubs.h>
 #include <d2/io_service_signal.h>
 
@@ -29,7 +30,7 @@ namespace d2 {
 class IOSignalTest : public ::testing::Test {
 public:
     /// @brief IOService instance to process IO.
-    IOServicePtr io_service_;
+    asiolink::IOServicePtr io_service_;
     /// @brief Failsafe timer to ensure test(s) do not hang.
     isc::asiolink::IntervalTimer test_timer_;
     /// @brief Maximum time should be allowed to run.
@@ -137,7 +138,7 @@ void dummyHandler(IOSignalId) {
 
 // Tests IOSignal constructor.
 TEST(IOSignal, construction) {
-    IOServicePtr io_service(new asiolink::IOService());
+    asiolink::IOServicePtr io_service(new asiolink::IOService());
     IOSignalPtr signal;
     IOSignalPtr signal2;
 
@@ -169,7 +170,7 @@ TEST(IOSignal, construction) {
 // Tests IOSignalQueue constructors and exercises queuing methods.
 TEST(IOSignalQueue, constructionAndQueuing) {
     IOSignalQueuePtr queue;
-    IOServicePtr io_service;
+    asiolink::IOServicePtr io_service;
 
     // Verify constructing with an empty IOService will throw.
     ASSERT_THROW(queue.reset(new IOSignalQueue(io_service)), IOSignalError);
index 51950a9e1a4bc680daf24614a4566dc91df6d53c..dc506dea9f09bce3ad966c16847e10c353f3ec46 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015  Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -12,6 +12,7 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <asiolink/io_service.h>
 #include <d2/d2_cfg_mgr.h>
 #include <d2/d2_cfg_mgr.h>
 #include <d2/nc_add.h>
@@ -32,7 +33,7 @@ namespace {
 // to protected methods.
 class NameAddStub : public NameAddTransaction {
 public:
-    NameAddStub(IOServicePtr& io_service,
+    NameAddStub(asiolink::IOServicePtr& io_service,
                 dhcp_ddns::NameChangeRequestPtr& ncr,
                 DdnsDomainPtr& forward_domain,
                 DdnsDomainPtr& reverse_domain,
@@ -266,7 +267,7 @@ public:
 /// 1. Construction with invalid type of request
 /// 2. Valid construction functions properly
 TEST(NameAddTransaction, construction) {
-    IOServicePtr io_service(new isc::asiolink::IOService());
+    asiolink::IOServicePtr io_service(new isc::asiolink::IOService());
     D2CfgMgrPtr cfg_mgr(new D2CfgMgr());
 
     const char* msg_str =
index 234ca8cf5d401309543724dc0efd7d20cda3904f..61fa394e9c2f77df321196fcdbc7f32bebc55d5f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-201 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -12,6 +12,7 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <asiolink/io_service.h>
 #include <d2/d2_cfg_mgr.h>
 #include <d2/d2_cfg_mgr.h>
 #include <d2/nc_remove.h>
@@ -32,7 +33,7 @@ namespace {
 // to protected methods.
 class NameRemoveStub : public NameRemoveTransaction {
 public:
-    NameRemoveStub(IOServicePtr& io_service,
+    NameRemoveStub(asiolink::IOServicePtr& io_service,
                    dhcp_ddns::NameChangeRequestPtr& ncr,
                    DdnsDomainPtr& forward_domain,
                    DdnsDomainPtr& reverse_domain,
@@ -268,7 +269,7 @@ public:
 /// 1. Construction with invalid type of request
 /// 2. Valid construction functions properly
 TEST(NameRemoveTransaction, construction) {
-    IOServicePtr io_service(new isc::asiolink::IOService());
+    asiolink::IOServicePtr io_service(new isc::asiolink::IOService());
     D2CfgMgrPtr cfg_mgr(new D2CfgMgr());
 
     const char* msg_str =
index 96f14522e3731b7abafeabff1056fd74a9ea6771..04c741fa7cf2166de7cd6f56c133b3509e24653d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -17,6 +17,8 @@
 
 /// @file nc_test_utils.h prototypes for functions related transaction testing.
 
+#include <asiolink/io_service.h>
+#include <asiolink/interval_timer.h>
 #include <d2/nc_trans.h>
 
 #include <asio/ip/udp.hpp>
@@ -138,7 +140,7 @@ public:
 /// valve so tests do not hang.
 class TimedIO  {
 public:
-    IOServicePtr io_service_;
+    asiolink::IOServicePtr io_service_;
     asiolink::IntervalTimer timer_;
     int run_time_;
 
index 1165cfc9ed636bc595f0c510167ac8433ed39fd1..2c480cafed79625f2f25c0ce1d1f421b4973316e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015  Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -12,6 +12,7 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <asiolink/io_service.h>
 #include <asiolink/interval_timer.h>
 #include <d2/nc_trans.h>
 #include <dns/opcode.h>
@@ -59,7 +60,7 @@ public:
     /// @brief Constructor
     ///
     /// Parameters match those needed by NameChangeTransaction.
-    NameChangeStub(IOServicePtr& io_service,
+    NameChangeStub(asiolink::IOServicePtr& io_service,
                    dhcp_ddns::NameChangeRequestPtr& ncr,
                    DdnsDomainPtr& forward_domain,
                    DdnsDomainPtr& reverse_domain,
@@ -367,7 +368,7 @@ public:
 /// requires reverse change.
 /// 4. Valid construction functions properly
 TEST(NameChangeTransaction, construction) {
-    IOServicePtr io_service(new isc::asiolink::IOService());
+    asiolink::IOServicePtr io_service(new isc::asiolink::IOService());
     D2CfgMgrPtr cfg_mgr(new D2CfgMgr());
 
     const char* msg_str =
@@ -396,7 +397,7 @@ TEST(NameChangeTransaction, construction) {
 
     // Verify that construction with a null IOServicePtr fails.
     // @todo Subject to change if multi-threading is implemented.
-    IOServicePtr empty;
+    asiolink::IOServicePtr empty;
     EXPECT_THROW(NameChangeTransaction(empty, ncr,
                                        forward_domain, reverse_domain, cfg_mgr),
                                        NameChangeTransactionError);
index aeec2287d9d7db763e2cee5bc56a73ddf7b6e236..2b7e4d6f959167aace31aed1b3d121f1c6b9cdbc 100644 (file)
@@ -87,6 +87,9 @@ private:
     IOServiceImpl* io_impl_;
 };
 
+/// @brief Defines a smart pointer to an IOService instance.
+typedef boost::shared_ptr<IOService> IOServicePtr;
+
 } // namespace asiolink
 } // namespace isc
 #endif // ASIOLINK_IO_SERVICE_H