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_INT64_H 00026 #define _EYEDB_INT64_H 00027 00028 namespace eyedb { 00029 00038 class Int64 : public Basic { 00039 00040 // ----------------------------------------------------------------------- 00041 // Int64 Interface 00042 // ----------------------------------------------------------------------- 00043 public: 00048 Int64(eyedblib::int64 i = 0); 00049 00056 Int64(Database *db, eyedblib::int64 i = 0, const Dataspace *dataspace = 0); 00057 00062 Int64(const Int64 *o); 00063 00068 Int64(const Int64 &o); 00069 00074 virtual Object *clone() const {return new Int64(*this);} 00075 00081 Int64& operator=(const Int64 &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 Int64 *asInt64() {return this;} 00111 00116 virtual const Int64 *asInt64() const {return this;} 00117 00118 // ----------------------------------------------------------------------- 00119 // Int64 Private Part 00120 // ----------------------------------------------------------------------- 00121 private: 00122 Status trace_realize(FILE*, int, unsigned int, const RecMode *) const; 00123 eyedblib::int64 val; 00124 Status create(); 00125 Status update(); 00126 }; 00127 00128 class Int64Ptr : public BasicPtr { 00129 00130 public: 00131 Int64Ptr(Int64 *o = 0) : BasicPtr(o) { } 00132 00133 Int64 *getInt64() {return dynamic_cast<Int64 *>(o);} 00134 const Int64 *getInt64() const {return dynamic_cast<Int64 *>(o);} 00135 00136 Int64 *operator->() {return dynamic_cast<Int64 *>(o);} 00137 const Int64 *operator->() const {return dynamic_cast<Int64 *>(o);} 00138 }; 00139 00140 typedef std::vector<Int64Ptr> Int64PtrVector; 00141 00142 extern Int64Class *Int64_Class; 00143 extern const char int64_class_name[]; 00144 00149 } 00150 00151 #endif