include/Predicate.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2007 by www.databasecache.com                           *
00003  *   Contact:  *   Contact: praba_tuty@databasecache.com                                 *
00004                                      *
00005  *                                                                         *
00006  *   This program is free software; you can redistribute it and/or modify  *
00007  *   it under the terms of the GNU General Public License as published by  *
00008  *   the Free Software Foundation; either version 2 of the License, or     *
00009  *   (at your option) any later version.                                   *
00010  *                                                                         *
00011  *   This program is distributed in the hope that it will be useful,       *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU General Public License for more details.                          *
00015  *                                                                         *
00016   ***************************************************************************/
00017 #ifndef PREDICATE_H
00018 #define PREDICATE_H
00019 #include<DataType.h>
00020 class PredicateImpl;
00021 class Predicate;
00042 class Condition
00043 {
00044     Predicate *pred;
00045     public:
00046     Condition();
00047     ~Condition();
00048     void reset();
00049 
00053     Predicate* getPredicate() { return pred; }
00054 
00058     void setPredicate(Predicate * predicate) {  pred = predicate; }
00059 
00060 
00066     void setTerm(const char* fName1, ComparisionOp op, const char *fName2);
00067 
00073     void setTerm(const char* fName1, ComparisionOp op, void *opnd);
00074 
00080     void setTerm(const char* fName1, ComparisionOp op, void **opnd);
00081 
00082 
00088     void setTerm(Predicate *p1, LogicalOp op, Predicate *p2 = NULL);
00089 
00090 };
00091 
00102 class Predicate
00103 {
00104     public:
00105     virtual void setTerm(const char* fName1, ComparisionOp op, const char *fName2)=0;
00106 
00107     //Operand should be of the same type of the field. This is must
00108     virtual void setTerm(const char* fName1, ComparisionOp op, void *opnd)=0;
00109 
00110     //Operand should be of the same type of the field. This is must
00111     virtual void setTerm(const char* fName1, ComparisionOp op, void **opnd)=0;
00112 
00113     virtual void setTerm(Predicate *p1, LogicalOp op, Predicate *p2 = NULL)=0;
00114 
00115     virtual void print()=0;
00116     virtual ~Predicate(){}
00117 };
00118 
00119 
00120 #endif

Generated on Mon Jun 9 22:37:14 2008 for csql by  doxygen 1.4.7