ct_common  1.0.1
Common library for combinatorial testing
src/ct_common/common/constraint_l_xor.cpp
Go to the documentation of this file.
00001 //===----- ct_common/common/constraint_l_xor.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_Xor
00010 //
00011 //===----------------------------------------------------------------------===//
00012 
00013 #include <ct_common/common/constraint_l_xor.h>
00014 
00015 using namespace ct::common;
00016 
00017 Constraint_L_Xor::Constraint_L_Xor(void)
00018   : Constraint_L_Binary() {
00019 }
00020 
00021 Constraint_L_Xor::Constraint_L_Xor(const Constraint_L_Xor &from)
00022   : Constraint_L_Binary(from) {
00023 }
00024 
00025 Constraint_L_Xor &Constraint_L_Xor::operator = (
00026     const Constraint_L_Xor &right) {
00027   Constraint_L_Binary::operator=(right);
00028   return *this;
00029 }
00030 
00031 Constraint_L_Xor::~Constraint_L_Xor(void) {
00032 }
00033 
00034 std::string Constraint_L_Xor::get_class_name(void) const {
00035   return Constraint_L_Xor::class_name();
00036 }
00037 
00038 std::string Constraint_L_Xor::class_name(void) {
00039   return "Constraint_L_Xor";
00040 }
00041 
00042 EvalType_Bool Constraint_L_Xor::evaluate_func(EvalType_Bool val_l, EvalType_Bool val_r) const {
00043   EvalType_Bool tmp_result;
00044   tmp_result.is_valid_ = val_l.is_valid_ && val_r.is_valid_;
00045   if (tmp_result.is_valid_) {
00046     tmp_result.value_ = val_l.value_ != val_r.value_;
00047   }
00048   return tmp_result;
00049 }
00050 
00051 std::string Constraint_L_Xor::get_op_token(void) const {
00052   return "^^";
00053 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines