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

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