ct_common
1.0.1
Common library for combinatorial testing
|
00001 //===----- ct_common/common/exp_a_unary.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 Exp_A_Unary 00010 // 00011 //===----------------------------------------------------------------------===// 00012 00013 #include <ct_common/common/exp_a_unary.h> 00014 00015 using namespace ct::common; 00016 00017 Exp_A_Unary::Exp_A_Unary(void) 00018 : Exp_A() { 00019 this->oprds_.resize(1); 00020 } 00021 00022 Exp_A_Unary::Exp_A_Unary(const Exp_A_Unary &from) 00023 : Exp_A(from) { 00024 } 00025 00026 Exp_A_Unary &Exp_A_Unary::operator = (const Exp_A_Unary &right) { 00027 Exp_A::operator=(right); 00028 return *this; 00029 } 00030 00031 Exp_A_Unary::~Exp_A_Unary(void) { 00032 } 00033 00034 std::string Exp_A_Unary::get_class_name(void) const { 00035 return Exp_A_Unary::class_name(); 00036 } 00037 00038 std::string Exp_A_Unary::class_name(void) { 00039 return "Exp_A_Unary"; 00040 } 00041 00042 EvalType_Double Exp_A_Unary::EvaluateDouble_Impl(const std::vector<boost::shared_ptr<ParamSpec> > ¶m_specs, 00043 const Assignment &assignment) const { 00044 GET_EXP_VAL(EvalType_Double, oprd_val, this->get_oprd(), param_specs, assignment); 00045 if (oprd_val.is_valid_) { 00046 oprd_val.value_ = this->evaluate_double(oprd_val.value_); 00047 } 00048 return oprd_val; 00049 } 00050 00051 EvalType_Int Exp_A_Unary::EvaluateInt_Impl(const std::vector<boost::shared_ptr<ParamSpec> > ¶m_specs, 00052 const Assignment &assignment) const { 00053 GET_EXP_VAL(EvalType_Int, oprd_val, this->get_oprd(), param_specs, assignment); 00054 if (oprd_val.is_valid_) { 00055 oprd_val.value_ = this->evaluate_int(oprd_val.value_); 00056 } 00057 return oprd_val; 00058 } 00059 00060 void Exp_A_Unary::dump(std::ostream &os, const std::vector<boost::shared_ptr<ParamSpec> > ¶m_specs) const { 00061 os << this->get_op_token(); 00062 this->get_oprd()->dump(os, param_specs); 00063 }