version 1.9, 2006/06/19 19:37:28
|
version 1.10, 2007/04/18 20:14:35
|
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Authors: David Rosckes (rosckes@us.ibm.com) |
|
// Bert Rivero (hurivero@us.ibm.com) |
|
// Chuck Carmack (carmack@us.ibm.com) |
|
// Brian Lucier (lucier@us.ibm.com) |
|
// |
|
// Modified By: David Dillard, VERITAS Software Corp. |
|
// (david.dillard@veritas.com) |
|
// Vijay Eli, IBM (vijayeli@in.ibm.com) bug#3590 |
|
// |
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#ifndef Pegasus_CQLPredicateRep_h | #ifndef Pegasus_CQLPredicateRep_h |
|
|
/** | /** |
This object is populated by Bison. | This object is populated by Bison. |
| |
Valid operations for each type of CQLValue are in accordance with the DMTF |
Valid operations for each type of CQLValue are in accordance with the |
CQL Specification. |
DMTF CQL Specification. |
| |
The CQLPredicate is considered "terminal" if it does not contain any | The CQLPredicate is considered "terminal" if it does not contain any |
CQLPredicate objects. | CQLPredicate objects. |
|
|
The CQLPredicate is non-terminal if it contains only CQLPredicate | The CQLPredicate is non-terminal if it contains only CQLPredicate |
objects. | objects. |
A non-terminal CQLPredicate is evaluated by in turn evaluating the | A non-terminal CQLPredicate is evaluated by in turn evaluating the |
contained CQLPredicates and |
contained CQLPredicates and boolean operator. |
boolean operator. |
|
Valid operators are: | Valid operators are: |
AND, OR | AND, OR |
| |
For the evaluate method on each CQLPredicate. the CQLPredicate is evaluated |
For the evaluate method on each CQLPredicate. the CQLPredicate is |
to TRUE/FALSE and |
evaluated to TRUE/FALSE and |
the result of the evaluation is then applied to the appropriate boolean |
the result of the evaluation is then applied to the appropriate |
operator. |
boolean operator. |
|
|
The result of the evaluation is and then inverted if the _invert member |
The result of the evaluation is and then inverted if the _invert |
variable is set to TRUE |
member variable is set to TRUE and then returned to the caller. |
and then returned to the caller. |
|
| |
*/ | */ |
class CQLPredicateRep | class CQLPredicateRep |
|
|
public: | public: |
CQLPredicateRep(); | CQLPredicateRep(); |
| |
CQLPredicateRep(const CQLSimplePredicate & inSimplePredicate, Boolean inVerted = false); |
CQLPredicateRep(const CQLSimplePredicate & inSimplePredicate, |
|
Boolean inVerted = false); |
| |
CQLPredicateRep(const CQLPredicate & inPredicate, Boolean inVerted = false); | CQLPredicateRep(const CQLPredicate & inPredicate, Boolean inVerted = false); |
| |
|
|
~CQLPredicateRep(){} | ~CQLPredicateRep(){} |
/** | /** |
CQLExpressions: | CQLExpressions: |
For an expression, CQLExpression::getValue is called and will return a |
For an expression, CQLExpression::getValue is called and will return |
CQLValue. |
a CQLValue. |
The appropriate operator is then invoked on CQLValue and that operator |
The appropriate operator is then invoked on CQLValue and that |
function will |
operator function will enforce the type restrictions as documented |
enforce the type restrictions as documented in the DMTF CQL |
in the DMTF CQL |
Specification. | Specification. |
That operator then determines whether the predicate is TRUE / FALSE. | That operator then determines whether the predicate is TRUE / FALSE. |
| |
|
|
The CQLPredicate is non-terminal if it contains only CQLPredicate | The CQLPredicate is non-terminal if it contains only CQLPredicate |
objects. | objects. |
A non-terminal CQLPredicate is evaluated by in turn evaluating the | A non-terminal CQLPredicate is evaluated by in turn evaluating the |
contained CQLPredicates and |
contained CQLPredicates and boolean operator. |
boolean operator. |
|
Valid operators are: | Valid operators are: |
AND, OR | AND, OR |
| |
For the evaluate method on each CQLPredicate. the CQLPredicate is | For the evaluate method on each CQLPredicate. the CQLPredicate is |
evaluated to TRUE/FALSE and |
evaluated to TRUE/FALSE and the result of the evaluation is then |
the result of the evaluation is then applied to the appropriate boolean |
applied to the appropriate boolean operator. |
operator. |
|
| |
The result of the evaluation is and then inverted if the _invert member |
The result of the evaluation is and then inverted if the _invert |
variable is set to TRUE |
member variable is set to TRUE and then returned to the caller. |
and then returned to the caller. |
|
| |
*/ | */ |
Boolean evaluate(CIMInstance CI, QueryContext& QueryCtx); | Boolean evaluate(CIMInstance CI, QueryContext& QueryCtx); |
|
|
*/ | */ |
void appendPredicate(const CQLPredicate& inPredicate); | void appendPredicate(const CQLPredicate& inPredicate); |
| |
void appendPredicate(const CQLPredicate& inPredicate, BooleanOpType inBooleanOperator); |
void appendPredicate(const CQLPredicate& inPredicate, |
|
BooleanOpType inBooleanOperator); |
| |
Array<CQLPredicate> getPredicates()const; | Array<CQLPredicate> getPredicates()const; |
| |