ct_common  1.0.1
Common library for combinatorial testing
src/ct_common/common/exp_a.cpp
Go to the documentation of this file.
00001 //===----- ct_common/common/exp_a.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
00010 //
00011 //===----------------------------------------------------------------------===//
00012 
00013 #include <ct_common/common/exp_a.h>
00014 
00015 using namespace ct::common;
00016 
00017 Exp_A::Exp_A(void)
00018   : Exp(), type_(EAT_INT) {
00019 }
00020 
00021 Exp_A::Exp_A(const Exp_A &from)
00022   : Exp(from), type_(from.type_) {
00023 }
00024 
00025 Exp_A &Exp_A::operator = (const Exp_A &right) {
00026   Exp::operator=(right);
00027   this->type_ = right.type_;
00028   return *this;
00029 }
00030 
00031 Exp_A::~Exp_A(void) {
00032 }
00033 
00034 std::string Exp_A::get_class_name(void) const {
00035   return Exp_A::class_name();
00036 }
00037 
00038 std::string Exp_A::class_name(void) {
00039   return "Exp_A";
00040 }
00041 
00042 EvalType_Double Exp_A::EvaluateDouble( const std::vector<boost::shared_ptr<ParamSpec> > &param_specs,
00043                               const Assignment &assignment) const {
00044   if (this->type_ != EAT_DOUBLE) {
00045     CT_EXCEPTION("warning: implicit casting non-double to double");
00046   }
00047   return this->EvaluateDouble_Impl(param_specs, assignment);
00048 }
00049 
00050 EvalType_Int Exp_A::EvaluateInt( const std::vector<boost::shared_ptr<ParamSpec> > &param_specs,
00051                         const Assignment &assignment) const {
00052   if (this->type_ != EAT_INT) {
00053     CT_EXCEPTION("warning: implicit casting non-int to int");
00054   }
00055   return this->EvaluateInt_Impl(param_specs, assignment);
00056 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines