1 /***************************************************************************
2 * Copyright (C) 2007 by www.databasecache.com *
3 * Contact: praba_tuty@databasecache.com *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 ***************************************************************************/
16 #ifndef AGGTABLE_IMPL_H
17 #define AGGTABLE_IMPL_H
20 #include<Transaction.h>
23 #include<CatalogTables.h>
26 #include<DatabaseManagerImpl.h>
40 char fldName
[IDENTIFIER_LENGTH
];
59 class AggTableImpl
:public Table
62 char tblName_
[IDENTIFIER_LENGTH
];
63 void *curTuple
; //holds the current tuple ptr. moved during fetch() calls
67 List aggNodes
; //change this list to some other data structure
68 ListIterator aggNodeIter
;
71 DbRetVal
copyValuesToBindBuffer(void *tuple
);
74 virtual ~AggTableImpl();
75 DbRetVal
getFieldInfo(const char *fieldName
, FieldInfo
*&info
)
76 { return ErrBadCall
; }
79 if (groupFld
.type
== typeUnknown
) return false; else return true;
82 void setTable(Table
*impl
){ tableHdl
= impl
;}
83 Table
* getTableHdl(){ return tableHdl
; }
85 void *getBindFldAddr(const char *name
);
86 DbRetVal
bindFld(const char *name
, void *val
);
87 DbRetVal
bindFld(const char *name
, AggType aggType
, void *val
);
88 DbRetVal
setGroup(const char *name
, void *val
);
89 void setCondition(Condition
*p
){}
90 void markFldNull(const char *name
){}
91 void markFldNull(int colpos
){}
92 bool isFldNull(const char *name
){return false;}
93 bool isFldNull(int colpos
){return false;}
94 void clearFldNull(const char *name
){}
95 void clearFldNull(int colpos
){}
96 void resetNullinfo(){}
97 DbRetVal
insertTuple() { return ErrBadCall
; }
98 DbRetVal
updateTuple() { return ErrBadCall
; }
99 DbRetVal
deleteTuple() { return ErrBadCall
; }
100 int deleteWhere() { return ErrBadCall
; }
101 int truncate() { return ErrBadCall
; }
102 long spaceUsed() { return 0; }
103 int pagesUsed() { return 0; }
104 DbRetVal
lock(bool shared
) { return ErrBadCall
; }
105 DbRetVal
unlock(){ return ErrBadCall
; }
106 DbRetVal
setUndoLogging(bool flag
) { return ErrBadCall
; }
107 void printSQLIndexString(){ };
108 char* getName() { return tableHdl
->getName(); }
109 List
getFieldNameList(){ List list
; return list
;}
112 void* fetch(DbRetVal
&rv
);
114 void* fetchNoBind(DbRetVal
&rv
);