1 karl 1.6 //%2006////////////////////////////////////////////////////////////////////////
|
2 chuck 1.2 //
|
3 karl 1.3 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
|
6 chuck 1.2 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.3 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
9 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.6 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 chuck 1.2 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
15 // of this software and associated documentation files (the "Software"), to
16 // deal in the Software without restriction, including without limitation the
17 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
18 // sell copies of the Software, and to permit persons to whom the Software is
19 // furnished to do so, subject to the following conditions:
|
20 karl 1.6 //
|
21 chuck 1.2 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
24 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30 //==============================================================================
31 //
32 // Authors: David Rosckes (rosckes@us.ibm.com)
33 // Bert Rivero (hurivero@us.ibm.com)
34 // Chuck Carmack (carmack@us.ibm.com)
|
35 david.dillard 1.4 // Brian Lucier (lucier@us.ibm.com)
|
36 chuck 1.2 //
|
37 david.dillard 1.4 // Modified By: David Dillard, VERITAS Software Corp.
38 // (david.dillard@veritas.com)
|
39 vijay.eli 1.5 // Vijay Eli, IBM (vijayeli@in.ibm.com) bug#3590
|
40 chuck 1.2 //
41 //%/////////////////////////////////////////////////////////////////////////////
42
|
43 david.dillard 1.4 #ifndef Pegasus_CQLSimplePredicateRep_h
|
44 chuck 1.2 #define Pegasus_CQLSimplePredicateRep_h
45
46 #include <Pegasus/CQL/Linkage.h>
47 #include <Pegasus/CQL/CQLExpression.h>
48
49 //#include <Pegasus/Common/CIMInstance.h>
50 //#include <Pegasus/CQL/QueryContext.h>
51
52 PEGASUS_NAMESPACE_BEGIN
53
54 class PEGASUS_CQL_LINKAGE CQLExpression;
55 class PEGASUS_CQL_LINKAGE CQLFactory;
56 class PEGASUS_QUERYCOMMON_LINKAGE QueryContext;
57
58 class CQLSimplePredicateRep
59 {
60 public:
61 CQLSimplePredicateRep();
62
63 CQLSimplePredicateRep(const CQLExpression& inExpression);
64
65 chuck 1.2 CQLSimplePredicateRep(const CQLExpression& inExpression, ExpressionOpType inOperator);
66
67 CQLSimplePredicateRep(const CQLExpression& leftSideExpression,
|
68 david.dillard 1.4 const CQLExpression& rightSideExpression,
69 ExpressionOpType inOperator);
|
70 chuck 1.2
71 CQLSimplePredicateRep(const CQLSimplePredicateRep* rep);
72
73 ~CQLSimplePredicateRep(){}
74
|
75 david.dillard 1.4 /**
76 CQLExpressions:
77 For an expression, CQLExpression::getValue is called and will
78 return a CQLValue.
79 The appropriate operator is then invoked on CQLValue and that
80 operator function will enforce the type restrictions as documented
81 in the DMTF CQL Specification.
|
82 chuck 1.2 That operator then determines whether the predicate is TRUE / FALSE.
|
83 david.dillard 1.4
84
85 CQLPredicates:
|
86 chuck 1.2 The CQLPredicate is non-terminal if it contains only CQLPredicate
|
87 david.dillard 1.4 objects.
|
88 chuck 1.2 A non-terminal CQLPredicate is evaluated by in turn evaluating the
|
89 david.dillard 1.4 contained CQLPredicates and boolean operator.
90 Valid operators are:
|
91 chuck 1.2 AND, OR
|
92 david.dillard 1.4
93 For the evaluate method on each CQLPredicate. the CQLPredicate is
94 evaluated to TRUE/FALSE and the result of the evaluation is then
95 applied to the appropriate boolean operator.
96
97 The result of the evaluation is and then inverted if the _invert
98 member variable is set to TRUE and then returned to the caller.
99
|
100 chuck 1.2 */
101 Boolean evaluate(CIMInstance CI, QueryContext& QueryCtx);
102
103 CQLExpression getLeftExpression()const;
104
105 CQLExpression getRightExpression()const;
106
|
107 david.dillard 1.4 ExpressionOpType getOperation()const;
|
108 chuck 1.2
|
109 vijay.eli 1.5 void applyContext(const QueryContext& queryContext);
|
110 chuck 1.2
111 String toString()const;
112
113 Boolean isSimple()const;
114
115 Boolean isSimpleValue()const;
116
117 void setOperation(ExpressionOpType op);
118
119 friend class CQLFactory;
|
120 david.dillard 1.4
121 private:
|
122 chuck 1.2 CQLExpression _leftSide;
123
124 CQLExpression _rightSide;
125
126 ExpressionOpType _operator;
127 Boolean _isSimple;
128 };
129 PEGASUS_NAMESPACE_END
130
|
131 david.dillard 1.4 #endif
|