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 ***************************************************************************/
18 #include<PredicateImpl.h>
19 Condition::Condition()
23 void Condition::reset()
25 //if (pred) {delete pred;}
28 Condition::~Condition()
32 void Condition::setTerm(const char* fName1
, ComparisionOp op
,
35 if (pred
) delete pred
;
36 pred
= new PredicateImpl();
37 pred
->setTerm(fName1
, op
, fName2
);
40 //Operand should be of the same type of the field.This is must
41 void Condition::setTerm(const char* fName1
, ComparisionOp op
, void *opnd
)
43 if (pred
) delete pred
;
44 pred
= new PredicateImpl();
45 pred
->setTerm(fName1
, op
, opnd
);
48 void Condition::setTerm(const char* fName1
, ComparisionOp op
, void **opnd
)
50 if (pred
) delete pred
;
51 pred
= new PredicateImpl();
52 pred
->setTerm(fName1
, op
, opnd
);
55 void Condition::setTerm(Predicate
*p1
, LogicalOp op
, Predicate
*p2
)
57 if (pred
) delete pred
;
58 pred
= new PredicateImpl();
59 pred
->setTerm(p1
, op
, p2
);