Public Member Functions | |
| 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);
| Predicate* Condition::getPredicate | ( | ) | [inline] |
gets the current predicate.
This is used to create logical expressions with terms or predicates.
| 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 |
sets the predicate term of form f1 = f2 && f1 = 100.
| p1* | predicate | |
| op | logical operator (&&, ||, !) | |
| p2* | predicate |
| 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 |
| 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 |
| 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 |