1 martin 1.10 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.11 //
|
3 martin 1.10 // 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.11 //
|
10 martin 1.10 // 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.11 //
|
17 martin 1.10 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.11 //
|
20 martin 1.10 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.11 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.10 // 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.11 //
|
28 martin 1.10 //////////////////////////////////////////////////////////////////////////
|
29 chuck 1.2 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef CQLFACTOR_H_HEADER
33 #define CQLFACTOR_H_HEADER
34
|
35 david.dillard 1.5 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
36
37 #include <Pegasus/CQL/Linkage.h>
|
38 chuck 1.2 #include <Pegasus/Common/CIMInstance.h>
39 #include <Pegasus/CQL/CQLChainedIdentifier.h>
40 #include <Pegasus/Common/ArrayInternal.h>
41
42 PEGASUS_NAMESPACE_BEGIN
|
43 mike 1.8 class CQLFactory;
44 class CQLExpression;
45 class CQLFunction;
46 class CQLFactorRep;
47 class CQLValue;
48 class QueryContext;
|
49 chuck 1.2
50 /** The CQLFactor could contain a CQLValue, CQLExpression or CQLFunction.
51 This class evaluates the object to get a CQLValue.
|
52 david.dillard 1.5 If it contains a CQLValue, it will resolve the CQLValue.
|
53 chuck 1.2 */
54
55 class PEGASUS_CQL_LINKAGE CQLFactor
56 {
57 public:
58
|
59 david.dillard 1.5 /**
|
60 chuck 1.2 Contructs CQLFactor default object.
|
61 david.dillard 1.5
|
62 chuck 1.2 @param - None.
63 @return - None.
64 @throw - None.
65 <I><B>Experimental Interface</B></I><BR>
66 */
67 CQLFactor();
|
68 david.dillard 1.5
69 /**
|
70 chuck 1.2 Contructs CQLFactor from a CQLValue.
|
71 david.dillard 1.5
|
72 chuck 1.2 @param - inCQLVal - The CQLValue used to construct the CQLFactor.
73 @return - None.
74 @throw - None.
75 <I><B>Experimental Interface</B></I><BR>
76 */
77 CQLFactor(const CQLValue& inCQLVal);
|
78 david.dillard 1.5
79 /**
|
80 chuck 1.2 Contructs CQLFactor from a CQLExpression object.
|
81 david.dillard 1.5
|
82 chuck 1.2 @param - inCQLExp - The CQLExpression used to construct the CQLFactor.
83 @return - None.
84 @throw - None.
85 <I><B>Experimental Interface</B></I><BR>
86 */
87 CQLFactor(const CQLExpression& inCQLExp);
|
88 david.dillard 1.5
89 /**
|
90 chuck 1.2 Contructs CQLFactor from a CQLFunction object.
|
91 david.dillard 1.5
|
92 chuck 1.2 @param - inCQLFunc - The CQLFunction used to construct the CQLFactor.
93 @return - None.
94 @throw - None.
95 <I><B>Experimental Interface</B></I><BR>
96 */
97 CQLFactor(const CQLFunction& inCQLFunc);
|
98 david.dillard 1.5
99 /**
|
100 chuck 1.2 Contructs CQLFactor from a CQLFactor object (copy-constructor).
|
101 david.dillard 1.5
|
102 chuck 1.2 @param - inCQLFact - The CQLFactor used to construct the CQLFactor.
103 @return - None.
104 @throw - None.
105 <I><B>Experimental Interface</B></I><BR>
106 */
107 CQLFactor(const CQLFactor& inCQLFact);
|
108 david.dillard 1.5
109 /**
|
110 chuck 1.2 Destroyes the CQLFactor object.
|
111 david.dillard 1.5
|
112 chuck 1.2 @param - None.
113 @return - None.
114 @throw - None.
115 <I><B>Experimental Interface</B></I><BR>
116 */
117 ~CQLFactor();
|
118 david.dillard 1.5
119 /**
|
120 chuck 1.2 The CQLFactor could contain a CQLValue, CQLExpression or CQLFunction.
121 This method evaluates the object to get a CQLValue.
122 If it contains a CQLValue, it will resolve the CQLValue by calling the
123 resolve method
|
124 david.dillard 1.5 on the CQLValue object.
125
|
126 chuck 1.2 If it contains a CQLFunction this method will invoke the getValue method
|
127 david.dillard 1.5 on
|
128 chuck 1.2 CQLFunction, and the returned value will already be resolved.
|
129 david.dillard 1.5
|
130 chuck 1.2 If it contains a CQLExpression this method will invoke the getValue
|
131 david.dillard 1.5 method on
132 CQLExpression, and the returned value will already be resolved.
133
|
134 chuck 1.2 @param - CI - The CIMInstance to be evaluated.
|
135 karl 1.9 @param - QueryCtx - The QueryContext contains specific information
136 about the query.
|
137 chuck 1.2 @return - The primitive CQLValue.
138 @throw - CQLSyntaxErrorException.
139 <I><B>Experimental Interface</B></I><BR>
140 */
141 CQLValue resolveValue(const CIMInstance& CI, const QueryContext& QueryCtx);
|
142 david.dillard 1.5
143 /**
|
144 chuck 1.2 Will return true if the object has only one CQLValue object within it..
|
145 david.dillard 1.5
|
146 chuck 1.2 @param - None.
147 @return - true or false.
148 @throw - None.
149 <I><B>Experimental Interface</B></I><BR>
150 */
151 Boolean isSimple()const;
|
152 david.dillard 1.5
153 /**
|
154 chuck 1.2 Will return true if the object has only one CQLValue object within it.
|
155 david.dillard 1.5
|
156 chuck 1.2 @param - None.
157 @return - true or false.
158 @throw - None.
159 <I><B>Experimental Interface</B></I><BR>
160 */
161 Boolean isSimpleValue()const;
|
162 david.dillard 1.5
163 /**
|
164 chuck 1.2 Retrieves the CQLValue from the CQLFactor object.
|
165 david.dillard 1.5 NOTE: If CQLValue has not been set for this object, a
|
166 chuck 1.2 default object will be returned.
167
168 @param - None.
169 @return - The CQLValue.
170 @throw - None.
171 <I><B>Experimental Interface</B></I><BR>
172 */
173 CQLValue getValue()const;
|
174 david.dillard 1.5
175 /**
|
176 chuck 1.2 Retrieves the CQLFunciton from the CQLFactor object.
|
177 david.dillard 1.5 NOTE: If CQLFunction has not been set for this object, a
|
178 chuck 1.2 default object will be returned.
|
179 david.dillard 1.5
|
180 chuck 1.2 @param - None.
181 @return - The CQLFucntion
182 @throw - None.
183 <I><B>Experimental Interface</B></I><BR>
184 */
185 CQLFunction getCQLFunction()const;
|
186 david.dillard 1.5
187 /**
|
188 chuck 1.2 Retrieves the CQLExpression from the CQLFactor object.
|
189 david.dillard 1.5 NOTE: If CQLExpression has not been set for this object, a
|
190 chuck 1.2 default object will be returned.
|
191 david.dillard 1.5
|
192 chuck 1.2 @param - None.
193 @return - The CQLFucntion
194 @throw - None.
195 <I><B>Experimental Interface</B></I><BR>
196 */
197 CQLExpression getCQLExpression()const;
|
198 david.dillard 1.5
199 /**
|
200 chuck 1.2 Returns a string representation of the object.
|
201 david.dillard 1.5
|
202 chuck 1.2 @param - None.
203 @return - A string
204 @throw - None.
205 <I><B>Experimental Interface</B></I><BR>
206 */
207 String toString()const;
|
208 david.dillard 1.5
209 /**
|
210 chuck 1.2 Calling applyContext function for every internal object. This
|
211 karl 1.9 will fully qualify the Chained Identifiers within all the CQLValue
212 objects.
|
213 david.dillard 1.5
|
214 chuck 1.2 @param - inContext - Query Context used to access the repository.
|
215 karl 1.9 @param - inCid - Chained Identifier used for standalone symbolic
216 constants.
|
217 chuck 1.2 @return - None.
218 @throw - None.
219 <I><B>Experimental Interface</B></I><BR>
220 */
|
221 vijay.eli 1.6 void applyContext(const QueryContext& inContext,
|
222 karl 1.9 const CQLChainedIdentifier& inCid);
|
223 chuck 1.2
|
224 david.dillard 1.5 /**
|
225 chuck 1.2 Assignment operation
|
226 david.dillard 1.5
|
227 chuck 1.2 @param - rhs - CQLFactor to be assigned
228 @return - the assigned value.
229 @throw - None.
230 <I><B>Experimental Interface</B></I><BR>
231 */
232 CQLFactor& operator=(const CQLFactor& rhs);
|
233 david.dillard 1.5
234 /**
|
235 chuck 1.2 Compare to CQLFactors for equality
|
236 david.dillard 1.5
|
237 chuck 1.2 @param - expr - rightside value of operation
238 @return - true or false.
239 @throw - None.
240 <I><B>Experimental Interface</B></I><BR>
241 */
|
242 humberto 1.3 /*
|
243 chuck 1.2 Boolean operator==(const CQLFactor& factor)const;
|
244 humberto 1.3 */
|
245 david.dillard 1.5 /**
|
246 chuck 1.2 Compare to CQLFactors for non-equality
|
247 david.dillard 1.5
|
248 chuck 1.2 @param - expr - rightside value of operation
249 @return - true or false.
250 @throw - None.
251 <I><B>Experimental Interface</B></I><BR>
252 */
|
253 humberto 1.3 /*
|
254 chuck 1.2 Boolean operator!=(const CQLFactor& factor)const;
|
255 humberto 1.3 */
|
256 chuck 1.2 friend class CQLFactory;
257 private:
|
258 david.dillard 1.5
|
259 chuck 1.2 CQLFactorRep *_rep;
260 };
261
262 /*
263 #ifndef PEGASUS_ARRAY_T
264 #define PEGASUS_ARRAY_T CQLFactor
265 #include <Pegasus/Common/ArrayInter.h>
266 #undef PEGASUS_ARRAY_T
267 #endif
268 */
269
270 PEGASUS_NAMESPACE_END
271 #endif
272 #endif /* CQLFACTOR_H_HEADER */
|