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

  1 martin 1.10 //%LICENSE////////////////////////////////////////////////////////////////
  2             // 
  3             // 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             // 
 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             // 
 17             // The above copyright notice and this permission notice shall be included
 18             // in all copies or substantial portions of the Software.
 19             // 
 20             // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 21             // 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 chuck  1.2  // 
 28 martin 1.10 //////////////////////////////////////////////////////////////////////////
 29 chuck  1.2  //
 30             //%/////////////////////////////////////////////////////////////////////////////
 31             
 32 david.dillard 1.6  #include <Pegasus/CQL/CQLSimplePredicate.h>
 33                    #include <Pegasus/CQL/CQLSimplePredicateRep.h>
 34 chuck         1.2  #include <Pegasus/CQL/CQLExpression.h>
 35                    #include <Pegasus/CQL/CQLFactory.h>
 36                    #include <Pegasus/Query/QueryCommon/QueryContext.h>
 37                    
 38                    PEGASUS_NAMESPACE_BEGIN
 39                    
 40 david.dillard 1.6  CQLSimplePredicate::CQLSimplePredicate()
 41                    {
 42                        _rep = new CQLSimplePredicateRep();
 43 chuck         1.2  }
 44                    
 45                    CQLSimplePredicate::CQLSimplePredicate(const CQLExpression& inExpression)
 46                    {
 47 david.dillard 1.6      _rep = new CQLSimplePredicateRep(inExpression);
 48 chuck         1.2  }
 49                    
 50                    CQLSimplePredicate::CQLSimplePredicate(const CQLExpression& inExpression, 
 51 david.dillard 1.6                         ExpressionOpType inOperator)
 52 chuck         1.2  {
 53 david.dillard 1.6      _rep = new CQLSimplePredicateRep(inExpression, inOperator);
 54 chuck         1.2  }
 55                    
 56                    CQLSimplePredicate::CQLSimplePredicate(const CQLExpression& leftSideExpression,
 57 david.dillard 1.6                         const CQLExpression& rightSideExpression,
 58                                           ExpressionOpType inOperator)
 59 chuck         1.2  {
 60 karl          1.9      _rep = new CQLSimplePredicateRep(leftSideExpression,rightSideExpression, 
 61                                                         inOperator);
 62 chuck         1.2  }
 63                    
 64 karl          1.9  CQLSimplePredicate::CQLSimplePredicate(
 65                        const CQLSimplePredicate& inSimplePredicate)
 66 david.dillard 1.6  {
 67                        _rep = new CQLSimplePredicateRep(inSimplePredicate._rep);
 68 chuck         1.2  }
 69                    
 70 david.dillard 1.6  CQLSimplePredicate::~CQLSimplePredicate()
 71                    {
 72                        delete _rep;
 73 chuck         1.2  }
 74                    
 75                    Boolean CQLSimplePredicate::evaluate(CIMInstance CI, QueryContext& QueryCtx)
 76                    {
 77 david.dillard 1.6      return _rep->evaluate(CI,QueryCtx);
 78 chuck         1.2  }
 79                    
 80 david.dillard 1.6  CQLExpression CQLSimplePredicate::getLeftExpression() const
 81 chuck         1.2  {
 82 david.dillard 1.6      return _rep->getLeftExpression();
 83 chuck         1.2  }
 84                    
 85 david.dillard 1.6  CQLExpression CQLSimplePredicate::getRightExpression() const
 86 chuck         1.2  {
 87 david.dillard 1.6      return _rep->getRightExpression();
 88 chuck         1.2  }
 89                    
 90 david.dillard 1.6  enum ExpressionOpType CQLSimplePredicate::getOperation() const
 91 chuck         1.2  {
 92 david.dillard 1.6      return _rep->getOperation();
 93 chuck         1.2  }
 94                    
 95 vijay.eli     1.7  void CQLSimplePredicate::applyContext(const QueryContext& queryContext)
 96 chuck         1.2  {
 97 david.dillard 1.6      _rep->applyContext(queryContext);
 98 chuck         1.2  }
 99                    
100 david.dillard 1.6  String CQLSimplePredicate::toString() const
101 chuck         1.2  {
102 david.dillard 1.6      return _rep->toString();
103 chuck         1.2  }
104 david.dillard 1.6  
105                    Boolean CQLSimplePredicate::isSimple() const
106                    {
107                        return _rep->isSimple();
108 chuck         1.2  }
109 david.dillard 1.6  
110                    Boolean CQLSimplePredicate::isSimpleValue() const
111                    {
112                        return _rep->isSimpleValue();
113 chuck         1.2  }
114                     
115 karl          1.9  CQLSimplePredicate& CQLSimplePredicate::operator=(
116                        const CQLSimplePredicate& rhs)
117 david.dillard 1.6  {
118                        if(&rhs != this)
119                        {
120                            delete _rep;
121                            _rep = 0;
122                            _rep = new CQLSimplePredicateRep(rhs._rep);
123                        }
124                    
125                        return *this;
126 chuck         1.2  }
127                    
128 david.dillard 1.6  void CQLSimplePredicate::setOperation(ExpressionOpType op)
129                    {
130                        _rep->setOperation(op);
131 chuck         1.2  }
132                    
133                    PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2