Removed Pinger abstract class, thus avoiding the "design ahead" issue
authorGuilherme Maciel Ferreira <guilherme.maciel.ferreira@intra2net.com>
Tue, 22 Mar 2011 09:40:55 +0000 (10:40 +0100)
committerGuilherme Maciel Ferreira <guilherme.maciel.ferreira@intra2net.com>
Tue, 22 Mar 2011 09:59:47 +0000 (10:59 +0100)
- 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"

src/CMakeLists.txt
src/ping/boostpinger.h
src/ping/pinger.cpp [deleted file]
src/ping/pinger.h [deleted file]

index 4ad5443..d76dba3 100644 (file)
@@ -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
index a1bbf12..c1a82ba 100644 (file)
@@ -3,8 +3,6 @@
 
 #include <boost/asio.hpp>
 
-#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 (file)
index 0dac09c..0000000
+++ /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 (file)
index a477f00..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef PINGER_H
-#define PINGER_H
-
-#include <string>
-
-//-----------------------------------------------------------------------------
-// Pinger
-//-----------------------------------------------------------------------------
-
-class Pinger
-{
-public:
-    Pinger();
-    virtual ~Pinger();
-
-    virtual bool ping( const std::string &destination ) = 0;
-
-};
-
-#endif /* PINGER_H */