Int32Class.h

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_CLASS_H
00026 #define _EYEDB_INT32_CLASS_H
00027 
00028 namespace eyedb {
00029 
00038   class Int32Class : public BasicClass {
00039 
00040     // ----------------------------------------------------------------------
00041     // Int32Class Interface
00042     // ----------------------------------------------------------------------
00043 
00044   public:
00049     Int32Class(Database *db = NULL);
00050 
00055     Int32Class(const Int32Class &cl);
00056 
00062     Int32Class& operator=(const Int32Class &cl);
00063 
00068     virtual Object *clone() const {return new Int32Class(*this);}
00069 
00075     Object *newObj(Database *db = NULL) const;
00076 
00083     Object *newObj(Data data, Bool copy = True) const;
00084 
00094     Status traceData(FILE *fd, int indent, Data inidata,
00095                      Data data, TypeModifier *tmod = NULL) const;
00096 
00101     virtual Int32Class *asInt32Class() {return this;}
00102 
00107     virtual const Int32Class *asInt32Class() const {return this;}
00108 
00109     // ----------------------------------------------------------------------
00110     // Int32Class Private Part
00111     // ----------------------------------------------------------------------
00112   private:
00113     Status trace_realize(FILE*, int, unsigned int, const RecMode *) const;
00114 
00115     // ----------------------------------------------------------------------
00116     // Int32Class Restricted Access (conceptually private)
00117     // ----------------------------------------------------------------------
00118   public:
00119     // E_XDR
00120     virtual void decode(void * hdata, // to
00121                         const void * xdata, // from
00122                         Size incsize, // temporarely necessary 
00123                         unsigned int nb = 1) const;
00124 
00125     virtual void encode(void * xdata, // to
00126                         const void * hdata, // from
00127                         Size incsize, // temporarely necessary 
00128                         unsigned int nb = 1) const;
00129 
00130     virtual int cmp(const void * xdata,
00131                     const void * hdata,
00132                     Size incsize, // temporarely necessary 
00133                     unsigned int nb = 1) const;
00134   };
00135 
00136   class Int32ClassPtr : public BasicClassPtr {
00137 
00138   public:
00139     Int32ClassPtr(Int32Class *o = 0) : BasicClassPtr(o) { }
00140 
00141     Int32Class *getInt32Class() {return dynamic_cast<Int32Class *>(o);}
00142     const Int32Class *getInt32Class() const {return dynamic_cast<Int32Class *>(o);}
00143 
00144     Int32Class *operator->() {return dynamic_cast<Int32Class *>(o);}
00145     const Int32Class *operator->() const {return dynamic_cast<Int32Class *>(o);}
00146   };
00147 
00148   typedef std::vector<Int32ClassPtr> Int32ClassPtrVector;
00149 
00154 }
00155 
00156 #endif

Generated on Mon Dec 22 18:15:56 2008 for eyedb by  doxygen 1.5.3