ct_common  1.0.1
Common library for combinatorial testing
src/ct_common/common/exp_a_cint.cpp
Go to the documentation of this file.
00001 //===----- ct_common/common/exp_a_cint.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_CInt
00010 //
00011 //===----------------------------------------------------------------------===//
00012 
00013 #include <ct_common/common/exp_a_cint.h>
00014 
00015 using namespace ct::common;
00016 
00017 Exp_A_CInt::Exp_A_CInt(void)
00018     : Exp_A_Atom(), value_(0) {
00019 }
00020 
00021 Exp_A_CInt::Exp_A_CInt(const Exp_A_CInt &from)
00022   : Exp_A_Atom(from), value_(from.value_), str_value_(from.str_value_) {
00023 }
00024 
00025 Exp_A_CInt &Exp_A_CInt::operator = (const Exp_A_CInt &right) {
00026   Exp_A_Atom::operator=(right);
00027   this->value_ = right.value_;
00028   this->str_value_ = right.str_value_;
00029   return *this;
00030 }
00031 
00032 Exp_A_CInt::~Exp_A_CInt(void) {
00033 }
00034 
00035 void Exp_A_CInt::set_value(int value) {
00036   this->value_ = value;
00037 }
00038 
00039 void Exp_A_CInt::set_value(double value) {
00040   this->value_ = (int)value;
00041 }
00042 
00043 EvalType_Double Exp_A_CInt::EvaluateDouble_Impl( const std::vector<boost::shared_ptr<ParamSpec> > &param_specs,
00044                                         const Assignment &assignment) const {
00045   return EvalType_Double(this->value_, true);
00046 }
00047 
00048 EvalType_Int Exp_A_CInt::EvaluateInt_Impl( const std::vector<boost::shared_ptr<ParamSpec> > &param_specs,
00049                                   const Assignment &assignment) const {
00050   return EvalType_Int(this->value_, true);
00051 }
00052 
00053 std::string Exp_A_CInt::get_class_name(void) const {
00054   return Exp_A_CInt::class_name();
00055 }
00056 
00057 std::string Exp_A_CInt::class_name(void) {
00058   return "Exp_A_CInt";
00059 }
00060 
00061 void Exp_A_CInt::set_str_value(const std::string &str_value) {
00062   this->str_value_ = str_value;
00063 }
00064 
00065 const std::string &Exp_A_CInt::get_str_value(void) const {
00066   return this->str_value_;
00067 }
00068 
00069 void Exp_A_CInt::dump(std::ostream &os, const std::vector<boost::shared_ptr<ParamSpec> > &param_specs) const {
00070   os << this->get_str_value();
00071 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines