1 chuck 1.1.2.10 //%2003////////////////////////////////////////////////////////////////////////
2 //
3 // 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 // IBM Corp.; EMC Corporation, The Open Group.
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to
10 // deal in the Software without restriction, including without limitation the
11 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12 // sell copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 //
15 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
16 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
17 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
18 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 chuck 1.1.2.10 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 //
24 //==============================================================================
25 //
26 // Authors: David Rosckes (rosckes@us.ibm.com)
27 // Bert Rivero (hurivero@us.ibm.com)
28 // Chuck Carmack (carmack@us.ibm.com)
29 // Brian Lucier (lucier@us.ibm.com)
30 //
31 // Modified By:
32 //
33 //%/////////////////////////////////////////////////////////////////////////////
34
|
35 humberto 1.1.2.1 #include "CQLSimplePredicate.h"
|
36 humberto 1.1.2.5 #include "CQLSimplePredicateRep.h"
|
37 humberto 1.1.2.1 #include <Pegasus/CQL/CQLExpression.h>
|
38 humberto 1.1.2.4 #include <Pegasus/CQL/CQLFactory.h>
|
39 humberto 1.1.2.5 #include <Pegasus/CQL/QueryContext.h>
40
|
41 humberto 1.1.2.1 PEGASUS_NAMESPACE_BEGIN
42
|
43 humberto 1.1.2.8 CQLSimplePredicate::CQLSimplePredicate(){
44 _rep = new CQLSimplePredicateRep();
45 }
46
|
47 humberto 1.1.2.1 CQLSimplePredicate::CQLSimplePredicate(const CQLExpression& inExpression)
48 {
|
49 humberto 1.1.2.5 _rep = new CQLSimplePredicateRep(inExpression);
|
50 humberto 1.1.2.1 }
51
|
52 chuck 1.1.2.9 CQLSimplePredicate::CQLSimplePredicate(const CQLExpression& inExpression,
53 const ExpressionOpType inOperator)
|
54 humberto 1.1.2.1 {
|
55 humberto 1.1.2.5 _rep = new CQLSimplePredicateRep(inExpression,inOperator);
|
56 humberto 1.1.2.1 }
57
|
58 chuck 1.1.2.9 CQLSimplePredicate::CQLSimplePredicate(const CQLExpression& leftSideExpression,
59 const CQLExpression& rightSideExpression,
60 ExpressionOpType inOperator)
|
61 humberto 1.1.2.1 {
|
62 humberto 1.1.2.5 _rep = new CQLSimplePredicateRep(leftSideExpression,rightSideExpression,inOperator);
63 }
64
65 CQLSimplePredicate::CQLSimplePredicate(const CQLSimplePredicate& inSimplePredicate){
|
66 humberto 1.1.2.8 _rep = new CQLSimplePredicateRep(inSimplePredicate._rep);
|
67 humberto 1.1.2.5 }
68
69 CQLSimplePredicate::~CQLSimplePredicate(){
70 if(_rep)
71 delete _rep;
|
72 humberto 1.1.2.1 }
73
74 Boolean CQLSimplePredicate::evaluate(CIMInstance CI, QueryContext& QueryCtx)
75 {
|
76 humberto 1.1.2.5 return _rep->evaluate(CI,QueryCtx);
|
77 humberto 1.1.2.1 }
78
79 CQLExpression CQLSimplePredicate::getLeftExpression()
80 {
|
81 humberto 1.1.2.5 return _rep->getLeftExpression();
|
82 humberto 1.1.2.1 }
83
84 CQLExpression CQLSimplePredicate::getRightExpression()
85 {
|
86 humberto 1.1.2.5 return _rep->getRightExpression();
|
87 humberto 1.1.2.1 }
88
89 enum ExpressionOpType CQLSimplePredicate::getOperation()
90 {
|
91 humberto 1.1.2.5 return _rep->getOperation();
|
92 humberto 1.1.2.1 }
93
|
94 chuck 1.1.2.9 void CQLSimplePredicate::applyContext(QueryContext& queryContext)
95 {
96 _rep->applyContext(queryContext);
97 }
98
|
99 humberto 1.1.2.1 String CQLSimplePredicate::toString()
100 {
|
101 humberto 1.1.2.5 return _rep->toString();
|
102 humberto 1.1.2.1 }
|
103 humberto 1.1.2.7 Boolean CQLSimplePredicate::isSimple(){
104 return _rep->isSimple();
105 }
|
106 humberto 1.1.2.6 Boolean CQLSimplePredicate::isSimpleValue(){
107 return _rep->isSimpleValue();
108 }
|
109 humberto 1.1.2.1
|
110 humberto 1.1.2.8 CQLSimplePredicate& CQLSimplePredicate::operator=(const CQLSimplePredicate& rhs){
111 if(&rhs != this){
112 if(_rep) delete _rep;
113 _rep = new CQLSimplePredicateRep(rhs._rep);
114 }
115 return *this;
116 }
117
|
118 humberto 1.1.2.1 PEGASUS_NAMESPACE_END
|