]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3405] Moved SignalSet class to util from util:io.
authorMarcin Siodelski <marcin@isc.org>
Wed, 4 Jun 2014 19:42:12 +0000 (21:42 +0200)
committerMarcin Siodelski <marcin@isc.org>
Wed, 4 Jun 2014 19:42:12 +0000 (21:42 +0200)
17 files changed:
configure.ac
src/bin/dhcp4/Makefile.am
src/bin/dhcp4/dhcp4.dox
src/bin/dhcp4/kea_controller.cc
src/bin/dhcp6/Makefile.am
src/bin/dhcp6/dhcp6.dox
src/bin/dhcp6/kea_controller.cc
src/lib/dhcpsrv/Makefile.am
src/lib/dhcpsrv/daemon.h
src/lib/util/Makefile.am
src/lib/util/io/Makefile.am
src/lib/util/io/tests/Makefile.am [deleted file]
src/lib/util/io/tests/run_unittests.cc [deleted file]
src/lib/util/signal_set.cc [moved from src/lib/util/io/signal_set.cc with 98% similarity]
src/lib/util/signal_set.h [moved from src/lib/util/io/signal_set.h with 99% similarity]
src/lib/util/tests/Makefile.am
src/lib/util/tests/signal_set_unittest.cc [moved from src/lib/util/io/tests/signal_set_unittest.cc with 98% similarity]

