00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _IQUERYOPERATOR_H
00012 #define _IQUERYOPERATOR_H
00013
00014 #include "Common.h"
00015 #include "Record.h"
00016 #include "SystemManager.h"
00017 #include "SystemPrinter.h"
00018
00019 #define CASE(x) case x: printf(#x); break;
00020
00021 #define TO_STRING(op) \
00022 {\
00023 switch(op) {\
00024 CASE(EQ_OP)\
00025 CASE(LT_OP)\
00026 CASE(GT_OP)\
00027 CASE(LE_OP)\
00028 CASE(GE_OP)\
00029 CASE(NE_OP)\
00030 CASE(NO_OP)\
00031 }\
00032 }
00033
00046 class IQueryOperator {
00047 public:
00058 virtual ReturnCode openExecution() = 0;
00059
00069 virtual ReturnCode closeExecution() = 0;
00070
00099 virtual ReturnCode getNextRecord(Record* record) = 0;
00100
00106 virtual int getArity() = 0;
00107
00116 virtual void getSchema(RelationAttributeInfo attributes[]) = 0;
00117
00129 virtual void printSubtree(int indent) = 0;
00130
00141 virtual ~IQueryOperator() {};
00142 };
00143
00144 #endif // _IQUERYOPERATOR_H
00145