From: Guilherme Maciel Ferreira Date: Mon, 21 Feb 2011 13:27:56 +0000 (+0100) Subject: Merged Host::ip and Host::dns into Host::address. X-Git-Tag: v1.0~198 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=4fa63a2ea2442842759677af7dc8f00d19ee0ee9;p=pingcheck Merged Host::ip and Host::dns into Host::address. --- diff --git a/src/ping/boostpinger.cpp b/src/ping/boostpinger.cpp index 62eceb1..42ebe67 100644 --- a/src/ping/boostpinger.cpp +++ b/src/ping/boostpinger.cpp @@ -50,7 +50,7 @@ BoostPinger::~BoostPinger() void BoostPinger::ping( const Host &host ) { - std::string destination = host.get_ip(); + std::string destination = host.get_address(); // TODO what if it is an DNS? // TODO what about ping multiple hosts? diff --git a/src/ping/host.cpp b/src/ping/host.cpp index 1476a9c..8d45430 100644 --- a/src/ping/host.cpp +++ b/src/ping/host.cpp @@ -1,8 +1,7 @@ #include "host.h" Host::Host( std::string address ) : - ip( "" ), - dns( address ), + address( address ), port( 0 ), interval( 0 ), options() @@ -13,35 +12,36 @@ Host::~Host() { } -std::string Host::get_dns() const +std::string Host::get_address() const { - return dns; + return address; } -void Host::set_dns( std::string dns ) +void Host::set_address( std::string address ) { - this->dns = dns; + this->address = address; } -uint32_t Host::get_interval() const +uint16_t Host::get_port() const { - return interval; + return port; } -void Host::set_interval( uint32_t interval ) +void Host::set_port( uint16_t port ) { - this->interval = interval; + this->port = port; } -std::string Host::get_ip() const +uint32_t Host::get_interval() const { - return ip; + return interval; } -void Host::set_ip( std::string ip ) +void Host::set_interval( uint32_t interval ) { - this->ip = ip; + this->interval = interval; } + std::vector Host::get_options() const { return options; @@ -51,13 +51,3 @@ void Host::set_options( std::vector options ) { this->options = options; } - -uint16_t Host::get_port() const -{ - return port; -} - -void Host::set_port( uint16_t port ) -{ - this->port = port; -} diff --git a/src/ping/host.h b/src/ping/host.h index f07aafb..876f1d4 100644 --- a/src/ping/host.h +++ b/src/ping/host.h @@ -12,24 +12,20 @@ public: Host( std::string address ); virtual ~Host(); - std::string get_dns() const; - void set_dns( std::string dns ); + std::string get_address() const; + void set_address( std::string address ); + + uint16_t get_port() const; + void set_port( uint16_t port ); uint32_t get_interval() const; void set_interval( uint32_t interval ); - std::string get_ip() const; - void set_ip( std::string ip ); - std::vector get_options() const; void set_options( std::vector options ); - uint16_t get_port() const; - void set_port( uint16_t port ); - private: - std::string ip; - std::string dns; + std::string address; uint16_t port; uint32_t interval; std::vector options;