From ebf9851488f36eff49e82d516d6fe3a836bb663d Mon Sep 17 00:00:00 2001 From: Guilherme Maciel Ferreira Date: Sat, 5 Nov 2011 12:24:46 -0200 Subject: [PATCH] High Integrity CPP Guideline 3.2.4: An abstract class shall have no public constructors. --- src/host/pinger.h | 7 ++++--- src/icmp/icmpmessage.h | 7 ++++--- src/icmp/icmppacket.h | 7 ++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/host/pinger.h b/src/host/pinger.h index 27c9d1d..3ecbce4 100644 --- a/src/host/pinger.h +++ b/src/host/pinger.h @@ -32,15 +32,16 @@ class Pinger { public: - Pinger(); - virtual ~Pinger(); - virtual void ping( const std::string &destination_ip, const int destination_port, boost::function ping_done_callback ) = 0; +protected: + Pinger(); + virtual ~Pinger(); + }; #endif /* PINGER_H */ diff --git a/src/icmp/icmpmessage.h b/src/icmp/icmpmessage.h index 9301edd..501a0e1 100644 --- a/src/icmp/icmpmessage.h +++ b/src/icmp/icmpmessage.h @@ -24,9 +24,6 @@ class IcmpMessage { public: - IcmpMessage(); - virtual ~IcmpMessage(); - void init( const Icmpv4Type type ); void init( const Icmpv6Type type ); @@ -51,6 +48,10 @@ public: virtual std::istream& read( std::istream &is ) = 0; virtual std::ostream& write( std::ostream &os ) const = 0; +protected: + IcmpMessage(); + virtual ~IcmpMessage(); + }; #endif // ICMP_MESSAGE_H diff --git a/src/icmp/icmppacket.h b/src/icmp/icmppacket.h index a2c1084..72895ec 100644 --- a/src/icmp/icmppacket.h +++ b/src/icmp/icmppacket.h @@ -40,9 +40,6 @@ class IcmpPacket { public: - IcmpPacket(); - virtual ~IcmpPacket(); - virtual bool match_echo_reply( const uint16_t identifier, const uint16_t sequence_number, @@ -63,6 +60,10 @@ public: virtual bool read( std::istream &is ) = 0; virtual void write( std::ostream &os ) const = 0; +protected: + IcmpPacket(); + virtual ~IcmpPacket(); + }; //----------------------------------------------------------------------------- -- 1.7.1