From 5596767bb17476abb53255d6ed804ee6893e9bd3 Mon Sep 17 00:00:00 2001 From: Guilherme Maciel Ferreira Date: Thu, 2 Feb 2012 21:14:54 -0200 Subject: [PATCH] Fix: misspelled class name. - The correct is HostsDownLimitOption instead of HostDownLimitOption. --- src/CMakeLists.txt | 2 +- src/config/configurationoptions.cpp | 6 +- src/config/option/hostdownlimitoption.cpp | 65 --------------------- src/config/option/hostdownlimitoption.h | 48 --------------- src/config/option/hostsdownlimitoption.cpp | 65 +++++++++++++++++++++ src/config/option/hostsdownlimitoption.h | 48 +++++++++++++++ test/CMakeLists.test_configurationcommandline.txt | 2 +- test/CMakeLists.test_configurationfile.txt | 2 +- 8 files changed, 119 insertions(+), 119 deletions(-) delete mode 100644 src/config/option/hostdownlimitoption.cpp delete mode 100644 src/config/option/hostdownlimitoption.h create mode 100644 src/config/option/hostsdownlimitoption.cpp create mode 100644 src/config/option/hostsdownlimitoption.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d578b39..793414f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -46,7 +46,7 @@ set(SOURCES config/option/hostpingprotocoloption.cpp config/option/hostportoption.cpp config/option/hostnameoption.cpp - config/option/hostdownlimitoption.cpp + config/option/hostsdownlimitoption.cpp config/option/linkdownintervaloption.cpp config/option/linkupintervaloption.cpp config/option/nameserveroption.cpp diff --git a/src/config/configurationoptions.cpp b/src/config/configurationoptions.cpp index 8e5f8b9..dd98445 100644 --- a/src/config/configurationoptions.cpp +++ b/src/config/configurationoptions.cpp @@ -29,7 +29,7 @@ #include "config/option/configfileoption.h" #include "config/option/daemonoption.h" -#include "config/option/hostdownlimitoption.h" +#include "config/option/hostsdownlimitoption.h" #include "config/option/hostnameoption.h" #include "config/option/hostportoption.h" #include "config/option/hostpingprotocoloption.h" @@ -73,8 +73,8 @@ ConfigurationOptions::ConfigurationOptions() : ConfigurationOptionItem version( new VersionOption ); GenericOptions.push_back( version ); - ConfigurationOptionItem host_down_limit( new HostDownLimitOption ); - ConfigOptions.push_back( host_down_limit ); + ConfigurationOptionItem hosts_down_limit( new HostsDownLimitOption ); + ConfigOptions.push_back( hosts_down_limit ); ConfigurationOptionItem link_down_interval( new LinkDownIntervalOption ); ConfigOptions.push_back( link_down_interval ); diff --git a/src/config/option/hostdownlimitoption.cpp b/src/config/option/hostdownlimitoption.cpp deleted file mode 100644 index 33c9bc2..0000000 --- a/src/config/option/hostdownlimitoption.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - The software in this package is distributed under the GNU General - Public License version 2 (with a special exception described below). - - A copy of GNU General Public License (GPL) is included in this distribution, - in the file COPYING.GPL. - - As a special exception, if other files instantiate templates or use macros - or inline functions from this file, or you compile this file and link it - with other works to produce a work based on this file, this file - does not by itself cause the resulting work to be covered - by the GNU General Public License. - - However the source code for this file must still be made available - in accordance with section (3) of the GNU General Public License. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. - */ - -#include "config/option/hostdownlimitoption.h" - -#include - -using namespace std; -using boost::program_options::value; -using boost::program_options::variables_map; -using I2n::Logger::GlobalLogger; - -//----------------------------------------------------------------------------- -// HostDownLimitOption -//----------------------------------------------------------------------------- - -HostDownLimitOption::HostDownLimitOption() : - ConfigurationOption( - "hosts-down-limit", - value()->default_value( 0 ), // no host down - "Limit of host that have to be down in order to notify." - ) -{ -} - -HostDownLimitOption::~HostDownLimitOption() -{ -} - -bool HostDownLimitOption::parse( - const variables_map& vm, - Configuration *configuration -) -{ - // hosts-down-limit - if ( 1 <= vm.count( get_command_string() ) ) - { - int host_down_limit = vm[ get_command_string() ].as (); - configuration->set_hosts_down_limit( host_down_limit ); - - GlobalLogger.info() << get_command_string() << "=" - << host_down_limit << endl; - - return true; - } - - return false; -} diff --git a/src/config/option/hostdownlimitoption.h b/src/config/option/hostdownlimitoption.h deleted file mode 100644 index 358962c..0000000 --- a/src/config/option/hostdownlimitoption.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - The software in this package is distributed under the GNU General - Public License version 2 (with a special exception described below). - - A copy of GNU General Public License (GPL) is included in this distribution, - in the file COPYING.GPL. - - As a special exception, if other files instantiate templates or use macros - or inline functions from this file, or you compile this file and link it - with other works to produce a work based on this file, this file - does not by itself cause the resulting work to be covered - by the GNU General Public License. - - However the source code for this file must still be made available - in accordance with section (3) of the GNU General Public License. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. - */ - -#ifndef HOST_DOWN_LIMIT_OPTION_H -#define HOST_DOWN_LIMIT_OPTION_H - -#include - -#include "config/option/configurationoption.h" - -//----------------------------------------------------------------------------- -// HostDownLimitOption -//----------------------------------------------------------------------------- - -/** - * @brief This class represents the "hosts-down-limit" configuration option. - */ -class HostDownLimitOption : public ConfigurationOption -{ -public: - HostDownLimitOption(); - virtual ~HostDownLimitOption(); - - virtual bool parse( - const boost::program_options::variables_map &vm, - Configuration *configuration - ); - -}; - -#endif // HOST_DOWN_LIMIT_OPTION_H diff --git a/src/config/option/hostsdownlimitoption.cpp b/src/config/option/hostsdownlimitoption.cpp new file mode 100644 index 0000000..121af1d --- /dev/null +++ b/src/config/option/hostsdownlimitoption.cpp @@ -0,0 +1,65 @@ +/* + The software in this package is distributed under the GNU General + Public License version 2 (with a special exception described below). + + A copy of GNU General Public License (GPL) is included in this distribution, + in the file COPYING.GPL. + + As a special exception, if other files instantiate templates or use macros + or inline functions from this file, or you compile this file and link it + with other works to produce a work based on this file, this file + does not by itself cause the resulting work to be covered + by the GNU General Public License. + + However the source code for this file must still be made available + in accordance with section (3) of the GNU General Public License. + + This exception does not invalidate any other reasons why a work based + on this file might be covered by the GNU General Public License. + */ + +#include "config/option/hostsdownlimitoption.h" + +#include + +using namespace std; +using boost::program_options::value; +using boost::program_options::variables_map; +using I2n::Logger::GlobalLogger; + +//----------------------------------------------------------------------------- +// HostsDownLimitOption +//----------------------------------------------------------------------------- + +HostsDownLimitOption::HostsDownLimitOption() : + ConfigurationOption( + "hosts-down-limit", + value()->default_value( 0 ), // no host down + "Limit of hosts that have to be down in order to notify." + ) +{ +} + +HostsDownLimitOption::~HostsDownLimitOption() +{ +} + +bool HostsDownLimitOption::parse( + const variables_map& vm, + Configuration *configuration +) +{ + // hosts-down-limit + if ( 1 <= vm.count( get_command_string() ) ) + { + int hosts_down_limit = vm[ get_command_string() ].as (); + configuration->set_hosts_down_limit( hosts_down_limit ); + + GlobalLogger.info() << get_command_string() << "=" + << hosts_down_limit << endl; + + return true; + } + + return false; +} diff --git a/src/config/option/hostsdownlimitoption.h b/src/config/option/hostsdownlimitoption.h new file mode 100644 index 0000000..b1b5a6e --- /dev/null +++ b/src/config/option/hostsdownlimitoption.h @@ -0,0 +1,48 @@ +/* + The software in this package is distributed under the GNU General + Public License version 2 (with a special exception described below). + + A copy of GNU General Public License (GPL) is included in this distribution, + in the file COPYING.GPL. + + As a special exception, if other files instantiate templates or use macros + or inline functions from this file, or you compile this file and link it + with other works to produce a work based on this file, this file + does not by itself cause the resulting work to be covered + by the GNU General Public License. + + However the source code for this file must still be made available + in accordance with section (3) of the GNU General Public License. + + This exception does not invalidate any other reasons why a work based + on this file might be covered by the GNU General Public License. + */ + +#ifndef HOSTS_DOWN_LIMIT_OPTION_H +#define HOSTS_DOWN_LIMIT_OPTION_H + +#include + +#include "config/option/configurationoption.h" + +//----------------------------------------------------------------------------- +// HostsDownLimitOption +//----------------------------------------------------------------------------- + +/** + * @brief This class represents the "hosts-down-limit" configuration option. + */ +class HostsDownLimitOption : public ConfigurationOption +{ +public: + HostsDownLimitOption(); + virtual ~HostsDownLimitOption(); + + virtual bool parse( + const boost::program_options::variables_map &vm, + Configuration *configuration + ); + +}; + +#endif // HOSTS_DOWN_LIMIT_OPTION_H diff --git a/test/CMakeLists.test_configurationcommandline.txt b/test/CMakeLists.test_configurationcommandline.txt index bbbaf00..9bf66b0 100644 --- a/test/CMakeLists.test_configurationcommandline.txt +++ b/test/CMakeLists.test_configurationcommandline.txt @@ -14,7 +14,7 @@ add_executable(test_configurationcommandline ${CMAKE_SOURCE_DIR}/src/config/option/hostpingprotocoloption.cpp ${CMAKE_SOURCE_DIR}/src/config/option/hostportoption.cpp ${CMAKE_SOURCE_DIR}/src/config/option/hostnameoption.cpp - ${CMAKE_SOURCE_DIR}/src/config/option/hostdownlimitoption.cpp + ${CMAKE_SOURCE_DIR}/src/config/option/hostsdownlimitoption.cpp ${CMAKE_SOURCE_DIR}/src/config/option/linkdownintervaloption.cpp ${CMAKE_SOURCE_DIR}/src/config/option/linkupintervaloption.cpp ${CMAKE_SOURCE_DIR}/src/config/option/nameserveroption.cpp diff --git a/test/CMakeLists.test_configurationfile.txt b/test/CMakeLists.test_configurationfile.txt index d042739..1c7e19b 100644 --- a/test/CMakeLists.test_configurationfile.txt +++ b/test/CMakeLists.test_configurationfile.txt @@ -14,7 +14,7 @@ add_executable(test_configurationfile ${CMAKE_SOURCE_DIR}/src/config/option/hostpingprotocoloption.cpp ${CMAKE_SOURCE_DIR}/src/config/option/hostportoption.cpp ${CMAKE_SOURCE_DIR}/src/config/option/hostnameoption.cpp - ${CMAKE_SOURCE_DIR}/src/config/option/hostdownlimitoption.cpp + ${CMAKE_SOURCE_DIR}/src/config/option/hostsdownlimitoption.cpp ${CMAKE_SOURCE_DIR}/src/config/option/linkdownintervaloption.cpp ${CMAKE_SOURCE_DIR}/src/config/option/linkupintervaloption.cpp ${CMAKE_SOURCE_DIR}/src/config/option/nameserveroption.cpp -- 1.7.1