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