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