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

  1 martin 1.10 //%LICENSE////////////////////////////////////////////////////////////////
  2 martin 1.11 //
  3 martin 1.10 // Licensed to The Open Group (TOG) under one or more contributor license
  4             // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
  5             // this work for additional information regarding copyright ownership.
  6             // Each contributor licenses this file to you under the OpenPegasus Open
  7             // Source License; you may not use this file except in compliance with the
  8             // License.
  9 martin 1.11 //
 10 martin 1.10 // Permission is hereby granted, free of charge, to any person obtaining a
 11             // copy of this software and associated documentation files (the "Software"),
 12             // to deal in the Software without restriction, including without limitation
 13             // the rights to use, copy, modify, merge, publish, distribute, sublicense,
 14             // and/or sell copies of the Software, and to permit persons to whom the
 15             // Software is furnished to do so, subject to the following conditions:
 16 martin 1.11 //
 17 martin 1.10 // The above copyright notice and this permission notice shall be included
 18             // in all copies or substantial portions of the Software.
 19 martin 1.11 //
 20 martin 1.10 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 21 martin 1.11 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 22 martin 1.10 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 23             // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 24             // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 25             // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 26             // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 27 martin 1.11 //
 28 martin 1.10 //////////////////////////////////////////////////////////////////////////
 29 chuck  1.2  //
 30             // Author: Dave Rosckes (rosckes@us.ibm.com)
 31             //
 32 vijay.eli 1.6  // Modified By: Vijay Eli, IBM (vijayeli@in.ibm.com) bug#3590.
 33 chuck     1.2  //
 34                //%/////////////////////////////////////////////////////////////////////////////
 35                
 36                #include <Pegasus/CQL/CQLExpression.h>
 37                #include <Pegasus/CQL/CQLExpressionRep.h>
 38                #include <Pegasus/CQL/CQLFactory.h>
 39                #include <Pegasus/Query/QueryCommon/QueryContext.h>
 40                
 41                PEGASUS_NAMESPACE_BEGIN
 42                
 43                /*
 44                #define PEGASUS_ARRAY_T TermOpType
 45                #include <Pegasus/Common/ArrayImpl.h>
 46                #undef PEGASUS_ARRAY_T
 47                
 48                #define PEGASUS_ARRAY_T CQLExpression
 49                #include <Pegasus/Common/ArrayImpl.h>
 50                */
 51                
 52                CQLExpression::CQLExpression()
 53                {
 54 karl      1.8      _rep = new CQLExpressionRep();
 55 chuck     1.2  }
 56                
 57                CQLExpression::CQLExpression(const CQLTerm& theTerm)
 58                {
 59                   _rep = new CQLExpressionRep(theTerm);
 60                
 61                }
 62                
 63 kumpf     1.12 CQLExpression::CQLExpression(const CQLExpression& inExpress)
 64 chuck     1.2  {
 65 karl      1.8      _rep = new CQLExpressionRep(inExpress._rep);
 66 chuck     1.2  }
 67                
 68                CQLExpression::~CQLExpression()
 69                {
 70 karl      1.8      if(_rep)
 71                        delete _rep;
 72 chuck     1.2  }
 73                
 74 karl      1.8  CQLValue CQLExpression::resolveValue(const CIMInstance& CI,
 75                                                     const QueryContext& QueryCtx)
 76 chuck     1.2  {
 77 karl      1.8      return _rep->resolveValue(CI,QueryCtx);
 78 chuck     1.2  }
 79                
 80 karl      1.8  void CQLExpression::appendOperation(const TermOpType theTermOpType,
 81                                                    const CQLTerm& theTerm)
 82 chuck     1.2  {
 83 karl      1.8      _rep->appendOperation(theTermOpType,theTerm);
 84 chuck     1.2  }
 85                
 86                String CQLExpression::toString()const
 87                {
 88                   return _rep->toString();
 89                }
 90                Boolean CQLExpression::isSimple()const
 91                {
 92                        return _rep->isSimple();
 93                }
 94                Boolean CQLExpression::isSimpleValue()const
 95                {
 96 karl      1.8      return _rep->isSimpleValue();
 97 chuck     1.2  }
 98                
 99                Array<CQLTerm> CQLExpression::getTerms()const
100                {
101                   return _rep->getTerms();
102                }
103                
104                Array<TermOpType> CQLExpression::getOperators()const
105                {
106                   return _rep->getOperators();
107                }
108                
109 vijay.eli 1.6  void CQLExpression::applyContext(const QueryContext& inContext,
110 s.kodali  1.9                                   const CQLChainedIdentifier& inCid)
111 chuck     1.2  {
112                  _rep->applyContext(inContext, inCid);
113                }
114                
115                CQLExpression& CQLExpression::operator=(const CQLExpression& rhs)
116                {
117 karl      1.8      if(&rhs != this){
118                        if(_rep) delete _rep;
119                        _rep = new CQLExpressionRep(rhs._rep);
120                    }
121                    return *this;
122 chuck     1.2  }
123 humberto  1.4  /*
124 chuck     1.2  Boolean CQLExpression::operator==(const CQLExpression& expr)const
125                {
126 karl      1.8      return *_rep == *(expr._rep);
127 chuck     1.2  }
128                
129                Boolean CQLExpression::operator!=(const CQLExpression& expr)const
130                {
131 karl      1.8      return (!operator==(expr));
132 chuck     1.2  }
133 humberto  1.4  */
134 chuck     1.2  PEGASUS_NAMESPACE_END
135                

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2