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

Generated on Mon Dec 22 18:16:00 2008 for eyedb by  doxygen 1.5.3