00001 /*************************************************************************** 00002 * Copyright (C) 2007 by www.databasecache.com * 00003 * Contact: praba_tuty@databasecache.com * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program 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 * 00013 * GNU General Public License for more details. * 00014 * * 00015 ***************************************************************************/ 00016 #ifndef TABLE_H 00017 #define TABLE_H 00018 #include<ErrorType.h> 00019 #include<Util.h> 00020 class Predicate; 00021 class Condition; 00038 class FieldInfo; 00039 class Table 00040 { 00041 public: 00045 virtual void setCondition(Condition *c)=0; 00046 00059 virtual DbRetVal bindFld(const char *name, void *val)=0; 00064 virtual void markFldNull(const char *name)=0; 00068 virtual void markFldNull(int colpos)=0; 00069 00073 virtual void clearFldNull(const char *name)=0; 00074 00078 virtual void clearFldNull(int colpos)=0; 00079 00083 virtual bool isFldNull(const char *name)=0; 00084 00088 virtual bool isFldNull(int colpos)=0; 00089 /* 00090 virtual void clearFldNull(const char *name)=0; 00091 virtual void clearFldNull(int colpos) =0; 00092 */ 00093 00094 //DML operations 00100 virtual DbRetVal execute()=0; 00101 00107 virtual DbRetVal insertTuple()=0; 00108 00114 virtual DbRetVal updateTuple()=0; 00115 00123 virtual DbRetVal deleteTuple()=0; 00124 00125 00130 virtual int deleteWhere()=0; 00131 00132 00133 00139 virtual int truncate()=0; 00140 00141 00142 00143 //scan 00144 00150 virtual void* fetch()=0; 00151 virtual void* fetch(DbRetVal &rv)=0; 00152 00158 virtual void* fetchNoBind()=0; 00159 virtual void* fetchNoBind(DbRetVal &rv)=0; 00160 00161 00167 virtual DbRetVal close()=0; 00168 00172 virtual long spaceUsed()=0; 00173 00177 virtual long numTuples()=0; 00178 00183 virtual DbRetVal lock(bool shared)=0; 00184 00188 virtual DbRetVal unlock()=0; 00189 00193 virtual DbRetVal setUndoLogging(bool flag)=0; 00194 00195 virtual DbRetVal getFieldInfo(const char *fieldName, FieldInfo *&info)=0; 00196 virtual List getFieldNameList()=0; 00197 virtual char* getName()=0; 00198 virtual void printSQLIndexString()=0; 00199 00200 virtual ~Table() { } 00201 }; 00202 #endif