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 //%/////////////////////////////////////////////////////////////////////////////
31
|
32 kumpf 1.12 #include <Pegasus/CQL/CQLTerm.h>
|
33 chuck 1.2 #include <Pegasus/CQL/CQLTermRep.h>
34 #include <Pegasus/CQL/CQLFactory.h>
35 #include <Pegasus/Query/QueryCommon/QueryContext.h>
36 PEGASUS_NAMESPACE_BEGIN
37
38 /*
39 #define PEGASUS_ARRAY_T FactorOpType
40 #include <Pegasus/Common/ArrayImpl.h>
41 #undef PEGASUS_ARRAY_T
42
43 #define PEGASUS_ARRAY_T CQLTerm
44 #include <Pegasus/Common/ArrayImpl.h>
45 #undef PEGASUS_ARRAY_T
46 */
47
48 CQLTerm::CQLTerm()
49 {
|
50 karl 1.9 _rep = new CQLTermRep();
|
51 chuck 1.2 }
52
53 CQLTerm::CQLTerm(const CQLTerm& inTerm)
54 {
|
55 karl 1.9 _rep = new CQLTermRep(*inTerm._rep);
|
56 chuck 1.2 }
57
58 CQLTerm::CQLTerm(const CQLFactor& theFactor)
59 {
|
60 karl 1.9 _rep = new CQLTermRep(theFactor);
|
61 chuck 1.2 }
62
63 CQLTerm::~CQLTerm()
64 {
|
65 karl 1.9 if(_rep)
66 delete _rep;
|
67 chuck 1.2 }
68
|
69 karl 1.9 CQLValue CQLTerm::resolveValue(const CIMInstance& CI,
70 const QueryContext& QueryCtx)
|
71 chuck 1.2 {
|
72 karl 1.9 return _rep->resolveValue(CI,QueryCtx);
|
73 chuck 1.2 }
74
|
75 karl 1.9 void CQLTerm::appendOperation(FactorOpType inFactorOpType,
76 const CQLFactor& inFactor)
|
77 chuck 1.2 {
|
78 karl 1.9 _rep->appendOperation(inFactorOpType,inFactor);
|
79 chuck 1.2 }
80
81 String CQLTerm::toString()const
82 {
|
83 karl 1.9 return _rep->toString();
|
84 chuck 1.2 }
85
86 Boolean CQLTerm::isSimple()const
87 {
|
88 karl 1.9 return _rep->isSimple();
|
89 chuck 1.2 }
90
91 Boolean CQLTerm::isSimpleValue()const
92 {
|
93 karl 1.9 return _rep->isSimpleValue();
|
94 chuck 1.2 }
95
96 Array<CQLFactor> CQLTerm::getFactors()const
97 {
|
98 karl 1.9 return _rep->getFactors();
|
99 chuck 1.2 }
100
101 Array<FactorOpType> CQLTerm::getOperators()const
102 {
|
103 karl 1.9 return _rep->getOperators();
|
104 chuck 1.2 }
105
|
106 vijay.eli 1.6 void CQLTerm::applyContext(const QueryContext& inContext,
107 const CQLChainedIdentifier& inCid)
|
108 chuck 1.2 {
|
109 karl 1.9 _rep->applyContext(inContext,inCid);
|
110 chuck 1.2 }
111
112 CQLTerm& CQLTerm::operator=(const CQLTerm& rhs)
113 {
|
114 karl 1.9 if(&rhs != this)
115 {
116 if(_rep) delete _rep;
117 _rep = new CQLTermRep(*rhs._rep);
118 }
119 return *this;
|
120 chuck 1.2 }
|
121 humberto 1.4 /*
|
122 chuck 1.2 Boolean CQLTerm::operator==(const CQLTerm& rhs)const
123 {
|
124 karl 1.9 return (*_rep == *(rhs._rep));
|
125 chuck 1.2 }
126 Boolean CQLTerm::operator!=(const CQLTerm& rhs)const
127 {
|
128 karl 1.9 return (!operator==(rhs));
|
129 chuck 1.2 }
|
130 humberto 1.4 */
|
131 chuck 1.2 PEGASUS_NAMESPACE_END
|