ct_common
1.0.1
Common library for combinatorial testing
|
00001 //===----- ct_common/common/paramspec_int.cpp -------------------*- C++ -*-===// 00002 // 00003 // The ct_common Library 00004 // 00005 // This file is distributed under the MIT license. See LICENSE for details. 00006 // 00007 //===----------------------------------------------------------------------===// 00008 // 00009 // This file contains the function definitions of class ParamSpec_Int 00010 // 00011 //===----------------------------------------------------------------------===// 00012 00013 #include <cstdlib> 00014 #include <ct_common/common/paramspec_int.h> 00015 00016 using namespace ct::common; 00017 00018 ParamSpec_Int::ParamSpec_Int(void) 00019 : ParamSpec() { 00020 } 00021 00022 ParamSpec_Int::ParamSpec_Int(const ParamSpec_Int &from) 00023 : ParamSpec(from), int_values_(from.int_values_) { 00024 } 00025 00026 ParamSpec_Int &ParamSpec_Int::operator = (const ParamSpec_Int &right) { 00027 ParamSpec::operator=(right); 00028 this->int_values_ = right.int_values_; 00029 return (*this); 00030 } 00031 00032 ParamSpec_Int::~ParamSpec_Int(void) { 00033 } 00034 00035 std::string ParamSpec_Int::get_class_name(void) const { 00036 return ParamSpec_Int::class_name(); 00037 } 00038 00039 std::string ParamSpec_Int::class_name(void) { 00040 return "ParamSpec_Int"; 00041 } 00042 00043 void ParamSpec_Int::set_values(const std::vector<std::string> &string_values){ 00044 ParamSpec::set_values(string_values); 00045 for (std::size_t i = 0; i < string_values.size(); ++i) { 00046 this->int_values_.push_back(atoi(string_values[i].c_str())); 00047 } 00048 // now push back the invalid value 00049 this->int_values_.push_back(0); 00050 }