1 humberto 1.1.2.1 #ifndef Pegasus_CQLPredicateRep_h
2 #define Pegasus_CQLPredicateRep_h
3
4 #include <Pegasus/Common/Config.h>
5 #include <Pegasus/CQL/CQLSimplePredicate.h>
6 #include <Pegasus/CQL/CQLScope.h>
7 #include <Pegasus/CQL/Linkage.h>
8
9
10 PEGASUS_NAMESPACE_BEGIN
11
12 class PEGASUS_CQL_LINKAGE QueryContext;
13 class PEGASUS_CQL_LINKAGE CQLFactory;
14
15 /**
16 This object is populated by Bison.
17
18 Valid operations for each type of CQLValue are in accordance with the DMTF
19 CQL Specification.
20
21 The CQLPredicate is considered "terminal" if it does not contain any
22 humberto 1.1.2.1 CQLPredicate objects.
23 A 'terminal' predicate can be evaluated to TRUE/FALSE by examining the
24 CQLExpressions and operator.
25 Valid operators are:
26 <, >, =, <=, >=, <>, IS NULL, IS NOT NULL, ISA, LIKE
27
28 CQLExpressions:
29 For an expression, CQLExpression::getValue is called and will return a
30 CQLValue.
31 The appropriate operator is then invoked on CQLValue and that operator
32 function will
33 enforce the type restrictions as documented in the DMTF CQL
34 Specification.
35 That operator then determines whether the predicate is TRUE / FALSE.
36
37
38 CQLPredicates:
39 The CQLPredicate is non-terminal if it contains only CQLPredicate
40 objects.
41 A non-terminal CQLPredicate is evaluated by in turn evaluating the
42 contained CQLPredicates and
43 humberto 1.1.2.1 boolean operator.
44 Valid operators are:
45 AND, OR
46
47 For the evaluate method on each CQLPredicate. the CQLPredicate is evaluated
48 to TRUE/FALSE and
49 the result of the evaluation is then applied to the appropriate boolean
50 operator.
51
52 The result of the evaluation is and then inverted if the _invert member
53 variable is set to TRUE
54 and then returned to the caller.
55
56 */
57 class PEGASUS_CQL_LINKAGE CQLPredicateRep
58 {
59 public:
60 CQLPredicateRep(){}
61
62 CQLPredicateRep(const CQLSimplePredicate & inSimplePredicate, Boolean inVerted = false);
63
64 humberto 1.1.2.1 CQLPredicateRep(const CQLPredicate & inPredicate, Boolean inVerted = false);
65
66 CQLPredicateRep(const CQLPredicateRep& rep);
67
68 ~CQLPredicateRep(){}
69 /**
70 CQLExpressions:
71 For an expression, CQLExpression::getValue is called and will return a
72 CQLValue.
73 The appropriate operator is then invoked on CQLValue and that operator
74 function will
75 enforce the type restrictions as documented in the DMTF CQL
76 Specification.
77 That operator then determines whether the predicate is TRUE / FALSE.
78
79
80 CQLPredicates:
81 The CQLPredicate is non-terminal if it contains only CQLPredicate
82 objects.
83 A non-terminal CQLPredicate is evaluated by in turn evaluating the
84 contained CQLPredicates and
85 humberto 1.1.2.1 boolean operator.
86 Valid operators are:
87 AND, OR
88
89 For the evaluate method on each CQLPredicate. the CQLPredicate is
90 evaluated to TRUE/FALSE and
91 the result of the evaluation is then applied to the appropriate boolean
92 operator.
93
94 The result of the evaluation is and then inverted if the _invert member
95 variable is set to TRUE
96 and then returned to the caller.
97
98 */
99 Boolean evaluate(CIMInstance CI, QueryContext& QueryCtx);
100
101 Boolean isTerminal();
102
103 Boolean getInverted();
104
105 void setInverted();
106 humberto 1.1.2.1
107 /** Appends a predicate to the predicate array. This method should only
108 be called by Bison.
109 */
110 void appendPredicate(CQLPredicate inPredicate, BooleanOpType inBooleanOperator);
111
112 void appendPredicate(CQLSimplePredicate inSimplePredicate, BooleanOpType inBooleanOperator);
113
114 Array<CQLPredicate> getPredicates();
115
116 CQLSimplePredicate getSimplePredicate();
117
118 Array<BooleanOpType> getOperators();
119
120 Array<CQLScope> getScopes();
121
122 void applyScopes(Array<CQLScope> & inScopes);
123
124 Boolean isSimple();
125
|