From: Guilherme Maciel Ferreira Date: Tue, 22 Mar 2011 09:40:55 +0000 (+0100) Subject: Removed Pinger abstract class, thus avoiding the "design ahead" issue X-Git-Tag: v1.0~127 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=ed1931dcd788d08bb34dbe08a90832f1021083c0;p=pingcheck Removed Pinger abstract class, thus avoiding the "design ahead" issue - BoostPinger do not inherit form Pinger anymore - reference from Code Complete 2nd edition, page 146, item "Be suspicious of base classes of which there is only one derived class" --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4ad5443..d76dba3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -16,7 +16,6 @@ set( SOURCES icmp/ipv4header.cpp ping/boostpinger.cpp ping/pinganalyzer.cpp - ping/pinger.cpp ping/pingscheduler.cpp ping/pingstatusnotifier.cpp main.cpp diff --git a/src/ping/boostpinger.h b/src/ping/boostpinger.h index a1bbf12..c1a82ba 100644 --- a/src/ping/boostpinger.h +++ b/src/ping/boostpinger.h @@ -3,8 +3,6 @@ #include -#include "ping/pinger.h" - class IcmpPacket; //----------------------------------------------------------------------------- @@ -13,8 +11,9 @@ class IcmpPacket; /** * @brief This class performs ping to host using Boost Asio. + * Scope: one object per host. */ -class BoostPinger : public Pinger +class BoostPinger { public: BoostPinger( diff --git a/src/ping/pinger.cpp b/src/ping/pinger.cpp deleted file mode 100644 index 0dac09c..0000000 --- a/src/ping/pinger.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "ping/pinger.h" - -//----------------------------------------------------------------------------- -// Pinger -//----------------------------------------------------------------------------- - -Pinger::Pinger() -{ -} - -Pinger::~Pinger() -{ -} diff --git a/src/ping/pinger.h b/src/ping/pinger.h deleted file mode 100644 index a477f00..0000000 --- a/src/ping/pinger.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef PINGER_H -#define PINGER_H - -#include - -//----------------------------------------------------------------------------- -// Pinger -//----------------------------------------------------------------------------- - -class Pinger -{ -public: - Pinger(); - virtual ~Pinger(); - - virtual bool ping( const std::string &destination ) = 0; - -}; - -#endif /* PINGER_H */