ct_common  1.0.1
Common library for combinatorial testing
src/ct_common/common/constraint_l_binary.cpp
Go to the documentation of this file.
00001 //===----- ct_common/common/constraint_l_binary.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_Binary
00010 //
00011 //===----------------------------------------------------------------------===//
00012 
00013 #include <ct_common/common/constraint_l_binary.h>
00014 #include <ct_common/common/arithmetic_utils.h>
00015 
00016 using namespace ct::common;
00017 
00018 Constraint_L_Binary::Constraint_L_Binary(void)
00019     : Constraint_L() {
00020   this->oprds_.resize(2);
00021 }
00022 
00023 Constraint_L_Binary::Constraint_L_Binary(const Constraint_L_Binary &from)
00024   : Constraint_L(from) {
00025 }
00026 
00027 Constraint_L_Binary &Constraint_L_Binary::operator = (const Constraint_L_Binary &right) {
00028   Constraint_L::operator=(right);
00029   return *this;
00030 }
00031 
00032 Constraint_L_Binary::~Constraint_L_Binary(void) {
00033 }
00034 
00035 std::string Constraint_L_Binary::get_class_name(void) const {
00036   return Constraint_L_Binary::class_name();
00037 }
00038 
00039 std::string Constraint_L_Binary::class_name(void) {
00040   return "Constraint_L_Binary";
00041 }
00042 
00043 EvalType_Bool Constraint_L_Binary::Evaluate( const std::vector<boost::shared_ptr<ParamSpec> > &param_specs,
00044                                     const Assignment &assignment) const {
00045   EvalType_Bool l_val, r_val;
00046   l_val = this->get_loprd()->Evaluate(param_specs, assignment);
00047   r_val = this->get_roprd()->Evaluate(param_specs, assignment);
00048   return this->evaluate_func(l_val, r_val);
00049 }
00050 
00051 void Constraint_L_Binary::dump(std::ostream &os, const std::vector<boost::shared_ptr<ParamSpec> > &param_specs) const {
00052   os << "(";
00053   this->get_loprd()->dump(os, param_specs);
00054   os << this->get_op_token();
00055   this->get_roprd()->dump(os, param_specs);
00056   os << ")";
00057 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines