FloatClass.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_FLOAT_CLASS_H
00026 #define _EYEDB_FLOAT_CLASS_H
00027 
00028 namespace eyedb {
00029 
00038   class FloatClass : public BasicClass {
00039 
00040     // ----------------------------------------------------------------------
00041     // FloatClass Interface
00042     // ----------------------------------------------------------------------
00043   public:
00048     FloatClass(Database *db = NULL);
00049 
00054     FloatClass(const FloatClass &cl);
00055 
00061     FloatClass& operator=(const FloatClass &cl);
00062 
00067     virtual Object *clone() const {return new FloatClass(*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 FloatClass *asFloatClass() {return this;}
00101 
00106     virtual const FloatClass *asFloatClass() const {return this;}
00107 
00108     // ----------------------------------------------------------------------
00109     // FloatClass Private Part
00110     // ----------------------------------------------------------------------
00111   private:
00112     Status trace_realize(FILE*, int, unsigned int, const RecMode *) const;
00113 
00114     // ----------------------------------------------------------------------
00115     // FloatClass 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 FloatClassPtr : public BasicClassPtr {
00136 
00137   public:
00138     FloatClassPtr(FloatClass *o = 0) : BasicClassPtr(o) { }
00139 
00140     FloatClass *getFloatClass() {return dynamic_cast<FloatClass *>(o);}
00141     const FloatClass *getFloatClass() const {return dynamic_cast<FloatClass *>(o);}
00142 
00143     FloatClass *operator->() {return dynamic_cast<FloatClass *>(o);}
00144     const FloatClass *operator->() const {return dynamic_cast<FloatClass *>(o);}
00145   };
00146 
00147   typedef std::vector<FloatClassPtr> FloatClassPtrVector;
00148 
00153 }
00154 
00155 #endif

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