index 71a2e007dc4b1ebc92d58fd3340c8d852d1c6965..8e6680bb0be2d90c220adbf559b7bc1c67df094e 100644 (file)
@@ -1562,7 +1562,6 @@ AC_CONFIG_FILES([compatcheck/Makefile
                  src/lib/testutils/Makefile
                  src/lib/testutils/testdata/Makefile
                  src/lib/util/io/Makefile
-                 src/lib/util/io/tests/Makefile
                  src/lib/util/Makefile
                  src/lib/util/python/doxygen2pydoc.py
                  src/lib/util/python/gen_wiredata.py
index 139559c0d4fc665ca03d46ef511b77d90cbeed52..c7f7d5c7ed8aa44a9040495e313aa59c1b4c4d56 100644 (file)
@@ -76,7 +76,6 @@ b10_dhcp4_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
 b10_dhcp4_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
 b10_dhcp4_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
 b10_dhcp4_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
-b10_dhcp4_LDADD += $(top_builddir)/src/lib/util/io/libkea-util-io.la
 
 b10_dhcp4dir = $(pkgdatadir)
 b10_dhcp4_DATA = dhcp4.spec
index 664fedf9621c9e32dca501f0214aea4ce52b2f85..353a687e204b18a6f4feb85f8ec46bbce98c6f6d 100644 (file)
@@ -248,7 +248,7 @@ If the reconfiguration fails, the server will continue to run and use the last g
 configuration.
 
 The signal handler for SIGHUP (also for SIGTERM and SIGINT) are installed in the
-kea_controller.cc using the @c isc::util::io::SignalSet class. The
+kea_controller.cc using the @c isc::util::SignalSet class. The
 @c isc::dhcp::Dhcp6Srv calls @c isc::dhcp::Daemon::handleSignal on each pass
 through the main loop. This method fetches the last received signal and calls
 a handler function defined in the kea_controller.cc. The handler function
index bfc4b7ca3f3244b0d039305abe9e15967a7faf7b..017bad5f72bdc300486a7dba46c12a0d6e73f3ab 100644 (file)
@@ -157,7 +157,7 @@ ControlledDhcpv4Srv::init(const std::string& file_name) {
     // Set signal handlers. When the SIGHUP is received by the process
     // the server reconfiguration will be triggered. When SIGTERM or
     // SIGINT will be received, the server will start shutting down.
-    signal_set_.reset(new isc::util::io::SignalSet(SIGINT, SIGHUP, SIGTERM));
+    signal_set_.reset(new isc::util::SignalSet(SIGINT, SIGHUP, SIGTERM));
     // Set the pointer to the handler function.
     signal_handler_ = signalHandler;
 
index 27967e91f8368dd4b07f1cf47ef8b78535335df5..8f0dd76f1240d885b15f25dabba9f8c090d15b40 100644 (file)
@@ -77,7 +77,6 @@ b10_dhcp6_LDADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
 b10_dhcp6_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
 b10_dhcp6_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
 b10_dhcp6_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
-b10_dhcp6_LDADD += $(top_builddir)/src/lib/util/io/libkea-util-io.la
 b10_dhcp6_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
 
 b10_dhcp6dir = $(pkgdatadir)
index 50977558660615c1674bd67688adc79fae07c412..fff4065c902ce62cae78d72e620d65605ffe4ea5 100644 (file)
@@ -280,7 +280,7 @@ If the reconfiguration fails, the server will continue to run and use the last g
 configuration.
 
 The signal handler for SIGHUP (also for SIGTERM and SIGINT) are installed in the
-kea_controller.cc using the @c isc::util::io::SignalSet class. The
+kea_controller.cc using the @c isc::util::SignalSet class. The
 @c isc::dhcp::Dhcp6Srv calls @c isc::dhcp::Daemon::handleSignal on each pass
 through the main loop. This method fetches the last received signal and calls
 a handler function defined in the kea_controller.cc. The handler function
index 7e578c4f6ac96e48d925f9f69d10a8a1b27f1a03..c70cf3bf60c63bd1c1cfa8d4a2ead347886e5628 100644 (file)
@@ -160,7 +160,7 @@ ControlledDhcpv6Srv::init(const std::string& file_name) {
     // Set signal handlers. When the SIGHUP is received by the process
     // the server reconfiguration will be triggered. When SIGTERM or
     // SIGINT will be received, the server will start shutting down.
-    signal_set_.reset(new isc::util::io::SignalSet(SIGINT, SIGHUP, SIGTERM));
+    signal_set_.reset(new isc::util::SignalSet(SIGINT, SIGHUP, SIGTERM));
     // Set the pointer to the handler function.
     signal_handler_ = signalHandler;
 }
index 541e25fa0cea2ed36efd3c254a79cfbe691262a7..6044edcf3e7dcae173451c1adb44964293092b89 100644 (file)
@@ -83,7 +83,6 @@ libkea_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.
 libkea_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/hooks/libkea-hooks.la
 libkea_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/log/libkea-log.la
 libkea_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/util/libkea-util.la
-libkea_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/util/io/libkea-util-io.la
 libkea_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/cc/libkea-cc.la
 libkea_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/hooks/libkea-hooks.la
 
index 09b1c2a93943eae3ad54a157c03baf32d04a2a08..b670c224235648f0d3729842963aa4960b597dfc 100644 (file)
@@ -13,7 +13,7 @@
 // PERFORMANCE OF THIS SOFTWARE.
 
 #include <config.h>
-#include <util/io/signal_set.h>
+#include <util/signal_set.h>
 #include <boost/noncopyable.hpp>
 #include <string>
 
@@ -46,7 +46,7 @@ namespace dhcp {
 /// is assigned to the static object in @c Daemon::init function.
 ///
 /// Classes derived from @c Daemon may install custom signal handlers using
-/// @c isc::util::io::SignalSet class. This base class provides a declaration
+/// @c isc::util::SignalSet class. This base class provides a declaration
 /// of the @c SignalSet object that should be initialized in the derived
 /// classes to install the custom exception handlers.
 ///
@@ -120,7 +120,7 @@ protected:
     ///
     /// This function provides a default implementation for the function
     /// handling next signal received by the process. It checks if a pointer
-    /// to @c isc::util::io::SignalSet object and the signal handler function
+    /// to @c isc::util::SignalSet object and the signal handler function
     /// have been set. If they have been set, the signal handler is invoked for
     /// the the next signal registered in the @c SignalSet object.
     ///
@@ -132,7 +132,7 @@ protected:
     /// This pointer needs to be initialized to point to the @c SignalSet
     /// object in the derived classes which need to handle signals received
     /// by the process.
-    isc::util::io::SignalSetPtr signal_set_;
+    isc::util::SignalSetPtr signal_set_;
 
     /// @brief Pointer to the common signal handler invoked by the handleSignal
     /// function.
@@ -140,7 +140,7 @@ protected:
     /// This pointer needs to be initialized to point to the signal handler
     /// function for signals being handled by the process. If signal handler
     /// it not initialized, the signals will not be handled.
-    isc::util::io::SignalHandler signal_handler_;
+    isc::util::SignalHandler signal_handler_;
 
 private:
 
index ffb84719d52d73abe9483ca4f8941bf415571684..1f47ed3a6c44adfc773d07884befbd4013496a2d 100644 (file)
@@ -31,6 +31,7 @@ if USE_SHARED_MEMORY
 libkea_util_la_SOURCES += memory_segment_mapped.h memory_segment_mapped.cc
 endif
 libkea_util_la_SOURCES += range_utilities.h
+libkea_util_la_SOURCES += signal_set.cc signal_set.h
 libkea_util_la_SOURCES += hash/sha1.h hash/sha1.cc
 libkea_util_la_SOURCES += encode/base16_from_binary.h
 libkea_util_la_SOURCES += encode/base32hex.h encode/base64.h
index c0fae76b1fac037b1fce5f84ed7807184cb02cf0..8a1522d73465d41fc24331c6f946a9a25940aeff 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS = . tests
+SUBDIRS = .
 AM_CXXFLAGS = $(B10_CXXFLAGS)
 
 AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
@@ -7,7 +7,6 @@ AM_CPPFLAGS += $(BOOST_INCLUDES)
 lib_LTLIBRARIES = libkea-util-io.la
 libkea_util_io_la_SOURCES = fd.h fd.cc fd_share.h fd_share.cc
 libkea_util_io_la_SOURCES += socketsession.h socketsession.cc sockaddr_util.h
-libkea_util_io_la_SOURCES += signal_set.cc signal_set.h
 libkea_util_io_la_SOURCES += pktinfo_utilities.h
 libkea_util_io_la_LIBADD = $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
 
diff --git a/src/lib/util/io/tests/Makefile.am b/src/lib/util/io/tests/Makefile.am
deleted file mode 100644 (file)
index d71c28b..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-SUBDIRS = .
-
-AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
-AM_CPPFLAGS += $(BOOST_INCLUDES)
-AM_CXXFLAGS = $(B10_CXXFLAGS)
-
-if USE_STATIC_LINK
-AM_LDFLAGS = -static
-endif
-
-CLEANFILES = *.gcno *.gcda
-
-TESTS_ENVIRONMENT = \
-        $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
-
-TESTS =
-if HAVE_GTEST
-TESTS += run_unittests
-run_unittests_SOURCES  = run_unittests.cc
-run_unittests_SOURCES += signal_set_unittest.cc
-
-run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
-run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
-
-run_unittests_LDADD  = $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
-run_unittests_LDADD += $(top_builddir)/src/lib/util/io/libkea-util-io.la
-run_unittests_LDADD += $(GTEST_LDADD)
-
-endif
-
-noinst_PROGRAMS = $(TESTS)
diff --git a/src/lib/util/io/tests/run_unittests.cc b/src/lib/util/io/tests/run_unittests.cc
deleted file mode 100644 (file)
index 304c652..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (C) 2014  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.
-
-#include <log/logger_support.h>
-#include <gtest/gtest.h>
-
-int
-main(int argc, char* argv[]) {
-    ::testing::InitGoogleTest(&argc, argv);
-    int result = RUN_ALL_TESTS();
-    return (result);
-}
similarity index 98%
rename from src/lib/util/io/signal_set.cc
rename to src/lib/util/signal_set.cc
index b187df69d1cce3d301dac95217d1ef0f79ef25ae..5834c409f2aabd25a4faf59dbccc2f037d392279 100644 (file)
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
-#include <util/io/signal_set.h>
+#include <util/signal_set.h>
 
 #include <cerrno>
 #include <list>
 
 using namespace isc;
-using namespace isc::util::io;
+using namespace isc::util;
 
 namespace {
 
@@ -70,7 +70,6 @@ void internalHandler(int sig) {
 
 namespace isc {
 namespace util {
-namespace io {
 
 SignalSet::SignalSet(const int sig0) {
     add(sig0);
@@ -222,6 +221,5 @@ SignalSet::remove(const int sig) {
     }
 }
 
-} // end of isc::util::io
 } // end of isc::util
 } // end of isc
similarity index 99%
rename from src/lib/util/io/signal_set.h
rename to src/lib/util/signal_set.h
index 5d525595687edd360e5b89b82ce9f13919435083..f561d9c44c4af1c69ac13445c7ff19d841667ecb 100644 (file)
@@ -24,7 +24,6 @@
 
 namespace isc {
 namespace util {
-namespace io {
 
 /// @brief Exception thrown when the @c isc::util::io::SignalSet class
 /// experiences an error.
@@ -181,7 +180,6 @@ private:
     std::set<int> local_signals_;
 };
 
-}
 }
 }
 
index b3019dbefde787afe6990ead264069e31782e907..c4cc086cc44e17fb7c221afd25f762228801f257 100644 (file)
@@ -47,6 +47,7 @@ run_unittests_SOURCES += socketsession_unittest.cc
 run_unittests_SOURCES += strutil_unittest.cc
 run_unittests_SOURCES += time_utilities_unittest.cc
 run_unittests_SOURCES += range_utilities_unittest.cc
+run_unittests_SOURCES += signal_set_unittest.cc
 
 run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
 run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
similarity index 98%
rename from src/lib/util/io/tests/signal_set_unittest.cc
rename to src/lib/util/tests/signal_set_unittest.cc
index 9fcd4fda477ea102f8221a3bc4857a5db7df791f..58bc0d87604f08bb297a2754ec4400301eb962d8 100644 (file)
@@ -12,7 +12,7 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
-#include <util/io/signal_set.h>
+#include <util/signal_set.h>
 #include <boost/bind.hpp>
 #include <boost/shared_ptr.hpp>
 #include <gtest/gtest.h>
@@ -21,9 +21,9 @@
 namespace {
 
 using namespace isc;
-using namespace isc::util::io;
+using namespace isc::util;
 
-/// @brief Test fixture class for @c isc::util::io::SignalSet class.
+/// @brief Test fixture class for @c isc::util::SignalSet class.
 ///
 /// This class contains a handler function which records the signal
 /// being handled. It allows for checking whether the signal set