From: Guilherme Maciel Ferreira Date: Thu, 18 Aug 2011 02:13:57 +0000 (-0300) Subject: Renamed ChecksumCalculation template to Checksum X-Git-Tag: v1.1^2~14 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=c2e37a431271beea99c8f30a6eee6dcc65ff0dac;p=pingcheck Renamed ChecksumCalculation template to Checksum - The name represents better an object - Also changed the file extension from .h to .hpp, so keep templates with .hpp extension and classes with .h --- diff --git a/src/icmp/checksumcalculator.h b/src/host/checksum.hpp similarity index 87% rename from src/icmp/checksumcalculator.h rename to src/host/checksum.hpp index 00e2e3e..a70dd28 100644 --- a/src/icmp/checksumcalculator.h +++ b/src/host/checksum.hpp @@ -4,29 +4,29 @@ // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#ifndef CHECKSUMCALCULATOR_H -#define CHECKSUMCALCULATOR_H +#ifndef CHECKSUM_HPP +#define CHECKSUM_HPP #include //----------------------------------------------------------------------------- -// ChecksumCalculator +// Checksum //----------------------------------------------------------------------------- /** * @brief Class that provides checksum calculation. */ template -class ChecksumCalculator +class Checksum { public: - ChecksumCalculator( + Checksum( const Iterator &body_begin, const Iterator &body_end ); // TODO common checksum - // The must have a method which returns an aray of works + // The must have a method which returns an array of words // this way the checksum calculator can be used with any ICMP, TCP, UDP... // uint16_t compute( const Message &message ) const // { @@ -47,7 +47,7 @@ private: }; template - ChecksumCalculator::ChecksumCalculator( + Checksum::Checksum( const Iterator &body_begin, const Iterator &body_end ) : @@ -57,7 +57,7 @@ template } template - uint16_t ChecksumCalculator::compute( + uint16_t Checksum::compute( uint8_t type, uint8_t code, uint16_t identifier, @@ -82,4 +82,4 @@ template return checksum; } -#endif /* CHECKSUMCALCULATOR_H */ +#endif // CHECKSUM_HPP diff --git a/src/icmp/icmpchecksumcalculator.h b/src/icmp/icmpchecksumcalculator.h index d46cfa8..d173619 100644 --- a/src/icmp/icmpchecksumcalculator.h +++ b/src/icmp/icmpchecksumcalculator.h @@ -7,13 +7,13 @@ #ifndef ICMPCHECKSUMCALCULATOR_H #define ICMPCHECKSUMCALCULATOR_H -#include "icmp/checksumcalculator.h" +#include "host/checksum.hpp" #include "icmp/icmpdata.h" //----------------------------------------------------------------------------- // IcmpChecksumCalculator //----------------------------------------------------------------------------- -typedef ChecksumCalculator IcmpChecksumCalculator; +typedef Checksum IcmpChecksumCalculator; #endif /* ICMPCHECKSUMCALCULATOR_H */