oqliter.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 
00026 class oqmlIterator {
00027   oqmlDotContext *s_dctx;
00028   oqmlAtomList *s_and_ctx;
00029 
00030  protected:
00031   oqmlDotContext *dot_ctx;
00032   Database *db;
00033   oqmlAtom *start, *end;
00034   void *user_data;
00035   oqmlStatus *getValue(oqmlNode *, oqmlContext *, const Oid *, Data,
00036                        Data &, int &, Bool &);
00037   oqmlStatus *evalAnd(oqmlNode *, oqmlContext *, oqmlAtomList *,
00038                       oqmlBool (*)(Data, Bool, const oqmlAtom *,
00039                                    const oqmlAtom *, int, void *),
00040                       oqmlAtomList *);
00041   oqmlStatus *evalAndRealize(oqmlNode *, oqmlContext *, oqmlAtom *,
00042                              oqmlBool (*)(Data, Bool, const oqmlAtom *,
00043                                           const oqmlAtom *, int, void *),
00044                              oqmlAtomList *);
00045   oqmlStatus *begin(oqmlContext *);
00046   void commit(oqmlContext *);
00047 
00048  public:
00049   oqmlIterator(Database *, oqmlDotContext *, oqmlAtom *, oqmlAtom *,
00050               void * = NULL);
00051   virtual oqmlStatus *eval(oqmlNode *, oqmlContext *, oqmlAtomList **) = 0;
00052 };
00053 
00054 class oqmlEqualIterator : public oqmlIterator {
00055 
00056  public:
00057   oqmlEqualIterator(Database *, oqmlDotContext *, oqmlAtom *, oqmlAtom *,
00058                    void * = NULL);
00059   oqmlStatus *eval(oqmlNode *, oqmlContext *, oqmlAtomList **);
00060 };
00061 
00062 class oqmlDiffIterator : public oqmlIterator {
00063 
00064  public:
00065   oqmlDiffIterator(Database *, oqmlDotContext *, oqmlAtom *, oqmlAtom *,
00066                   void * = NULL);
00067   oqmlStatus *eval(oqmlNode *, oqmlContext *, oqmlAtomList **);
00068 };
00069 
00070 class oqmlInfIterator : public oqmlIterator {
00071 
00072  public:
00073   oqmlInfIterator(Database *, oqmlDotContext *, oqmlAtom *, oqmlAtom *,
00074                  void * = NULL);
00075   oqmlStatus *eval(oqmlNode *, oqmlContext *, oqmlAtomList **);
00076 };
00077 
00078 
00079 class oqmlInfEqIterator : public oqmlIterator {
00080 
00081  public:
00082   oqmlInfEqIterator(Database *, oqmlDotContext *, oqmlAtom *, oqmlAtom *,
00083                  void * = NULL);
00084   oqmlStatus *eval(oqmlNode *, oqmlContext *, oqmlAtomList **);
00085 };
00086 
00087 
00088 class oqmlSupIterator : public oqmlIterator {
00089 
00090  public:
00091   oqmlSupIterator(Database *, oqmlDotContext *, oqmlAtom *, oqmlAtom *,
00092                  void * = NULL);
00093   oqmlStatus *eval(oqmlNode *, oqmlContext *, oqmlAtomList **);
00094 };
00095 
00096 
00097 class oqmlSupEqIterator : public oqmlIterator {
00098 
00099  public:
00100   oqmlSupEqIterator(Database *, oqmlDotContext *, oqmlAtom *, oqmlAtom *,
00101                    void * = NULL);
00102   oqmlStatus *eval(oqmlNode *, oqmlContext *, oqmlAtomList **);
00103 };
00104 
00105 
00106 class oqmlBetweenIterator : public oqmlIterator {
00107 
00108  public:
00109   oqmlBetweenIterator(Database *, oqmlDotContext *, oqmlAtom *, oqmlAtom *,
00110                       void * = NULL);
00111   oqmlStatus *eval(oqmlNode *, oqmlContext *, oqmlAtomList **);
00112 };
00113 
00114 class oqmlNotBetweenIterator : public oqmlIterator {
00115 
00116  public:
00117   oqmlNotBetweenIterator(Database *, oqmlDotContext *,
00118                          oqmlAtom *, oqmlAtom *, void * = NULL);
00119   oqmlStatus *eval(oqmlNode *, oqmlContext *, oqmlAtomList **);
00120 };
00121 
00122 class oqmlRegCmpIterator : public oqmlIterator {
00123 
00124  public:
00125   oqmlRegCmpIterator(Database *, oqmlDotContext *, oqmlAtom *, oqmlAtom *,
00126                     void * = NULL);
00127   oqmlStatus *eval(oqmlNode *, oqmlContext *, oqmlAtomList **);
00128 };
00129 
00130 class oqmlRegICmpIterator : public oqmlIterator {
00131 
00132  public:
00133   oqmlRegICmpIterator(Database *, oqmlDotContext *, oqmlAtom *, oqmlAtom *,
00134                      void * = NULL);
00135   oqmlStatus *eval(oqmlNode *, oqmlContext *, oqmlAtomList **);
00136 };
00137 
00138 class oqmlRegDiffIterator : public oqmlIterator {
00139 
00140  public:
00141   oqmlRegDiffIterator(Database *, oqmlDotContext *, oqmlAtom *, oqmlAtom *,
00142                      void * = NULL);
00143   oqmlStatus *eval(oqmlNode *, oqmlContext *, oqmlAtomList **);
00144 };
00145 
00146 class oqmlRegIDiffIterator : public oqmlIterator {
00147 
00148  public:
00149   oqmlRegIDiffIterator(Database *, oqmlDotContext *, oqmlAtom *, oqmlAtom *,
00150                       void * = NULL);
00151   oqmlStatus *eval(oqmlNode *, oqmlContext *, oqmlAtomList **);
00152 };
00153 
00154 class oqmlSubStrIterator : public oqmlIterator {
00155 
00156  public:
00157   oqmlSubStrIterator(Database *, oqmlDotContext *, oqmlAtom *, oqmlAtom *,
00158                      void * = NULL);
00159   oqmlStatus *eval(oqmlNode *, oqmlContext *, oqmlAtomList **);
00160 };
00161 

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