00001 /* 00002 EyeDB Object Database Management System 00003 Copyright (C) 1994-2008 SYSRA 00004 00005 EyeDB is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) any later version. 00009 00010 EyeDB is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library; if not, write to the Free Software 00017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 00018 */ 00019 00020 /* 00021 Author: Eric Viara <viara@sysra.com> 00022 */ 00023 00024 00025 #ifndef _EYEDB_INT32_H 00026 #define _EYEDB_INT32_H 00027 00028 namespace eyedb { 00029 00038 class Int32 : public Basic { 00039 00040 // ----------------------------------------------------------------------- 00041 // Int32 Interface 00042 // ----------------------------------------------------------------------- 00043 public: 00048 Int32(eyedblib::int32 i = 0); 00049 00056 Int32(Database *db, eyedblib::int32 i = 0, const Dataspace *dataspace = 0); 00057 00062 Int32(const Int32 *o); 00063 00068 Int32(const Int32 &o); 00069 00074 virtual Object *clone() const {return new Int32(*this);} 00075 00081 Int32& operator=(const Int32 &o); 00082 00090 Status trace(FILE *fd = stdout, unsigned int flags = 0, const RecMode *recmode = RecMode::FullRecurs) const; 00091 00097 Status setValue(Data data); 00098 00104 Status getValue(Data *data) const; 00105 00110 virtual Int32 *asInt32() {return this;} 00111 00116 virtual const Int32 *asInt32() const {return this;} 00117 00118 // ----------------------------------------------------------------------- 00119 // Int32 Private Part 00120 // ----------------------------------------------------------------------- 00121 private: 00122 Status trace_realize(FILE*, int, unsigned int, const RecMode *) const; 00123 eyedblib::int32 val; 00124 Status create(); 00125 Status update(); 00126 }; 00127 00128 class Int32Ptr : public BasicPtr { 00129 00130 public: 00131 Int32Ptr(Int32 *o = 0) : BasicPtr(o) { } 00132 00133 Int32 *getInt32() {return dynamic_cast<Int32 *>(o);} 00134 const Int32 *getInt32() const {return dynamic_cast<Int32 *>(o);} 00135 00136 Int32 *operator->() {return dynamic_cast<Int32 *>(o);} 00137 const Int32 *operator->() const {return dynamic_cast<Int32 *>(o);} 00138 }; 00139 00140 typedef std::vector<Int32Ptr> Int32PtrVector; 00141 00142 extern Int32Class *Int32_Class; 00143 extern const char int32_class_name[]; 00144 00149 } 00150 00151 #endif