+#include <boost/assert.hpp>
+#include <climits>
+
#include "host.h"
//-----------------------------------------------------------------------------
return address;
}
-void Host::set_address( std::string address )
+void Host::set_address( const std::string& address )
{
+ BOOST_ASSERT( !address.empty() );
+
this->address = address;
}
return port;
}
-void Host::set_port( uint16_t port )
+void Host::set_port( const uint16_t port )
{
+ BOOST_ASSERT( ( 0 < port ) && ( port < USHRT_MAX ) );
+
this->port = port;
}
return interval;
}
-void Host::set_interval( uint32_t interval )
+void Host::set_interval( const uint32_t interval )
{
+ BOOST_ASSERT( ( 0 < interval ) && ( interval < UINT_MAX ) );
+
this->interval = interval;
}
return options;
}
-void Host::set_options( std::vector<std::string> options )
+void Host::set_options( const std::vector<std::string>& options )
{
this->options = options;
}
virtual ~Host();
std::string get_address() const;
- void set_address( std::string address );
+ void set_address( const std::string& address );
uint16_t get_port() const;
- void set_port( uint16_t port );
+ void set_port( const uint16_t port );
uint32_t get_interval() const;
- void set_interval( uint32_t interval );
+ void set_interval( const uint32_t interval );
std::vector<std::string> get_options() const;
- void set_options( std::vector<std::string> options );
+ void set_options( const std::vector<std::string>& options );
private:
std::string address;