CharClass.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_CHAR_CLASS_H
00026 #define _EYEDB_CHAR_CLASS_H
00027 
00028 namespace eyedb {
00029 
00038   class CharClass : public BasicClass {
00039     // ----------------------------------------------------------------------
00040     // CharClass Interface
00041     // ----------------------------------------------------------------------
00042   public:
00047     CharClass(Database *db = NULL);
00048 
00053     CharClass(const CharClass &cl);
00054 
00059     CharClass& operator=(const CharClass &cl);
00060 
00066     Object *newObj(Database *db = NULL) const;
00067 
00074     Object *newObj(Data data, Bool copy = True) const;
00075 
00085     Status traceData(FILE *fd, int indent, Data inidata,
00086                      Data data, TypeModifier *tmod = NULL) const;
00087 
00092     virtual CharClass *asCharClass() {return this;}
00093 
00098     virtual const CharClass *asCharClass() const {return this;}
00099 
00100     // ----------------------------------------------------------------------
00101     // CharClass Private Part
00102     // ----------------------------------------------------------------------
00103   private:
00104     Status trace_realize(FILE*, int, unsigned int, const RecMode *) const;
00105 
00106     // ----------------------------------------------------------------------
00107     // CharClass Restricted Access (conceptually private)
00108     // ----------------------------------------------------------------------
00109   public:
00110     // E_XDR
00111     virtual void decode(void * hdata, // to
00112                         const void * xdata, // from
00113                         Size incsize, // temporarely necessary 
00114                         unsigned int nb = 1) const;
00115 
00116     virtual void encode(void * xdata, // to
00117                         const void * hdata, // from
00118                         Size incsize, // temporarely necessary 
00119                         unsigned int nb = 1) const;
00120 
00121     virtual int cmp(const void * xdata,
00122                     const void * hdata,
00123                     Size incsize, // temporarely necessary 
00124                     unsigned int nb = 1) const;
00125   };
00126 
00127   class CharClassPtr : public BasicClassPtr {
00128 
00129   public:
00130     CharClassPtr(CharClass *o = 0) : BasicClassPtr(o) { }
00131 
00132     CharClass *getCharClass() {return dynamic_cast<CharClass *>(o);}
00133     const CharClass *getCharClass() const {return dynamic_cast<CharClass *>(o);}
00134 
00135     CharClass *operator->() {return dynamic_cast<CharClass *>(o);}
00136     const CharClass *operator->() const {return dynamic_cast<CharClass *>(o);}
00137   };
00138 
00139   typedef std::vector<CharClassPtr> CharClassPtrVector;
00140 
00145 }
00146 
00147 #endif
00148   

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