Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

tiny_int.h

Go to the documentation of this file.
00001 #ifndef MYSQLPP_TINY_INT_H
00002 #define MYSQLPP_TINY_INT_H
00003 
00006 
00007 namespace mysqlpp {
00008 
00014 
00015 class tiny_int {
00016   char value;
00017 public:
00018   tiny_int() {}
00019   tiny_int(short int v) : value(char(v)) {}
00020   operator short int() const {return static_cast<short int>(value);};
00021   tiny_int &operator = (short int v) {value = char(v); return *this;}
00022   tiny_int &operator += (short int v) {value += char(v); return *this;}
00023   tiny_int &operator -= (short int v) {value -= char(v); return *this;}
00024   tiny_int &operator *= (short int v) {value *= char(v); return *this;}
00025   tiny_int &operator /= (short int v) {value /= char(v); return *this;}
00026   tiny_int &operator %= (short int v) {value %= char(v); return *this;}
00027   tiny_int &operator &= (short int v) {value &= char(v); return *this;}
00028   tiny_int &operator |= (short int v) {value |= char(v); return *this;}
00029   tiny_int &operator ^= (short int v) {value ^= char(v); return *this;}
00030   tiny_int &operator <<= (short int v) {value <<= char(v); return *this;}
00031   tiny_int &operator >>= (short int v) {value >>= char(v); return *this;}
00032   tiny_int &operator ++ () {value++; return *this;}
00033   tiny_int &operator -- () {value--; return *this;}
00034   tiny_int operator ++ (int) {tiny_int tmp=value; value++; return tmp;}
00035   tiny_int operator -- (int) {tiny_int tmp=value; value--; return tmp;}
00036   tiny_int operator - (const tiny_int& i) const {return value - i;}
00037   tiny_int operator + (const tiny_int& i) const {return value + i;}
00038   tiny_int operator * (const tiny_int& i) const {return value * i;}
00039   tiny_int operator / (const tiny_int& i) const {return value / i;}
00040   tiny_int operator % (const tiny_int& i) const {return value % i;}
00041   tiny_int operator | (const tiny_int& i) const {return value | i;}
00042   tiny_int operator & (const tiny_int& i) const {return value & i;}
00043   tiny_int operator ^ (const tiny_int& i) const {return value ^ i;}
00044   tiny_int operator << (const tiny_int& i) const {return value << i;}
00045   tiny_int operator >> (const tiny_int& i) const {return value >> i;}
00046 };
00047 
00048 } // end namespace mysqlpp
00049 
00050 #endif
00051 

Generated on Thu May 5 05:30:43 2005 for MySQL++ by doxygen1.2.18