Char.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_H
00026 #define _EYEDB_CHAR_H
00027 
00028 namespace eyedb {
00029 
00038   class Char : public Basic {
00039 
00040     // -----------------------------------------------------------------------
00041     // Char Interface
00042     // -----------------------------------------------------------------------
00043   public:
00048     Char(char c = 0);
00049 
00056     Char(Database *db, char c = 0, const Dataspace *dataspace = 0);
00057 
00062     Char(const Char *o);
00063 
00068     Char(const Char &o);
00069 
00074     virtual Object *clone() const {return new Char(*this);}
00075 
00081     Char& operator=(const Char &o);
00082 
00090     Status trace(FILE *fd = stdout, unsigned int flags = 0, const RecMode *recmode = RecMode::FullRecurs) const;
00091 
00097     Status setValue(Data data);
00098 
00104     Status getValue(Data *data) const;
00105 
00110     virtual Char *asChar() {return this;}
00111 
00116     virtual const Char *asChar() const {return this;}
00117 
00118     // -----------------------------------------------------------------------
00119     // Char Private Part
00120     // -----------------------------------------------------------------------
00121   private:
00122     Status trace_realize(FILE*, int, unsigned int, const RecMode *) const;
00123     char val;
00124     Status create();
00125     Status update();
00126   };
00127 
00128   class CharPtr : public BasicPtr {
00129 
00130   public:
00131     CharPtr(Char *o = 0) : BasicPtr(o) { }
00132 
00133     Char *getChar() {return dynamic_cast<Char *>(o);}
00134     const Char *getChar() const {return dynamic_cast<Char *>(o);}
00135 
00136     Char *operator->() {return dynamic_cast<Char *>(o);}
00137     const Char *operator->() const {return dynamic_cast<Char *>(o);}
00138   };
00139 
00140   typedef std::vector<CharPtr> CharPtrVector;
00141 
00142   extern CharClass    *Char_Class;
00143   extern const char char_class_name[];
00144 
00149 }
00150 
00151 #endif

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