src/server/Condition.cxx

Go to the documentation of this file.
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 #include<os.h>
00017 #include<Predicate.h>
00018 #include<PredicateImpl.h>
00019 Condition::Condition()
00020 {
00021     //pred = new PredicateImpl();
00022     pred = NULL;
00023 }
00024 void Condition::reset()
00025 {
00026     if (pred) {delete pred;}
00027     pred =  NULL;
00028 }
00029 Condition::~Condition()
00030 {
00031     if (pred) delete pred;
00032     pred = NULL;
00033 }
00034 void Condition::setTerm(const char* fName1, ComparisionOp op,
00035                         const char *fName2)
00036 {
00037     if (pred) delete pred;
00038     pred = new PredicateImpl();
00039     pred->setTerm(fName1, op, fName2);
00040 }
00041 
00042 //Operand should be of the same type of the field.This is must
00043 void Condition::setTerm(const char* fName1, ComparisionOp op, void *opnd)
00044 {
00045     if (pred) delete pred;
00046     pred = new PredicateImpl();
00047     pred->setTerm(fName1, op, opnd);
00048 }
00049 
00050 void Condition::setTerm(const char* fName1, ComparisionOp op, void **opnd)
00051 {
00052     if (pred) delete pred;
00053     pred = new PredicateImpl();
00054     pred->setTerm(fName1, op, opnd);
00055 }
00056 
00057 void Condition::setTerm(Predicate *p1, LogicalOp op, Predicate *p2 )
00058 {
00059     if (pred) delete pred;
00060     pred = new PredicateImpl();
00061     pred->setTerm(p1, op, p2);
00062 }

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