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

  1 karl  1.5 //%2005////////////////////////////////////////////////////////////////////////
  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 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           // 
 19           // 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           // Authors: David Rosckes (rosckes@us.ibm.com)
 31           //          Bert Rivero (hurivero@us.ibm.com)
 32 chuck 1.2 //          Chuck Carmack (carmack@us.ibm.com)
 33           //          Brian Lucier (lucier@us.ibm.com) 
 34           //
 35 david.dillard 1.3 // Modified By: David Dillard, VERITAS Software Corp.
 36                   //                  (david.dillard@veritas.com)
 37 chuck         1.2 //
 38                   //%/////////////////////////////////////////////////////////////////////////////
 39                   
 40                   #include "CQLSimplePredicate.h"
 41                   #include "CQLSimplePredicateRep.h"
 42                   #include <Pegasus/CQL/CQLExpression.h>
 43                   #include <Pegasus/CQL/CQLFactory.h>
 44                   #include <Pegasus/Query/QueryCommon/QueryContext.h>
 45                   
 46                   PEGASUS_NAMESPACE_BEGIN
 47                   
 48                   CQLSimplePredicate::CQLSimplePredicate(){
 49                   	_rep = new CQLSimplePredicateRep();
 50                   }
 51                   
 52                   CQLSimplePredicate::CQLSimplePredicate(const CQLExpression& inExpression)
 53                   {
 54                   	_rep = new CQLSimplePredicateRep(inExpression);
 55                   }
 56                   
 57                   CQLSimplePredicate::CQLSimplePredicate(const CQLExpression& inExpression, 
 58 david.dillard 1.3 				       ExpressionOpType inOperator)
 59 chuck         1.2 {
 60                   	_rep = new CQLSimplePredicateRep(inExpression,inOperator);
 61                   }
 62                   
 63                   CQLSimplePredicate::CQLSimplePredicate(const CQLExpression& leftSideExpression,
 64                   				       const CQLExpression& rightSideExpression,
 65                   				       ExpressionOpType inOperator)
 66                   {
 67                   	_rep = new CQLSimplePredicateRep(leftSideExpression,rightSideExpression,inOperator);
 68                   }
 69                   
 70                   CQLSimplePredicate::CQLSimplePredicate(const CQLSimplePredicate& inSimplePredicate){
 71                           _rep = new CQLSimplePredicateRep(inSimplePredicate._rep);
 72                   }
 73                   
 74                   CQLSimplePredicate::~CQLSimplePredicate(){
 75                   	if(_rep)
 76                   		delete _rep;
 77                   }
 78                   
 79                   Boolean CQLSimplePredicate::evaluate(CIMInstance CI, QueryContext& QueryCtx)
 80 chuck         1.2 {
 81                   	return _rep->evaluate(CI,QueryCtx);
 82                   }
 83                   
 84                   CQLExpression CQLSimplePredicate::getLeftExpression()const
 85                   {
 86                   	return _rep->getLeftExpression();
 87                   }
 88                   
 89                   CQLExpression CQLSimplePredicate::getRightExpression()const
 90                   {
 91                           return _rep->getRightExpression();
 92                   }
 93                   
 94                   enum ExpressionOpType CQLSimplePredicate::getOperation()const
 95                   {
 96                   	return _rep->getOperation();
 97                   }
 98                   
 99                   void CQLSimplePredicate::applyContext(QueryContext& queryContext)
100                   {
101 chuck         1.2   _rep->applyContext(queryContext);
102                   }
103                   
104                   String CQLSimplePredicate::toString()const
105                   {
106                   	return _rep->toString();
107                   }
108                   Boolean CQLSimplePredicate::isSimple()const{
109                           return _rep->isSimple();
110                   }
111                   Boolean CQLSimplePredicate::isSimpleValue()const{
112                   	return _rep->isSimpleValue();
113                   }
114                    
115                   CQLSimplePredicate& CQLSimplePredicate::operator=(const CQLSimplePredicate& rhs){
116                   	if(&rhs != this){
117                   		if(_rep) delete _rep;
118                   		_rep = new CQLSimplePredicateRep(rhs._rep);
119                   	}
120                   	return *this;
121                   }
122 chuck         1.2 
123                   void CQLSimplePredicate::setOperation(ExpressionOpType op){
124                   	_rep->setOperation(op);
125                   }
126                   
127                   PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2