OQL.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_OQL_H
00026 #define _EYEDB_OQL_H
00027 
00028 namespace eyedb {
00029 
00038   class OQL {
00039 
00040     // ----------------------------------------------------------------------
00041     // OQL Interface
00042     // ----------------------------------------------------------------------
00043   public:
00049     OQL(Database *db, const char *fmt, ...);
00050 
00056     OQL(Connection *conn, const char *fmt, ...);
00057 
00062     Status execute();
00063 
00069     Status execute(Value &value);
00070 
00071     // get flattened results
00072 
00079     Status execute(ObjectPtrVector &obj_vect,
00080                    const RecMode *recmode = RecMode::NoRecurs);
00081 
00088     Status execute(ObjectArray &obj_array,
00089                    const RecMode *recmode = RecMode::NoRecurs);
00090 
00096     Status execute(OidArray &oid_array);
00097 
00103     Status execute(ValueArray &val_array);
00104 
00110     Status getResult(Value &value);
00111 
00112     // get flattened results
00113 
00120     Status getResult(ObjectPtrVector &obj_vect,
00121                      const RecMode *recmode = RecMode::NoRecurs);
00122 
00129     Status getResult(ObjectArray &obj_array,
00130                      const RecMode *recmode = RecMode::NoRecurs);
00131 
00137     Status getResult(OidArray &oid_array);
00138 
00144     Status getResult(ValueArray &val_array);
00145 
00150     Database *getDatabase() {return db;}
00151 
00152     ~OQL();
00153 
00154     // ----------------------------------------------------------------------
00155     // OQL Private Part
00156     // ----------------------------------------------------------------------
00157   private:
00158     char *oql_string;
00159     int qid;
00160     Connection *conn;
00161     Database *db;
00162     Value result_value;
00163     Bool state;
00164     Status oql_status;
00165     void init(Database *);
00166     Bool executed;
00167     Bool value_read;
00168     SchemaInfo *schema_info;
00169     Status getResult();
00170     void init(Connection *, Database *, const char *);
00171     void log_result() const;
00172 
00173   public: /* restricted */
00174     static Status initDatabase(Database *db);
00175   };
00176 
00177 
00182 }
00183 
00184 #endif

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