From 7fdcecdb78eb5bf582439ea3670375e96b8cfc34 Mon Sep 17 00:00:00 2001 From: Marcin Siodelski Date: Thu, 1 Dec 2016 14:43:01 +0100 Subject: [PATCH] [5074] Files in libkea-process moved to isc::process namespace. --- src/bin/d2/d2_cfg_mgr.cc | 4 +++- src/bin/d2/d2_cfg_mgr.h | 10 ++++----- src/bin/d2/d2_config.cc | 4 +++- src/bin/d2/d2_config.h | 6 +++--- src/bin/d2/d2_controller.cc | 2 ++ src/bin/d2/d2_controller.h | 6 +++--- src/bin/d2/d2_process.cc | 2 ++ src/bin/d2/d2_process.h | 2 +- src/bin/d2/main.cc | 1 + src/bin/d2/tests/d2_cfg_mgr_unittests.cc | 1 + src/bin/d2/tests/d2_controller_unittests.cc | 1 + src/bin/d2/tests/d2_process_unittests.cc | 1 + src/bin/d2/tests/d2_update_mgr_unittests.cc | 1 + src/lib/process/d_cfg_mgr.cc | 2 +- src/lib/process/d_cfg_mgr.h | 6 +++--- src/lib/process/d_controller.cc | 4 ++-- src/lib/process/d_controller.h | 4 ++-- src/lib/process/d_log.cc | 4 ++-- src/lib/process/d_log.h | 10 ++++----- src/lib/process/d_process.h | 4 ++-- src/lib/process/io_service_signal.cc | 4 ++-- src/lib/process/io_service_signal.h | 21 ++++++++++--------- src/lib/process/process_messages.mes | 2 +- src/lib/process/tests/d_cfg_mgr_unittests.cc | 2 +- .../process/tests/d_controller_unittests.cc | 2 +- .../tests/io_service_signal_unittests.cc | 4 ++-- src/lib/process/testutils/d_test_stubs.cc | 4 ++-- src/lib/process/testutils/d_test_stubs.h | 4 ++-- 28 files changed, 66 insertions(+), 52 deletions(-) diff --git a/src/bin/d2/d2_cfg_mgr.cc b/src/bin/d2/d2_cfg_mgr.cc index 61017839b1..0f30fbfaa4 100644 --- a/src/bin/d2/d2_cfg_mgr.cc +++ b/src/bin/d2/d2_cfg_mgr.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -12,6 +12,8 @@ #include +using namespace isc::process; + namespace isc { namespace d2 { diff --git a/src/bin/d2/d2_cfg_mgr.h b/src/bin/d2/d2_cfg_mgr.h index 3a39786c03..c79b7dd962 100644 --- a/src/bin/d2/d2_cfg_mgr.h +++ b/src/bin/d2/d2_cfg_mgr.h @@ -30,7 +30,7 @@ typedef boost::shared_ptr D2CfgContextPtr; /// and any other DHCP-DDNS specific information that needs to be accessible /// during configuration parsing as well as to the application as a whole. /// It is derived from the context base class, DCfgContextBase. -class D2CfgContext : public DCfgContextBase { +class D2CfgContext : public process::DCfgContextBase { public: /// @brief Constructor D2CfgContext(); @@ -41,8 +41,8 @@ public: /// @brief Creates a clone of this context object. /// /// @return returns a pointer to the new clone. - virtual DCfgContextBasePtr clone() { - return (DCfgContextBasePtr(new D2CfgContext(*this))); + virtual process::DCfgContextBasePtr clone() { + return (process::DCfgContextBasePtr(new D2CfgContext(*this))); } /// @brief Fetches a reference to the D2Params @@ -103,7 +103,7 @@ typedef boost::shared_ptr DdnsDomainListMgrPtr; /// configuration. This includes services for parsing sets of configuration /// values, storing the parsed information in its converted form, /// and retrieving the information on demand. -class D2CfgMgr : public DCfgMgrBase { +class D2CfgMgr : public process::DCfgMgrBase { public: /// @brief Reverse zone suffix added to IPv4 addresses for reverse lookups /// @todo This should be configurable. @@ -294,7 +294,7 @@ protected: /// error. /// /// @return Returns a DCfgContextBasePtr to the new context instance. - virtual DCfgContextBasePtr createNewContext(); + virtual process::DCfgContextBasePtr createNewContext(); }; /// @brief Defines a shared pointer to D2CfgMgr. diff --git a/src/bin/d2/d2_config.cc b/src/bin/d2/d2_config.cc index 7c7088201e..5155a9736d 100644 --- a/src/bin/d2/d2_config.cc +++ b/src/bin/d2/d2_config.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2013-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -20,6 +20,8 @@ #include #include +using namespace isc::process; + namespace isc { namespace d2 { diff --git a/src/bin/d2/d2_config.h b/src/bin/d2/d2_config.h index d890abf19a..b605193c55 100644 --- a/src/bin/d2/d2_config.h +++ b/src/bin/d2/d2_config.h @@ -701,7 +701,7 @@ typedef boost::shared_ptr DdnsDomainListMgrPtr; /// /// This class implements a concrete version of the base class by supplying a /// "clone" method. -class DScalarContext : public DCfgContextBase { +class DScalarContext : public process::DCfgContextBase { public: /// @brief Constructor @@ -715,8 +715,8 @@ public: /// @brief Creates a clone of a DStubContext. /// /// @return returns a pointer to the new clone. - virtual DCfgContextBasePtr clone() { - return (DCfgContextBasePtr(new DScalarContext(*this))); + virtual process::DCfgContextBasePtr clone() { + return (process::DCfgContextBasePtr(new DScalarContext(*this))); } protected: diff --git a/src/bin/d2/d2_controller.cc b/src/bin/d2/d2_controller.cc index 090f5260d4..6ce6006807 100644 --- a/src/bin/d2/d2_controller.cc +++ b/src/bin/d2/d2_controller.cc @@ -12,6 +12,8 @@ #include +using namespace isc::process; + namespace isc { namespace d2 { diff --git a/src/bin/d2/d2_controller.h b/src/bin/d2/d2_controller.h index 437e7c8074..06c3f6ca24 100644 --- a/src/bin/d2/d2_controller.h +++ b/src/bin/d2/d2_controller.h @@ -22,14 +22,14 @@ namespace d2 { /// DControllerBase a templated class but the labor savings versus the /// potential number of virtual methods which may be overridden didn't seem /// worth the clutter at this point. -class D2Controller : public DControllerBase { +class D2Controller : public process::DControllerBase { public: /// @brief Static singleton instance method. This method returns the /// base class singleton instance member. It instantiates the singleton /// and sets the base class instance member upon first invocation. /// /// @return returns the pointer reference to the singleton instance. - static DControllerBasePtr& instance(); + static process::DControllerBasePtr& instance(); /// @brief Destructor. virtual ~D2Controller(); @@ -51,7 +51,7 @@ private: /// Note the caller is responsible for destructing the process. This /// is handled by the base class, which wraps this pointer with a smart /// pointer. - virtual DProcessBase* createProcess(); + virtual process::DProcessBase* createProcess(); /// @brief Constructor is declared private to maintain the integrity of /// the singleton instance. diff --git a/src/bin/d2/d2_process.cc b/src/bin/d2/d2_process.cc index 313296838e..a8a0022237 100644 --- a/src/bin/d2/d2_process.cc +++ b/src/bin/d2/d2_process.cc @@ -11,6 +11,8 @@ #include #include +using namespace isc::process; + namespace isc { namespace d2 { diff --git a/src/bin/d2/d2_process.h b/src/bin/d2/d2_process.h index 49d3841a76..a652b3acbb 100644 --- a/src/bin/d2/d2_process.h +++ b/src/bin/d2/d2_process.h @@ -21,7 +21,7 @@ namespace d2 { /// to receive DNS mapping change requests and carry them out. /// It implements the DProcessBase interface, which structures it such that it /// is a managed "application", controlled by a management layer. -class D2Process : public DProcessBase { +class D2Process : public process::DProcessBase { public: /// @brief Defines the shutdown types supported by D2Process diff --git a/src/bin/d2/main.cc b/src/bin/d2/main.cc index 505fbe2440..a1299bdc41 100644 --- a/src/bin/d2/main.cc +++ b/src/bin/d2/main.cc @@ -14,6 +14,7 @@ #include using namespace isc::d2; +using namespace isc::process; using namespace std; /// This file contains entry point (main() function) for standard DHCP-DDNS diff --git a/src/bin/d2/tests/d2_cfg_mgr_unittests.cc b/src/bin/d2/tests/d2_cfg_mgr_unittests.cc index d8e1072923..3f56dd578a 100644 --- a/src/bin/d2/tests/d2_cfg_mgr_unittests.cc +++ b/src/bin/d2/tests/d2_cfg_mgr_unittests.cc @@ -21,6 +21,7 @@ using namespace std; using namespace isc; using namespace isc::d2; +using namespace isc::process; namespace { diff --git a/src/bin/d2/tests/d2_controller_unittests.cc b/src/bin/d2/tests/d2_controller_unittests.cc index 08084bbe8f..b22a0b48eb 100644 --- a/src/bin/d2/tests/d2_controller_unittests.cc +++ b/src/bin/d2/tests/d2_controller_unittests.cc @@ -18,6 +18,7 @@ #include +using namespace isc::process; using namespace boost::posix_time; namespace isc { diff --git a/src/bin/d2/tests/d2_process_unittests.cc b/src/bin/d2/tests/d2_process_unittests.cc index 965aa0fb54..f5271a885e 100644 --- a/src/bin/d2/tests/d2_process_unittests.cc +++ b/src/bin/d2/tests/d2_process_unittests.cc @@ -22,6 +22,7 @@ using namespace std; using namespace isc; using namespace isc::config; using namespace isc::d2; +using namespace isc::process; using namespace boost::posix_time; namespace { diff --git a/src/bin/d2/tests/d2_update_mgr_unittests.cc b/src/bin/d2/tests/d2_update_mgr_unittests.cc index 883c6fab11..25bfe96fe2 100644 --- a/src/bin/d2/tests/d2_update_mgr_unittests.cc +++ b/src/bin/d2/tests/d2_update_mgr_unittests.cc @@ -23,6 +23,7 @@ using namespace std; using namespace isc; using namespace isc::dhcp_ddns; using namespace isc::d2; +using namespace isc::process; namespace { diff --git a/src/lib/process/d_cfg_mgr.cc b/src/lib/process/d_cfg_mgr.cc index 478d9b597e..21475912c1 100644 --- a/src/lib/process/d_cfg_mgr.cc +++ b/src/lib/process/d_cfg_mgr.cc @@ -30,7 +30,7 @@ using namespace isc::data; using namespace isc::asiolink; namespace isc { -namespace d2 { +namespace process { // *********************** DCfgContextBase ************************* diff --git a/src/lib/process/d_cfg_mgr.h b/src/lib/process/d_cfg_mgr.h index 2a91766522..087fcea315 100644 --- a/src/lib/process/d_cfg_mgr.h +++ b/src/lib/process/d_cfg_mgr.h @@ -1,4 +1,4 @@ -// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2013-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -22,7 +22,7 @@ #endif namespace isc { -namespace d2 { +namespace process { /// @brief Defines a map of ConstElementPtrs keyed by name typedef std::map ElementMap; @@ -403,7 +403,7 @@ private: typedef boost::shared_ptr DCfgMgrBasePtr; -}; // end of isc::d2 namespace +}; // end of isc::process namespace }; // end of isc namespace #endif // D_CFG_MGR_H diff --git a/src/lib/process/d_controller.cc b/src/lib/process/d_controller.cc index 53ccc31142..851b97fe15 100644 --- a/src/lib/process/d_controller.cc +++ b/src/lib/process/d_controller.cc @@ -30,7 +30,7 @@ #include namespace isc { -namespace d2 { +namespace process { DControllerBasePtr DControllerBase::controller_; @@ -498,6 +498,6 @@ DControllerBase::getVersion(bool extended) { return (tmp.str()); } -}; // namespace isc::d2 +}; // namespace isc::process }; // namespace isc diff --git a/src/lib/process/d_controller.h b/src/lib/process/d_controller.h index 92a8001461..51d66c71f3 100644 --- a/src/lib/process/d_controller.h +++ b/src/lib/process/d_controller.h @@ -21,7 +21,7 @@ namespace isc { -namespace d2 { +namespace process { /// @brief Exception thrown when the command line is invalid. class InvalidUsage : public isc::Exception { @@ -508,7 +508,7 @@ private: friend class DControllerTest; }; -}; // namespace isc::d2 +}; // namespace isc::process }; // namespace isc #endif diff --git a/src/lib/process/d_log.cc b/src/lib/process/d_log.cc index 06eec6e35e..f3a2df5ba2 100644 --- a/src/lib/process/d_log.cc +++ b/src/lib/process/d_log.cc @@ -9,11 +9,11 @@ #include namespace isc { -namespace d2 { +namespace process { /// @brief Defines the logger used within libkea-process library. isc::log::Logger dctl_logger("dctl"); -} // namespace d2 +} // namespace process } // namespace isc diff --git a/src/lib/process/d_log.h b/src/lib/process/d_log.h index 6aecd7c471..5a20cf4e1a 100644 --- a/src/lib/process/d_log.h +++ b/src/lib/process/d_log.h @@ -4,20 +4,20 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. -#ifndef D2_LOG_H -#define D2_LOG_H +#ifndef D_LOG_H +#define D_LOG_H #include #include #include namespace isc { -namespace d2 { +namespace process { /// Define the loggers used within libkea-process library. extern isc::log::Logger dctl_logger; -} // namespace d2 +} // namespace process } // namespace isc -#endif // D2_LOG_H +#endif // D_LOG_H diff --git a/src/lib/process/d_process.h b/src/lib/process/d_process.h index 6c317d3963..aae2612de9 100644 --- a/src/lib/process/d_process.h +++ b/src/lib/process/d_process.h @@ -16,7 +16,7 @@ #include namespace isc { -namespace d2 { +namespace process { /// @brief Exception thrown if the process encountered an operational error. class DProcessBaseError : public isc::Exception { @@ -203,7 +203,7 @@ private: /// @brief Defines a shared pointer to DProcessBase. typedef boost::shared_ptr DProcessBasePtr; -}; // namespace isc::d2 +}; // namespace isc::process }; // namespace isc #endif diff --git a/src/lib/process/io_service_signal.cc b/src/lib/process/io_service_signal.cc index 04b0609b74..29e3b0cb0e 100644 --- a/src/lib/process/io_service_signal.cc +++ b/src/lib/process/io_service_signal.cc @@ -9,7 +9,7 @@ #include namespace isc { -namespace d2 { +namespace process { IOSignal::IOSignal (asiolink::IOService& io_service, int signum, IOSignalHandler handler) @@ -112,5 +112,5 @@ IOSignalQueue::clear() { signals_.clear(); } -}; // end of isc::d2 namespace +}; // end of isc::process namespace }; // end of isc namespace diff --git a/src/lib/process/io_service_signal.h b/src/lib/process/io_service_signal.h index 9cf6ced5f6..7f088d6027 100644 --- a/src/lib/process/io_service_signal.h +++ b/src/lib/process/io_service_signal.h @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -15,7 +15,7 @@ #include namespace isc { -namespace d2 { +namespace process { /// @brief Exception thrown if IOSignal encounters an error. class IOSignalError : public isc::Exception { @@ -54,7 +54,7 @@ typedef boost::function IOSignalHandler; /// create the signals, house them until they are delivered, and dequeue them /// so they can be been handled. To generate an IOSignal when an OS signal /// arrives, the process's OS signal handler simply calls @ref -/// isc::d2::IOSignalQueue::pushSignal() with the appropriate values. +/// isc::process::IOSignalQueue::pushSignal() with the appropriate values. /// /// @note that an IOSignalQueue requires a non-null IOServicePtr to construct. /// This ensures that the IOService cannot be destroyed before any pending @@ -63,12 +63,13 @@ typedef boost::function IOSignalHandler; /// one service, each service must have its own queue. /// /// To dequeue the IOSignal inside the caller's IOSignalHandler, one simply -/// invokes @ref isc::d2::IOSignalQueue::popSignal() passing it the sequence_id -/// parameter passed to the handler. This method returns a pointer to -/// instigating IOSignal from which the value of OS signal (i.e. SIGINT, -/// SIGUSR1...) can be obtained. Note that calling popSignal() removes the -/// IOSignalPtr from the queue, which should reduce its reference count to -/// zero upon exiting the handler (unless a delibrate copy of it is made). +/// invokes @ref isc::process::IOSignalQueue::popSignal() passing it the +/// sequence_id parameter passed to the handler. This method returns a +/// pointer to instigating IOSignal from which the value of OS signal (i.e. +/// SIGINT, SIGUSR1...) can be obtained. Note that calling popSignal() +/// removes the IOSignalPtr from the queue, which should reduce its +/// reference count to zero upon exiting the handler (unless a delibrate +/// copy of it is made). /// /// A typical IOSignalHandler might be structured as follows: /// @code @@ -252,7 +253,7 @@ private: typedef boost::shared_ptr IOSignalQueuePtr; -}; // end of isc::d2 namespace +}; // end of isc::process namespace }; // end of isc namespace #endif // IO_SERVICE_SIGNAL_H diff --git a/src/lib/process/process_messages.mes b/src/lib/process/process_messages.mes index c7c1d3b7e3..dbb269778c 100644 --- a/src/lib/process/process_messages.mes +++ b/src/lib/process/process_messages.mes @@ -4,7 +4,7 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -$NAMESPACE isc::d2 +$NAMESPACE isc::process % DCTL_ALREADY_RUNNING %1 already running? %2 This is an error message that occurs when a module encounters a pre-existing diff --git a/src/lib/process/tests/d_cfg_mgr_unittests.cc b/src/lib/process/tests/d_cfg_mgr_unittests.cc index b09a690b75..fe37fe5e6c 100644 --- a/src/lib/process/tests/d_cfg_mgr_unittests.cc +++ b/src/lib/process/tests/d_cfg_mgr_unittests.cc @@ -21,7 +21,7 @@ using namespace std; using namespace isc; using namespace isc::config; -using namespace isc::d2; +using namespace isc::process; using namespace boost::posix_time; namespace { diff --git a/src/lib/process/tests/d_controller_unittests.cc b/src/lib/process/tests/d_controller_unittests.cc index e0595a026d..c76ee9be0c 100644 --- a/src/lib/process/tests/d_controller_unittests.cc +++ b/src/lib/process/tests/d_controller_unittests.cc @@ -18,7 +18,7 @@ using namespace boost::posix_time; namespace isc { -namespace d2 { +namespace process { /// @brief Test fixture class for testing DControllerBase class. This class /// derives from DControllerTest and wraps a DStubController. DStubController diff --git a/src/lib/process/tests/io_service_signal_unittests.cc b/src/lib/process/tests/io_service_signal_unittests.cc index 7c0b4dc55d..e7685485ff 100644 --- a/src/lib/process/tests/io_service_signal_unittests.cc +++ b/src/lib/process/tests/io_service_signal_unittests.cc @@ -15,7 +15,7 @@ #include namespace isc { -namespace d2 { +namespace process { /// @brief Test fixture for testing the use of IOSignals. /// @@ -387,5 +387,5 @@ TEST_F(IOSignalTest, mixedSignals) { EXPECT_EQ(sigusr2_cnt, (stop_at_count_/3)); } -}; // end of isc::d2 namespace +}; // end of isc::process namespace }; // end of isc namespace diff --git a/src/lib/process/testutils/d_test_stubs.cc b/src/lib/process/testutils/d_test_stubs.cc index e1e8ea7599..f643563e9b 100644 --- a/src/lib/process/testutils/d_test_stubs.cc +++ b/src/lib/process/testutils/d_test_stubs.cc @@ -13,7 +13,7 @@ using namespace boost::asio; namespace isc { -namespace d2 { +namespace process { const char* valid_d2_config = "{ " "\"ip-address\" : \"127.0.0.1\" , " @@ -423,5 +423,5 @@ DStubCfgMgr::createConfigParser(const std::string& element_id, return (parser); } -}; // namespace isc::d2 +}; // namespace isc::process }; // namespace isc diff --git a/src/lib/process/testutils/d_test_stubs.h b/src/lib/process/testutils/d_test_stubs.h index 3aaac0237e..83953d4103 100644 --- a/src/lib/process/testutils/d_test_stubs.h +++ b/src/lib/process/testutils/d_test_stubs.h @@ -28,7 +28,7 @@ using namespace boost::posix_time; #include namespace isc { -namespace d2 { +namespace process { /// @brief Provides a valid DHCP-DDNS configuration for testing basic /// parsing fundamentals. @@ -862,7 +862,7 @@ private: /// testing configuration parsing fundamentals. extern const char* valid_d2_config; -}; // namespace isc::d2 +}; // namespace isc::process }; // namespace isc #endif -- 2.47.3