#include <Predicate.h>
Collaboration diagram for Condition:
Public Member Functions | |
Condition () | |
~Condition () | |
void | reset () |
Predicate * | getPredicate () |
gets the current predicate. | |
void | setPredicate (Predicate *predicate) |
sets the current predicate. | |
void | setTerm (const char *fName1, ComparisionOp op, const char *fName2) |
sets the predicate term of form f1 = f2. | |
void | setTerm (const char *fName1, ComparisionOp op, void *opnd) |
sets the predicate term of form f1 = 10 | |
void | setTerm (const char *fName1, ComparisionOp op, void **opnd) |
sets the predicate term of form f1 =10, using pointer semantics | |
void | setTerm (Predicate *p1, LogicalOp op, Predicate *p2=NULL) |
sets the predicate term of form f1 = f2 && f1 = 100. |
Used in SELECT, UPDATE and DELETE statement to retrieve only tuples which satisfy
the condition. This represents the root of the logical expression. This logical
expression may contain multiple terms(predicates).
For example to set this condition f1 == f2 && f1 == 100.
Condition c1;
int val1 = 100;
c1.setTerm("f1", OpEquals, &val1);
Predicate *p1 = c1.getPredicate();
Condition c2;
c2.setTerm("f1", opEquals, "f2");
Predicate *p2 = c2.getPredicate();
Condtion rootCondition;
rootCondition.setTerm(p1, OpAnd, p2);
table->setCondition(rootCondition);
Definition at line 42 of file Predicate.h.
Condition::Condition | ( | ) |
Condition::~Condition | ( | ) |
Predicate* Condition::getPredicate | ( | ) | [inline] |
gets the current predicate.
This is used to create logical expressions with terms or predicates.
Definition at line 53 of file Predicate.h.
Referenced by TableImpl::setCondition().
Here is the caller graph for this function:
void Condition::reset | ( | ) |
Definition at line 24 of file Condition.cxx.
Referenced by ParsedData::reset().
Here is the caller graph for this function:
void Condition::setPredicate | ( | Predicate * | predicate | ) | [inline] |
sets the current predicate.
This is set after creating the logical expression and used in the table interface for setting the condition.
Predicate* | predicate |
Definition at line 58 of file Predicate.h.
Referenced by ParsedData::setCondition().
Here is the caller graph for this function:
sets the predicate term of form f1 = f2 && f1 = 100.
p1* | predicate | |
op | logical operator (&&, ||, !) | |
p2* | predicate |
Definition at line 57 of file Condition.cxx.
References Predicate::setTerm().
00058 { 00059 if (pred) delete pred; 00060 pred = new PredicateImpl(); 00061 pred->setTerm(p1, op, p2); 00062 }
Here is the call graph for this function:
void Condition::setTerm | ( | const char * | fName1, | |
ComparisionOp | op, | |||
void ** | opnd | |||
) |
sets the predicate term of form f1 =10, using pointer semantics
fName1* | field name | |
op | comparision operator(=,!=, >,<,>=,<=) | |
opnd** | pointer to pointer to the value |
Definition at line 50 of file Condition.cxx.
References Predicate::setTerm().
00051 { 00052 if (pred) delete pred; 00053 pred = new PredicateImpl(); 00054 pred->setTerm(fName1, op, opnd); 00055 }
Here is the call graph for this function:
void Condition::setTerm | ( | const char * | fName1, | |
ComparisionOp | op, | |||
void * | opnd | |||
) |
sets the predicate term of form f1 = 10
fName1* | field name | |
op | comparision operator(=,!=, >,<,>=,<=) | |
opnd* | pointer to the value |
Definition at line 43 of file Condition.cxx.
References Predicate::setTerm().
00044 { 00045 if (pred) delete pred; 00046 pred = new PredicateImpl(); 00047 pred->setTerm(fName1, op, opnd); 00048 }
Here is the call graph for this function:
void Condition::setTerm | ( | const char * | fName1, | |
ComparisionOp | op, | |||
const char * | fName2 | |||
) |
sets the predicate term of form f1 = f2.
fName1* | field name | |
op | comparision operator | |
fName2* | field name |
Definition at line 34 of file Condition.cxx.
References Predicate::setTerm().
Referenced by remove().
00036 { 00037 if (pred) delete pred; 00038 pred = new PredicateImpl(); 00039 pred->setTerm(fName1, op, fName2); 00040 }
Here is the call graph for this function:
Here is the caller graph for this function: