1 chuck 1.1.2.12 //%2003////////////////////////////////////////////////////////////////////////
|
2 chuck 1.1.2.11 //
3 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Development
4 // Company, L. P., IBM Corp., The Open Group, Tivoli Systems.
|
5 chuck 1.1.2.13 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;
|
6 chuck 1.1.2.11 // IBM Corp.; EMC Corporation, The Open Group.
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to
10 // deal in the Software without restriction, including without limitation the
11 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12 // sell copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 //
15 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
16 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
17 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
18 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 //
24 //==============================================================================
25 //
26 // Authors: David Rosckes (rosckes@us.ibm.com)
27 chuck 1.1.2.11 // Bert Rivero (hurivero@us.ibm.com)
28 // Chuck Carmack (carmack@us.ibm.com)
29 // Brian Lucier (lucier@us.ibm.com)
30 //
31 // Modified By:
32 //
33 //%/////////////////////////////////////////////////////////////////////////////
34
|
35 humberto 1.1.2.7 #ifndef Pegasus_CQLExpression_h
36 #define Pegasus_CQLExpression_h
|
37 humberto 1.1.2.1
38 #include <Pegasus/Common/Config.h>
39 #include <Pegasus/CQL/CQLValue.h>
40 #include <Pegasus/CQL/Linkage.h>
41 #include <Pegasus/CQL/CQLTerm.h>
|
42 humberto 1.1.2.7
|
43 humberto 1.1.2.1 PEGASUS_NAMESPACE_BEGIN
44
|
45 humberto 1.1.2.5 class PEGASUS_CQL_LINKAGE CQLFactory;
|
46 humberto 1.1.2.7 class PEGASUS_CQL_LINKAGE CQLExpressionRep;
47 class PEGASUS_CQL_LINKAGE QueryContext;
|
48 humberto 1.1.2.1
49 /** The enum is private, but the definition is public.
50 */
51 enum TermOpType {plus,minus};
52
|
53 david 1.1.2.4 #ifndef PEGASUS_ARRAY_T
54 #define PEGASUS_ARRAY_T TermOpType
55 #include <Pegasus/Common/ArrayInter.h>
56 #undef PEGASUS_ARRAY_T
57 #endif
58
|
59 humberto 1.1.2.1 /**
60 The CQLExpression class encapsulates a generic CQL expression to make it
61 easier to break into components and process the expression.
62
63 A CQL expression is made up of terms and operators.
64 For example, 'A + B' is a CQLExpression, where 'A' and 'B' are terms, and
65 '+' is an operator.
66
67 There must be exactly one more term than there are operators.
68 */
|
69 humberto 1.1.2.7
|
70 humberto 1.1.2.1 class PEGASUS_CQL_LINKAGE CQLExpression
71 {
72 public:
|
73 humberto 1.1.2.9 CQLExpression();
|
74 humberto 1.1.2.1 /** constructor takes one CQLTerm object.
75 */
76 CQLExpression(CQLTerm& theTerm);
|
77 david 1.1.2.2 CQLExpression(const CQLExpression& inExpress);
|
78 humberto 1.1.2.1 /** the getValue method evaluates the expression and returns the value.
79 Any property that need to be resolved into a value is taken from the
80 CIMInstance.
81 */
|
82 humberto 1.1.2.7 ~CQLExpression();
|
83 humberto 1.1.2.1
|
84 david 1.1.2.3 CQLValue resolveValue(CIMInstance CI, QueryContext& QueryCtx);
|
85 humberto 1.1.2.1
86 /** The appendOperation is used by Bison.
87 It is invoked 0 or more times for the CQLExpression, and
88 when invoked will always pass in an integer that is the Term operation
89 type and a CQLTerm object.
90 */
91 void appendOperation(TermOpType theTermOpType, CQLTerm& theTerm);
92
|
93 david 1.1.2.2 String toString();
|
94 chuck 1.1.2.10
|
95 humberto 1.1.2.8 Boolean isSimple();
|
96 chuck 1.1.2.10
|
97 david 1.1.2.3 Boolean isSimpleValue();
|
98 chuck 1.1.2.10
|
99 david 1.1.2.3 Array<CQLTerm> getTerms();
|
100 chuck 1.1.2.10
|
101 david 1.1.2.3 Array<TermOpType> getOperators();
|
102 chuck 1.1.2.10
|
103 david 1.1.2.14 void applyContext(QueryContext& inContext,
104 CQLChainedIdentifier inCid = CQLChainedIdentifier());
|
105 chuck 1.1.2.10
|
106 humberto 1.1.2.9 CQLExpression& operator=(const CQLExpression& rhs);
|
107 chuck 1.1.2.10
|
108 humberto 1.1.2.6 Boolean operator==(const CQLExpression& expr);
|
109 chuck 1.1.2.10
|
110 humberto 1.1.2.6 Boolean operator!=(const CQLExpression& expr);
|
111 chuck 1.1.2.10
|
112 humberto 1.1.2.5 friend class CQLFactory;
|
113 david 1.1.2.2
|
114 humberto 1.1.2.1 private:
115
|
116 humberto 1.1.2.7 CQLExpressionRep *_rep;
|
117 humberto 1.1.2.1 };
118
119 #ifndef PEGASUS_ARRAY_T
120 #define PEGASUS_ARRAY_T CQLExpression
121 #include <Pegasus/Common/ArrayInter.h>
122 #undef PEGASUS_ARRAY_T
123 #endif
124
125 PEGASUS_NAMESPACE_END
126
127
|
128 humberto 1.1.2.7 #endif
|