(file) Return to CQLValue.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / CQL

  1 karl  1.9 //%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.9 // 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.9 // 
 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           // Author: Dave Rosckes (rosckes@us.ibm.com)
 33           //
 34 david.dillard 1.5 // Modified By: David Dillard, VERITAS Software Corp.
 35                   //                  (david.dillard@veritas.com)
 36 vijay.eli     1.8 //              Vijay Eli, IBM (vijayeli@in.ibm.com) bug#3590
 37 chuck         1.2 //
 38                   //%/////////////////////////////////////////////////////////////////////////////
 39                   #include <Pegasus/CQL/CQLValue.h>
 40                   #include <Pegasus/Repository/NameSpaceManager.h>
 41                   #include <Pegasus/Common/CIMClass.h>
 42                   #include <Pegasus/CQL/CQLIdentifier.h>
 43                   #include <Pegasus/CQL/CQLValue.h>
 44 david.dillard 1.7 #include <Pegasus/CQL/CQLValueRep.h>
 45 chuck         1.2 #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                   #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 david.dillard 1.6 CQLValue::CQLValue(const String& inString, NumericType inValueType, Boolean inSign)
 76 chuck         1.2 {
 77                      _rep = new CQLValueRep(inString, inValueType, inSign);
 78                   }
 79                   
 80                   
 81 david.dillard 1.6 CQLValue::CQLValue(const CQLChainedIdentifier& inCQLIdent)
 82 chuck         1.2 {
 83                      _rep = new CQLValueRep(inCQLIdent);
 84                   }
 85                   
 86                   
 87 david.dillard 1.6 CQLValue::CQLValue(const String& inString)
 88 chuck         1.2 {
 89                      _rep = new CQLValueRep(inString);
 90                   }
 91                   
 92 david.dillard 1.6 CQLValue::CQLValue(const CIMInstance& inInstance)
 93 chuck         1.2 {
 94                      _rep = new CQLValueRep(inInstance);
 95                   }
 96                   
 97 david.dillard 1.6 CQLValue::CQLValue(const CIMClass& inClass)
 98 chuck         1.2 {
 99                      _rep = new CQLValueRep(inClass);
100                   }
101                   
102 david.dillard 1.6 CQLValue::CQLValue(const CIMObject& inObject)
103 chuck         1.2 {
104                      _rep = new CQLValueRep(inObject);
105                   }
106                   
107 david.dillard 1.6 CQLValue::CQLValue(const CIMValue& inVal)
108 chuck         1.2 {
109                      _rep = new CQLValueRep(inVal);
110                   }
111                   
112 david.dillard 1.6 CQLValue::CQLValue(const CIMObjectPath& inObjPath)
113 david.dillard 1.5 {
114 chuck         1.2    _rep = new CQLValueRep(inObjPath);
115                   }
116                   
117 david.dillard 1.6 CQLValue::CQLValue(const CIMDateTime& inDateTime)
118 chuck         1.2 {
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                   }
136                   
137                   CQLValue::CQLValue(Real64 inReal)
138                   {
139 chuck         1.2    _rep = new CQLValueRep(inReal);
140                   }
141                   
142 david.dillard 1.6 CQLValue::CQLValue(const CQLValueRep& rhs)
143 chuck         1.2 {
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 vijay.eli     1.8 void CQLValue::applyContext(const QueryContext& _ctx,
306                                               const 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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2