ct_common
1.0.1
Common library for combinatorial testing
|
00001 //===----- ct_common/common/constraint_l_cbool.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 Constraint_L_CBool 00010 // 00011 //===----------------------------------------------------------------------===// 00012 00013 #include <ct_common/common/constraint_l_cbool.h> 00014 00015 using namespace ct::common; 00016 00017 Constraint_L_CBool::Constraint_L_CBool(void) 00018 : Constraint_L_Atom(), value_(false) { 00019 } 00020 00021 Constraint_L_CBool::Constraint_L_CBool(const Constraint_L_CBool &from) 00022 : Constraint_L_Atom(from), value_(from.value_) { 00023 } 00024 00025 Constraint_L_CBool::~Constraint_L_CBool(void) { 00026 } 00027 00028 Constraint_L_CBool &Constraint_L_CBool::operator = (const Constraint_L_CBool &right) { 00029 Constraint_L_Atom::operator =(right); 00030 this->value_ = right.value_; 00031 return *this; 00032 } 00033 00034 std::string Constraint_L_CBool::get_class_name(void) const { 00035 return Constraint_L_CBool::class_name(); 00036 } 00037 00038 std::string Constraint_L_CBool::class_name(void) { 00039 return "Constraint_L_CBool"; 00040 } 00041 00042 const std::string &Constraint_L_CBool::get_str_value(void) const { 00043 static std::string str_true = "true"; 00044 static std::string str_false = "false"; 00045 if (this->value_) { 00046 return str_true; 00047 } 00048 return str_false; 00049 } 00050 00051 EvalType_Bool Constraint_L_CBool::Evaluate(const std::vector<boost::shared_ptr<ParamSpec> > ¶m_specs, 00052 const Assignment &assignment) const { 00053 return EvalType_Bool(this->value_, true); 00054 } 00055 00056 void Constraint_L_CBool::dump(std::ostream &os, const std::vector<boost::shared_ptr<ParamSpec> > ¶m_specs) const { 00057 os << this->get_str_value(); 00058 }