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

  1 karl  1.7 //%2006////////////////////////////////////////////////////////////////////////
  2 chuck 1.2 //
  3 karl  1.5 // 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.5 // 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           // 
 21           // 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 vijay.eli 1.6 // Modified By: Vijay Eli, IBM (vijayeli@in.ibm.com) bug#3590.
 35 chuck     1.2 //
 36               //%/////////////////////////////////////////////////////////////////////////////
 37               
 38               #include <Pegasus/CQL/CQLExpression.h>
 39               #include <Pegasus/CQL/CQLExpressionRep.h>
 40               #include <Pegasus/CQL/CQLFactory.h>
 41               #include <Pegasus/Query/QueryCommon/QueryContext.h>
 42               
 43               PEGASUS_NAMESPACE_BEGIN
 44               
 45               /*
 46               #define PEGASUS_ARRAY_T TermOpType
 47               #include <Pegasus/Common/ArrayImpl.h>
 48               #undef PEGASUS_ARRAY_T
 49               
 50               #define PEGASUS_ARRAY_T CQLExpression
 51               #include <Pegasus/Common/ArrayImpl.h>
 52               */
 53               
 54               CQLExpression::CQLExpression()
 55               {
 56 karl      1.8     _rep = new CQLExpressionRep();
 57 chuck     1.2 }
 58               
 59               CQLExpression::CQLExpression(const CQLTerm& theTerm)
 60               {
 61                  _rep = new CQLExpressionRep(theTerm);
 62               
 63               }
 64               
 65               CQLExpression::CQLExpression(const CQLExpression& inExpress) 
 66               {
 67 karl      1.8     _rep = new CQLExpressionRep(inExpress._rep);
 68 chuck     1.2 }
 69               
 70               CQLExpression::~CQLExpression()
 71               {
 72 karl      1.8     if(_rep)
 73                       delete _rep;
 74 chuck     1.2 }
 75               
 76 karl      1.8 CQLValue CQLExpression::resolveValue(const CIMInstance& CI,
 77                                                    const QueryContext& QueryCtx)
 78 chuck     1.2 {
 79 karl      1.8     return _rep->resolveValue(CI,QueryCtx);
 80 chuck     1.2 }
 81               
 82 karl      1.8 void CQLExpression::appendOperation(const TermOpType theTermOpType,
 83                                                   const CQLTerm& theTerm)
 84 chuck     1.2 {
 85 karl      1.8     _rep->appendOperation(theTermOpType,theTerm);
 86 chuck     1.2 }
 87               
 88               String CQLExpression::toString()const
 89               {
 90                  return _rep->toString();
 91               }
 92               Boolean CQLExpression::isSimple()const
 93               {
 94                       return _rep->isSimple();
 95               }
 96               Boolean CQLExpression::isSimpleValue()const
 97               {
 98 karl      1.8     return _rep->isSimpleValue();
 99 chuck     1.2 }
100               
101               Array<CQLTerm> CQLExpression::getTerms()const
102               {
103                  return _rep->getTerms();
104               }
105               
106               Array<TermOpType> CQLExpression::getOperators()const
107               {
108                  return _rep->getOperators();
109               }
110               
111 vijay.eli 1.6 void CQLExpression::applyContext(const QueryContext& inContext,
112                                                const CQLChainedIdentifier inCid)
113 chuck     1.2 {
114                 _rep->applyContext(inContext, inCid);
115               }
116               
117               CQLExpression& CQLExpression::operator=(const CQLExpression& rhs)
118               {
119 karl      1.8     if(&rhs != this){
120                       if(_rep) delete _rep;
121                       _rep = new CQLExpressionRep(rhs._rep);
122                   }
123                   return *this;
124 chuck     1.2 }
125 humberto  1.4 /*
126 chuck     1.2 Boolean CQLExpression::operator==(const CQLExpression& expr)const
127               {
128 karl      1.8     return *_rep == *(expr._rep);
129 chuck     1.2 }
130               
131               Boolean CQLExpression::operator!=(const CQLExpression& expr)const
132               {
133 karl      1.8     return (!operator==(expr));
134 chuck     1.2 }
135 humberto  1.4 */
136 chuck     1.2 PEGASUS_NAMESPACE_END
137               

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2