bool Builder::setParam( const std::string& param_name, ParamInfo< bool > param, double value, const std::string& name, int lineno ) { param.set( (bool)value ); if( value != 0 && value != 1 ) buildWarning( m_module_name, param_name, "casting from floating point to bool for parameter '" + param_name + "'", name, lineno ); return false; }
bool Builder::setParam( const std::string & param_name, ParamInfo< int > param, double value, const std::string & name, int lineno ) { param.set( (int)value ); if ( value != (int)value ) { buildWarning( m_module_name, param_name, "casting from floating point to integer for parameter '" + param_name + "'", name, lineno ); } return false; }
bool Builder::setParam( const std::string & param_name, ParamInfo< bool > param, int value, const std::string & name, int lineno ) { param.set( (bool)value ); if ( value != 0 && value != 1 ) { buildWarning( m_module_name, param_name, "casting from int to bool for parameter '" + param_name + "'", name, lineno ); } return true; }