1 martin 1.9 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.10 //
|
3 martin 1.9 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
|
9 martin 1.10 //
|
10 martin 1.9 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
|
16 martin 1.10 //
|
17 martin 1.9 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.10 //
|
20 martin 1.9 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.10 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.9 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27 martin 1.10 //
|
28 martin 1.9 //////////////////////////////////////////////////////////////////////////
|
29 chuck 1.2 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
|
32 david.dillard 1.4 #ifndef Pegasus_CQLSimplePredicateRep_h
|
33 chuck 1.2 #define Pegasus_CQLSimplePredicateRep_h
34
35 #include <Pegasus/CQL/Linkage.h>
36 #include <Pegasus/CQL/CQLExpression.h>
37
38 //#include <Pegasus/Common/CIMInstance.h>
39 //#include <Pegasus/CQL/QueryContext.h>
40
41 PEGASUS_NAMESPACE_BEGIN
42
|
43 mike 1.7 class CQLExpression;
44 class CQLFactory;
45 class QueryContext;
|
46 chuck 1.2
47 class CQLSimplePredicateRep
48 {
49 public:
50 CQLSimplePredicateRep();
51
52 CQLSimplePredicateRep(const CQLExpression& inExpression);
53
|
54 karl 1.8 CQLSimplePredicateRep(const CQLExpression& inExpression,
55 ExpressionOpType inOperator);
|
56 chuck 1.2
57 CQLSimplePredicateRep(const CQLExpression& leftSideExpression,
|
58 david.dillard 1.4 const CQLExpression& rightSideExpression,
59 ExpressionOpType inOperator);
|
60 chuck 1.2
61 CQLSimplePredicateRep(const CQLSimplePredicateRep* rep);
62
63 ~CQLSimplePredicateRep(){}
64
|
65 david.dillard 1.4 /**
66 CQLExpressions:
67 For an expression, CQLExpression::getValue is called and will
68 return a CQLValue.
69 The appropriate operator is then invoked on CQLValue and that
70 operator function will enforce the type restrictions as documented
71 in the DMTF CQL Specification.
|
72 chuck 1.2 That operator then determines whether the predicate is TRUE / FALSE.
|
73 david.dillard 1.4
74
75 CQLPredicates:
|
76 chuck 1.2 The CQLPredicate is non-terminal if it contains only CQLPredicate
|
77 david.dillard 1.4 objects.
|
78 chuck 1.2 A non-terminal CQLPredicate is evaluated by in turn evaluating the
|
79 david.dillard 1.4 contained CQLPredicates and boolean operator.
80 Valid operators are:
|
81 chuck 1.2 AND, OR
|
82 david.dillard 1.4
83 For the evaluate method on each CQLPredicate. the CQLPredicate is
84 evaluated to TRUE/FALSE and the result of the evaluation is then
85 applied to the appropriate boolean operator.
86
87 The result of the evaluation is and then inverted if the _invert
88 member variable is set to TRUE and then returned to the caller.
89
|
90 chuck 1.2 */
91 Boolean evaluate(CIMInstance CI, QueryContext& QueryCtx);
92
93 CQLExpression getLeftExpression()const;
94
95 CQLExpression getRightExpression()const;
96
|
97 david.dillard 1.4 ExpressionOpType getOperation()const;
|
98 chuck 1.2
|
99 vijay.eli 1.5 void applyContext(const QueryContext& queryContext);
|
100 chuck 1.2
101 String toString()const;
102
103 Boolean isSimple()const;
104
105 Boolean isSimpleValue()const;
106
107 void setOperation(ExpressionOpType op);
108
109 friend class CQLFactory;
|
110 david.dillard 1.4
111 private:
|
112 chuck 1.2 CQLExpression _leftSide;
113
114 CQLExpression _rightSide;
115
116 ExpressionOpType _operator;
117 Boolean _isSimple;
118 };
119 PEGASUS_NAMESPACE_END
120
|
121 david.dillard 1.4 #endif
|