ResolvedIpTtlThreshold( 10 ),
Hosts(),
RatioRandomHosts( 1.0f ),
+ PrintVersion( false ),
RandomNumberGenerator( boost::numeric_cast<unsigned int>(time(0)) )
{
}
void Configuration::set_ratio_random_hosts( const float ratio )
{
BOOST_ASSERT( (ratio > 0.0f) && (ratio <= 1.0f) );
- this->RatioRandomHosts = ratio;
+ RatioRandomHosts = ratio;
}
HostList Configuration::get_hosts() const
void Configuration::set_hosts( const HostList &hosts_list )
{
- this->Hosts = hosts_list;
+ Hosts = hosts_list;
+}
+
+bool Configuration::get_print_version()
+{
+ return PrintVersion;
+}
+
+void Configuration::set_print_version( const bool do_print )
+{
+ PrintVersion = do_print;
}
int Configuration::get_random_number(const int lowest, const int highest)
int get_random_number(const int lowest, const int highest);
+ void set_print_version( const bool do_print );
+ bool get_print_version();
+
bool randomize_hosts();
private:
int ResolvedIpTtlThreshold;
HostList Hosts;
float RatioRandomHosts;
+ bool PrintVersion;
rand_gen_type RandomNumberGenerator;
};
bool VersionOption::parse(
const variables_map& vm,
- Configuration *
+ Configuration *configuration
)
{
// version
- if ( 1 <= vm.count( get_command_string() ) )
- {
- // TODO GlobalOutput::print( version )
- cout << PROJECT_NAME << " version " << VERSION_STRING << endl;
- return true;
- }
+ bool print_version = ( 1<= vm.count( get_command_string() ) );
+ configuration->set_print_version( print_version );
+ GlobalLogger.info() << get_command_string() << "=" << print_version << endl;
return false;
}