OQLBE.cc

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 #include "eyedb_p.h"
00027 #include "OQLBE.h"
00028 #include "OQLBEIterator.h"
00029 #include "BEQueue.h"
00030 
00031 namespace eyedb {
00032 
00033 LinkedList *OQLBE::def_cl_list;
00034 
00035 OQLBE::OQLBE(Database *db, DbHandle *dbh, const char *qstr)
00036 {
00037   qiter = new OQLBEIteratorOQL(db, dbh, qstr);
00038 
00039   status = qiter->getStatus();
00040 
00041   if (status == Success)
00042     qid = db->getBEQueue()->addOQL(this);
00043 
00044   schema_info = 0;
00045 }
00046 
00047 Status
00048 OQLBE::getStatus() const
00049 {
00050   return status;
00051 }
00052 
00053 SchemaInfo *
00054 OQLBE::getSchemaInfo()
00055 {
00056   if (!schema_info && qiter)
00057     schema_info = new SchemaInfo(((OQLBEIteratorOQL *)qiter)->
00058                                 getSchemaInfo());
00059   return schema_info;
00060 }
00061 
00062 Status
00063 OQLBE::getResult(Value *value)
00064 {
00065   IDB_CHECK_INTR();
00066 
00067   if (qiter)
00068     return qiter->getResult(value);
00069 
00070   return Success;
00071 }
00072 
00073 
00074 OQLBE::~OQLBE()
00075 {
00076   delete qiter;
00077   delete schema_info;
00078 }
00079 }

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