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 chuck 1.2 _rep = new CQLExpressionRep();
57 }
58
59 CQLExpression::CQLExpression(const CQLTerm& theTerm)
60 {
61 _rep = new CQLExpressionRep(theTerm);
62
63 }
64
65 CQLExpression::CQLExpression(const CQLExpression& inExpress)
66 {
67 _rep = new CQLExpressionRep(inExpress._rep);
68 }
69
70 CQLExpression::~CQLExpression()
71 {
72 if(_rep)
73 delete _rep;
74 }
75
76 CQLValue CQLExpression::resolveValue(const CIMInstance& CI, const QueryContext& QueryCtx)
77 chuck 1.2 {
78 return _rep->resolveValue(CI,QueryCtx);
79 }
80
81 void CQLExpression::appendOperation(const TermOpType theTermOpType, const CQLTerm& theTerm)
82 {
83 _rep->appendOperation(theTermOpType,theTerm);
84 }
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 return _rep->isSimpleValue();
97 }
98 chuck 1.2
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 const CQLChainedIdentifier inCid)
|
111 chuck 1.2 {
112 _rep->applyContext(inContext, inCid);
113 }
114
115 CQLExpression& CQLExpression::operator=(const CQLExpression& rhs)
116 {
117 if(&rhs != this){
118 if(_rep) delete _rep;
119 _rep = new CQLExpressionRep(rhs._rep);
120 }
121 return *this;
122 }
|
123 humberto 1.4 /*
|
124 chuck 1.2 Boolean CQLExpression::operator==(const CQLExpression& expr)const
125 {
|
126 humberto 1.3 return *_rep == *(expr._rep);
|
127 chuck 1.2 }
128
129 Boolean CQLExpression::operator!=(const CQLExpression& expr)const
130 {
131 return (!operator==(expr));
132 }
|
133 humberto 1.4 */
|
134 chuck 1.2 PEGASUS_NAMESPACE_END
135
|