00001 #ifndef _INTVAL_H_ 00002 #define _INTVAL_H_ 00003 00004 #include "DBValue.h" 00005 00006 using namespace std; 00007 00008 00009 class IntVal : public DBValue{ 00010 private: 00011 int val; 00012 public: 00013 IntVal(){val=0;isNull=true;} 00014 IntVal(int i){val=i;isNull=false;} 00015 string getType(){ 00016 return "int"; 00017 } 00018 int getInt(){ 00019 if(isNull) 00020 return 0; 00021 return val; 00022 } 00023 void setInt(int i){val=i;isNull=false;} 00024 string toString(){ 00025 ostringstream oss; 00026 if(isNull) 00027 oss<<""; 00028 else 00029 oss<<val; 00030 return oss.str(); 00031 } 00032 }; 00033 #endif