From 07414c7c359389c6e87cf12d0225a8386fd2d388 Mon Sep 17 00:00:00 2001 From: Guilherme Maciel Ferreira Date: Wed, 13 Apr 2011 10:28:00 +0200 Subject: [PATCH] Using the std namespace within the souce file --- src/config/host.cpp | 16 +++++++++------- src/config/host.h | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/config/host.cpp b/src/config/host.cpp index 498f8bb..82b82a4 100644 --- a/src/config/host.cpp +++ b/src/config/host.cpp @@ -4,11 +4,13 @@ #include +using namespace std; + //----------------------------------------------------------------------------- // Host //----------------------------------------------------------------------------- -Host::Host( std::string address ) : +Host::Host( string address ) : Address( address ), Port( 0 ), IntervalInSec( 0 ), @@ -20,12 +22,12 @@ Host::~Host() { } -std::string Host::get_address() const +string Host::get_address() const { return Address; } -void Host::set_address( const std::string& address ) +void Host::set_address( const string &address ) { BOOST_ASSERT( !address.empty() ); @@ -39,7 +41,7 @@ uint16_t Host::get_port() const void Host::set_port( const uint16_t port ) { - BOOST_ASSERT( ( 0 < port ) && ( port < std::numeric_limits::max() ) ); + BOOST_ASSERT( ( 0 < port ) && ( port < numeric_limits::max() ) ); this->Port = port; } @@ -51,17 +53,17 @@ int Host::get_interval_in_sec() const void Host::set_interval_in_sec( const int interval_in_sec ) { - BOOST_ASSERT( ( 0 < interval_in_sec ) && ( interval_in_sec < std::numeric_limits::max() ) ); + BOOST_ASSERT( ( 0 < interval_in_sec ) && ( interval_in_sec < numeric_limits::max() ) ); this->IntervalInSec = interval_in_sec; } -std::vector Host::get_options() const +vector Host::get_options() const { return Options; } -void Host::set_options( const std::vector &options ) +void Host::set_options( const vector &options ) { BOOST_ASSERT( 0 < options.size() ); diff --git a/src/config/host.h b/src/config/host.h index b828934..e2cee88 100644 --- a/src/config/host.h +++ b/src/config/host.h @@ -19,7 +19,7 @@ public: virtual ~Host(); std::string get_address() const; - void set_address( const std::string& address ); + void set_address( const std::string &address ); uint16_t get_port() const; void set_port( const uint16_t port ); -- 1.7.1