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 chuck 1.2 //
35 //%/////////////////////////////////////////////////////////////////////////////
36
37 #include <cstdlib>
38 #include <iostream>
39
40 #include <Pegasus/CQL/CQLValue.h>
41 #include <Pegasus/Repository/NameSpaceManager.h>
42 #include <Pegasus/Common/CIMClass.h>
43 #include <Pegasus/CQL/CQLIdentifier.h>
44 #include <Pegasus/CQL/CQLValue.h>
45 #include <Pegasus/CQL/CQLFactory.h>
46
47
48
49 PEGASUS_NAMESPACE_BEGIN
50 PEGASUS_USING_STD;
51
52 /*
53 #define PEGASUS_ARRAY_T CQLValue
54 #include <Pegasus/Common/ArrayImpl.h>
55 chuck 1.2 #undef PEGASUS_ARRAY_T
56 */
57
58
59 #define CIMTYPE_EMBEDDED 15 //temporary
60 CQLValue::CQLValue()
61 {
|
62 david.dillard 1.5 _rep = new CQLValueRep();
|
63 chuck 1.2 }
64
65 CQLValue::~CQLValue()
66 {
|
67 david.dillard 1.5 delete _rep;
|
68 chuck 1.2 }
69
70 CQLValue::CQLValue(const CQLValue& val)
71 {
72 _rep = new CQLValueRep(val._rep);
73 }
74
75 CQLValue::CQLValue(String inString, NumericType inValueType, Boolean inSign)
76 {
77 _rep = new CQLValueRep(inString, inValueType, inSign);
78 }
79
80
81 CQLValue::CQLValue(CQLChainedIdentifier inCQLIdent)
82 {
83 _rep = new CQLValueRep(inCQLIdent);
84 }
85
86
87 CQLValue::CQLValue(String inString)
88 {
89 chuck 1.2 _rep = new CQLValueRep(inString);
90 }
91
92 CQLValue::CQLValue(CIMInstance inInstance)
93 {
94 _rep = new CQLValueRep(inInstance);
95 }
96
97 CQLValue::CQLValue(CIMClass inClass)
98 {
99 _rep = new CQLValueRep(inClass);
100 }
101
102 CQLValue::CQLValue(CIMObject inObject)
103 {
104 _rep = new CQLValueRep(inObject);
105 }
106
107 CQLValue::CQLValue(CIMValue inVal)
108 {
109 _rep = new CQLValueRep(inVal);
110 chuck 1.2 }
111
112 CQLValue::CQLValue(CIMObjectPath inObjPath)
|
113 david.dillard 1.5 {
|
114 chuck 1.2 _rep = new CQLValueRep(inObjPath);
115 }
116
117 CQLValue::CQLValue(CIMDateTime inDateTime)
118 {
119 _rep = new CQLValueRep(inDateTime);
120 }
121
122 CQLValue::CQLValue(Uint64 inUint)
123 {
124 _rep = new CQLValueRep(inUint);
125 }
126
127 CQLValue::CQLValue(Boolean inBool)
128 {
129 _rep = new CQLValueRep(inBool);
130 }
131
132 CQLValue::CQLValue(Sint64 inSint)
133 {
134 _rep = new CQLValueRep(inSint);
135 chuck 1.2 }
136
137 CQLValue::CQLValue(Real64 inReal)
138 {
139 _rep = new CQLValueRep(inReal);
140 }
141
142 CQLValue::CQLValue(CQLValueRep rhs)
143 {
144 _rep = new CQLValueRep(&rhs);
145 }
146
147 void CQLValue::resolve(const CIMInstance& CI,const QueryContext& inQueryCtx)
|
148 david.dillard 1.5 {
|
149 chuck 1.2 _rep->resolve(CI, inQueryCtx);
150 }
151
152 CQLValue& CQLValue::operator=(const CQLValue& rhs)
153 {
|
154 david.dillard 1.5 if(&rhs != this)
|
155 chuck 1.2 {
|
156 david.dillard 1.5 delete _rep;
157 _rep = NULL;
158 _rep = new CQLValueRep(rhs._rep);
159 }
160 return *this;
|
161 chuck 1.2 }
|
162 david.dillard 1.5
163 Boolean CQLValue::operator==(const CQLValue& x) const
|
164 chuck 1.2 {
165 return _rep->operator==(x._rep);
166 }
167
168 //##ModelId=40FBFF9502BB
|
169 david.dillard 1.5 Boolean CQLValue::operator!=(const CQLValue& x) const
|
170 chuck 1.2 {
171 return _rep->operator!=(x._rep);
172 }
173
|
174 david.dillard 1.5 Boolean CQLValue::operator<=(const CQLValue& x) const
|
175 chuck 1.2 {
176 return _rep->operator<=(x._rep);
177 }
178
|
179 david.dillard 1.5 Boolean CQLValue::operator>=(const CQLValue& x) const
|
180 chuck 1.2 {
181 return _rep->operator>=(x._rep);
182 }
183
|
184 david.dillard 1.5 Boolean CQLValue::operator<(const CQLValue& x) const
|
185 chuck 1.2 {
186 return _rep->operator<(x._rep);
187 }
188
|
189 david.dillard 1.5 Boolean CQLValue::operator>(const CQLValue& x) const
|
190 chuck 1.2 {
191 return _rep->operator>(x._rep);
192 }
193
194 CQLValue CQLValue::operator+(const CQLValue& x)
195 {
196 return CQLValue(_rep->operator+(x._rep));
197 }
198
199 /*
200 CQLValue CQLValue::operator-(const CQLValue& x)
201 {
202 return CQLValue(_rep->operator-(x._rep));
203 }
204
205 CQLValue CQLValue::operator*(const CQLValue& x)
206 {
207 return CQLValue(_rep->operator*(x._rep));
208 }
209
210
211 chuck 1.2 CQLValue CQLValue::operator/(const CQLValue& x)
212 {
213 return CQLValue(_rep->operator/(x._rep));
214 }
215 */
|
216 david.dillard 1.5
|
217 chuck 1.2 //##ModelId=40FC3F6F0302
|
218 david.dillard 1.5 CQLValue::CQLValueType CQLValue::getValueType() const
|
219 chuck 1.2 {
220 return _rep->getValueType();
221 }
222
223 void CQLValue::setNull()
224 {
225 _rep->setNull();
226 }
227
|
228 david.dillard 1.5 Boolean CQLValue::isResolved() const
|
229 chuck 1.2 {
230 return _rep->isResolved();
231 }
232
|
233 david.dillard 1.5 Boolean CQLValue::isNull() const
|
234 chuck 1.2 {
235 return _rep->isNull();
236 }
237
|
238 david.dillard 1.5 Boolean CQLValue::isa(const CQLChainedIdentifier& cid, QueryContext& QueryCtx) const
|
239 chuck 1.2 {
240 return _rep->isa(cid, QueryCtx);
241 }
242
|
243 david.dillard 1.5 Boolean CQLValue::like(const CQLValue& inVal) const
|
244 chuck 1.2 {
|
245 david.dillard 1.5 return _rep->like(inVal._rep);
|
246 chuck 1.2 }
247
248 /*
249 void CQLValue::invert()
250 {
251 _rep->invert();
252 }
253 */
254
|
255 david.dillard 1.5 CQLChainedIdentifier CQLValue::getChainedIdentifier() const
|
256 chuck 1.2 {
257 return _rep->getChainedIdentifier();
258 }
259
|
260 david.dillard 1.5 Uint64 CQLValue::getUint() const
|
261 chuck 1.2 {
262 return _rep->getUint();
263 }
264
|
265 david.dillard 1.5 Boolean CQLValue::getBool() const
|
266 chuck 1.2 {
267 return _rep->getBool();
268 }
269
|
270 david.dillard 1.5 Sint64 CQLValue::getSint() const
|
271 chuck 1.2 {
272 return _rep->getSint();
273 }
274
|
275 david.dillard 1.5 Real64 CQLValue::getReal() const
|
276 chuck 1.2 {
277 return _rep->getReal();
278 }
279
|
280 david.dillard 1.5 String CQLValue::getString() const
|
281 chuck 1.2 {
282 return _rep->getString();
283 }
284
|
285 david.dillard 1.5 CIMDateTime CQLValue::getDateTime() const
|
286 chuck 1.2 {
287 return _rep->getDateTime();
288 }
289
|
290 david.dillard 1.5 CIMObjectPath CQLValue::getReference() const
|
291 chuck 1.2 {
292 return _rep->getReference();
293 }
294
|
295 david.dillard 1.5 CIMObject CQLValue::getObject() const
|
296 chuck 1.2 {
297 return _rep->getObject();
298 }
299
|
300 david.dillard 1.5 String CQLValue::toString() const
|
301 chuck 1.2 {
302 return _rep->toString();
303 }
304
|
305 chuck 1.3 void CQLValue::applyContext(QueryContext& _ctx,
306 CQLChainedIdentifier& inCid)
|
307 chuck 1.2 {
|
308 david.dillard 1.5 _rep->applyContext(_ctx,inCid);
|
309 chuck 1.2 }
310
311
312
313 PEGASUS_NAMESPACE_END
|