1 karl 1.4 //%2005////////////////////////////////////////////////////////////////////////
|
2 chuck 1.2 //
|
3 karl 1.4 // 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.4 // 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 chuck 1.2 //
12 // Permission is hereby granted, free of charge, to any person obtaining a copy
13 // of this software and associated documentation files (the "Software"), to
14 // deal in the Software without restriction, including without limitation the
15 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
16 // sell copies of the Software, and to permit persons to whom the Software is
17 // furnished to do so, subject to the following conditions:
|
18 david.dillard 1.5 //
|
19 chuck 1.2 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
20 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
21 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
22 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
23 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
25 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
28 //==============================================================================
29 //
30 // Author: Dave Rosckes (rosckes@us.ibm.com)
31 //
|
32 david.dillard 1.5 // Modified By: David Dillard, VERITAS Software Corp.
33 // (david.dillard@veritas.com)
|
34 vijay.eli 1.6 // Vijay Eli, IBM (vijayeli@in.ibm.com) bug#3590
|
35 chuck 1.2 //
36 //%/////////////////////////////////////////////////////////////////////////////
37
38 #ifndef CQLFACTOR_H_HEADER
39 #define CQLFACTOR_H_HEADER
40
|
41 david.dillard 1.5 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
42
43 #include <Pegasus/CQL/Linkage.h>
|
44 chuck 1.2 #include <Pegasus/Common/CIMInstance.h>
45 #include <Pegasus/CQL/CQLChainedIdentifier.h>
46 #include <Pegasus/Common/ArrayInternal.h>
47
48 PEGASUS_NAMESPACE_BEGIN
49 class PEGASUS_CQL_LINKAGE CQLFactory;
50 class PEGASUS_CQL_LINKAGE CQLExpression;
51 class PEGASUS_CQL_LINKAGE CQLFunction;
52 class PEGASUS_CQL_LINKAGE CQLFactorRep;
53 class PEGASUS_CQL_LINKAGE CQLValue;
54 class PEGASUS_QUERYCOMMON_LINKAGE QueryContext;
55
56 /** The CQLFactor could contain a CQLValue, CQLExpression or CQLFunction.
57 This class evaluates the object to get a CQLValue.
|
58 david.dillard 1.5 If it contains a CQLValue, it will resolve the CQLValue.
|
59 chuck 1.2 */
60
61 class PEGASUS_CQL_LINKAGE CQLFactor
62 {
63 public:
64
|
65 david.dillard 1.5 /**
|
66 chuck 1.2 Contructs CQLFactor default object.
|
67 david.dillard 1.5
|
68 chuck 1.2 @param - None.
69 @return - None.
70 @throw - None.
71 <I><B>Experimental Interface</B></I><BR>
72 */
73 CQLFactor();
|
74 david.dillard 1.5
75 /**
|
76 chuck 1.2 Contructs CQLFactor from a CQLValue.
|
77 david.dillard 1.5
|
78 chuck 1.2 @param - inCQLVal - The CQLValue used to construct the CQLFactor.
79 @return - None.
80 @throw - None.
81 <I><B>Experimental Interface</B></I><BR>
82 */
83 CQLFactor(const CQLValue& inCQLVal);
|
84 david.dillard 1.5
85 /**
|
86 chuck 1.2 Contructs CQLFactor from a CQLExpression object.
|
87 david.dillard 1.5
|
88 chuck 1.2 @param - inCQLExp - The CQLExpression used to construct the CQLFactor.
89 @return - None.
90 @throw - None.
91 <I><B>Experimental Interface</B></I><BR>
92 */
93 CQLFactor(const CQLExpression& inCQLExp);
|
94 david.dillard 1.5
95 /**
|
96 chuck 1.2 Contructs CQLFactor from a CQLFunction object.
|
97 david.dillard 1.5
|
98 chuck 1.2 @param - inCQLFunc - The CQLFunction used to construct the CQLFactor.
99 @return - None.
100 @throw - None.
101 <I><B>Experimental Interface</B></I><BR>
102 */
103 CQLFactor(const CQLFunction& inCQLFunc);
|
104 david.dillard 1.5
105 /**
|
106 chuck 1.2 Contructs CQLFactor from a CQLFactor object (copy-constructor).
|
107 david.dillard 1.5
|
108 chuck 1.2 @param - inCQLFact - The CQLFactor used to construct the CQLFactor.
109 @return - None.
110 @throw - None.
111 <I><B>Experimental Interface</B></I><BR>
112 */
113 CQLFactor(const CQLFactor& inCQLFact);
|
114 david.dillard 1.5
115 /**
|
116 chuck 1.2 Destroyes the CQLFactor object.
|
117 david.dillard 1.5
|
118 chuck 1.2 @param - None.
119 @return - None.
120 @throw - None.
121 <I><B>Experimental Interface</B></I><BR>
122 */
123 ~CQLFactor();
|
124 david.dillard 1.5
125 /**
|
126 chuck 1.2 The CQLFactor could contain a CQLValue, CQLExpression or CQLFunction.
127 This method evaluates the object to get a CQLValue.
128 If it contains a CQLValue, it will resolve the CQLValue by calling the
129 resolve method
|
130 david.dillard 1.5 on the CQLValue object.
131
|
132 chuck 1.2 If it contains a CQLFunction this method will invoke the getValue method
|
133 david.dillard 1.5 on
|
134 chuck 1.2 CQLFunction, and the returned value will already be resolved.
|
135 david.dillard 1.5
|
136 chuck 1.2 If it contains a CQLExpression this method will invoke the getValue
|
137 david.dillard 1.5 method on
138 CQLExpression, and the returned value will already be resolved.
139
|
140 chuck 1.2 @param - CI - The CIMInstance to be evaluated.
141 @param - QueryCtx - The QueryContext contains specific information about the query.
142 @return - The primitive CQLValue.
143 @throw - CQLSyntaxErrorException.
144 <I><B>Experimental Interface</B></I><BR>
145 */
146 CQLValue resolveValue(const CIMInstance& CI, const QueryContext& QueryCtx);
|
147 david.dillard 1.5
148 /**
|
149 chuck 1.2 Will return true if the object has only one CQLValue object within it..
|
150 david.dillard 1.5
|
151 chuck 1.2 @param - None.
152 @return - true or false.
153 @throw - None.
154 <I><B>Experimental Interface</B></I><BR>
155 */
156 Boolean isSimple()const;
|
157 david.dillard 1.5
158 /**
|
159 chuck 1.2 Will return true if the object has only one CQLValue object within it.
|
160 david.dillard 1.5
|
161 chuck 1.2 @param - None.
162 @return - true or false.
163 @throw - None.
164 <I><B>Experimental Interface</B></I><BR>
165 */
166 Boolean isSimpleValue()const;
|
167 david.dillard 1.5
168 /**
|
169 chuck 1.2 Retrieves the CQLValue from the CQLFactor object.
|
170 david.dillard 1.5 NOTE: If CQLValue has not been set for this object, a
|
171 chuck 1.2 default object will be returned.
172
173 @param - None.
174 @return - The CQLValue.
175 @throw - None.
176 <I><B>Experimental Interface</B></I><BR>
177 */
178 CQLValue getValue()const;
|
179 david.dillard 1.5
180 /**
|
181 chuck 1.2 Retrieves the CQLFunciton from the CQLFactor object.
|
182 david.dillard 1.5 NOTE: If CQLFunction has not been set for this object, a
|
183 chuck 1.2 default object will be returned.
|
184 david.dillard 1.5
|
185 chuck 1.2 @param - None.
186 @return - The CQLFucntion
187 @throw - None.
188 <I><B>Experimental Interface</B></I><BR>
189 */
190 CQLFunction getCQLFunction()const;
|
191 david.dillard 1.5
192 /**
|
193 chuck 1.2 Retrieves the CQLExpression from the CQLFactor object.
|
194 david.dillard 1.5 NOTE: If CQLExpression has not been set for this object, a
|
195 chuck 1.2 default object will be returned.
|
196 david.dillard 1.5
|
197 chuck 1.2 @param - None.
198 @return - The CQLFucntion
199 @throw - None.
200 <I><B>Experimental Interface</B></I><BR>
201 */
202 CQLExpression getCQLExpression()const;
|
203 david.dillard 1.5
204 /**
|
205 chuck 1.2 Returns a string representation of the object.
|
206 david.dillard 1.5
|
207 chuck 1.2 @param - None.
208 @return - A string
209 @throw - None.
210 <I><B>Experimental Interface</B></I><BR>
211 */
212 String toString()const;
|
213 david.dillard 1.5
214 /**
|
215 chuck 1.2 Calling applyContext function for every internal object. This
216 will fully qualify the Chained Identifiers within all the CQLValue objects.
|
217 david.dillard 1.5
|
218 chuck 1.2 @param - inContext - Query Context used to access the repository.
219 @param - inCid - Chained Identifier used for standalone symbolic constants.
220 @return - None.
221 @throw - None.
222 <I><B>Experimental Interface</B></I><BR>
223 */
|
224 vijay.eli 1.6 void applyContext(const QueryContext& inContext,
225 const CQLChainedIdentifier& inCid);
|
226 chuck 1.2
|
227 david.dillard 1.5 /**
|
228 chuck 1.2 Assignment operation
|
229 david.dillard 1.5
|
230 chuck 1.2 @param - rhs - CQLFactor to be assigned
231 @return - the assigned value.
232 @throw - None.
233 <I><B>Experimental Interface</B></I><BR>
234 */
235 CQLFactor& operator=(const CQLFactor& rhs);
|
236 david.dillard 1.5
237 /**
|
238 chuck 1.2 Compare to CQLFactors for equality
|
239 david.dillard 1.5
|
240 chuck 1.2 @param - expr - rightside value of operation
241 @return - true or false.
242 @throw - None.
243 <I><B>Experimental Interface</B></I><BR>
244 */
|
245 humberto 1.3 /*
|
246 chuck 1.2 Boolean operator==(const CQLFactor& factor)const;
|
247 humberto 1.3 */
|
248 david.dillard 1.5 /**
|
249 chuck 1.2 Compare to CQLFactors for non-equality
|
250 david.dillard 1.5
|
251 chuck 1.2 @param - expr - rightside value of operation
252 @return - true or false.
253 @throw - None.
254 <I><B>Experimental Interface</B></I><BR>
255 */
|
256 humberto 1.3 /*
|
257 chuck 1.2 Boolean operator!=(const CQLFactor& factor)const;
|
258 humberto 1.3 */
|
259 chuck 1.2 friend class CQLFactory;
260 private:
|
261 david.dillard 1.5
|
262 chuck 1.2 CQLFactorRep *_rep;
263 };
264
265 /*
266 #ifndef PEGASUS_ARRAY_T
267 #define PEGASUS_ARRAY_T CQLFactor
268 #include <Pegasus/Common/ArrayInter.h>
269 #undef PEGASUS_ARRAY_T
270 #endif
271 */
272
273 PEGASUS_NAMESPACE_END
274 #endif
275 #endif /* CQLFACTOR_H_HEADER */
|