1 martin 1.20 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.21 //
|
3 martin 1.20 // 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.21 //
|
10 martin 1.20 // 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.21 //
|
17 martin 1.20 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.21 //
|
20 martin 1.20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.21 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.20 // 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.21 //
|
28 martin 1.20 //////////////////////////////////////////////////////////////////////////
|
29 mike 1.2 //
30 //%/////////////////////////////////////////////////////////////////////////////
|
31 chuck 1.12 #include "WQLSelectStatement.h"
32 #include "WQLSelectStatementRep.h"
|
33 mike 1.2 #include <iostream>
34 #include <Pegasus/Common/Stack.h>
35
36 PEGASUS_USING_STD;
37
38 PEGASUS_NAMESPACE_BEGIN
39
|
40 kumpf 1.19 WQLSelectStatement::WQLSelectStatement(
41 const String& queryLang,
42 const String& query)
43 : SelectStatement()
|
44 mike 1.2 {
|
45 karl 1.17 _rep = new WQLSelectStatementRep(queryLang,query);
46 // Set the _rep into the base class also
47 SelectStatement::_rep = _rep;
|
48 chuck 1.12 }
|
49 mike 1.2
|
50 kumpf 1.19 WQLSelectStatement::WQLSelectStatement(
51 const String& queryLang,
52 const String& query,
53 const QueryContext& inCtx)
54 : SelectStatement()
|
55 chuck 1.12 {
|
56 karl 1.17 _rep = new WQLSelectStatementRep(queryLang,query,inCtx);
57 // Set the _rep into the base class also
58 SelectStatement::_rep = _rep;
|
59 chuck 1.12 }
|
60 mike 1.2
|
61 chuck 1.12 WQLSelectStatement::WQLSelectStatement()
62 :SelectStatement()
63 {
|
64 karl 1.17 _rep = new WQLSelectStatementRep();
65 // Set the _rep into the base class also
66 SelectStatement::_rep = _rep;
|
67 mike 1.2 }
68
|
69 chuck 1.12 WQLSelectStatement::WQLSelectStatement(const WQLSelectStatement& statement)
70 :SelectStatement()
|
71 mike 1.2 {
|
72 karl 1.17 _rep = new WQLSelectStatementRep(*statement._rep);
|
73 kumpf 1.22
|
74 karl 1.17 // Set the _rep into the base class also
75 SelectStatement::_rep = _rep;
|
76 mike 1.2 }
77
|
78 chuck 1.12 WQLSelectStatement& WQLSelectStatement::operator=(const WQLSelectStatement& rhs)
|
79 mike 1.2 {
|
80 karl 1.17 if(&rhs != this)
81 {
82 if(_rep) delete _rep;
83 _rep = new WQLSelectStatementRep(*rhs._rep);
|
84 kumpf 1.22
|
85 karl 1.17 // Set the _rep into the base class also
86 SelectStatement::_rep = _rep;
87 }
|
88 kumpf 1.6
|
89 chuck 1.12 return *this;
|
90 mike 1.2 }
91
|
92 chuck 1.12
|
93 mike 1.2 WQLSelectStatement::~WQLSelectStatement()
94 {
|
95 karl 1.17 delete _rep;
|
96 mike 1.2 }
97
98 void WQLSelectStatement::clear()
99 {
|
100 karl 1.17 _rep->clear();
|
101 mike 1.2 }
102
|
103 kumpf 1.6 Boolean WQLSelectStatement::getAllProperties() const
104 {
|
105 chuck 1.12 return _rep->getAllProperties();
|
106 kumpf 1.6 }
107
108 void WQLSelectStatement::setAllProperties(const Boolean allProperties)
109 {
|
110 chuck 1.12 _rep->setAllProperties(allProperties);
|
111 kumpf 1.6 }
112
|
113 kumpf 1.18 CIMPropertyList WQLSelectStatement::getSelectPropertyList(
114 const CIMObjectPath& inClassName)
|
115 kumpf 1.6 {
|
116 karl 1.17 return _rep->getSelectPropertyList(inClassName);
|
117 kumpf 1.6 }
118
|
119 kumpf 1.18 CIMPropertyList WQLSelectStatement::getWherePropertyList(
120 const CIMObjectPath& inClassName)
|
121 kumpf 1.6 {
|
122 carolann.graves 1.14 return _rep->getWherePropertyList(inClassName);
|
123 kumpf 1.6 }
124
125 Boolean WQLSelectStatement::appendWherePropertyName(const CIMName& x)
|
126 mike 1.2 {
|
127 chuck 1.12 return _rep->appendWherePropertyName(x);
128 }
|
129 mike 1.2
|
130 chuck 1.12 Boolean WQLSelectStatement::evaluateWhereClause(
131 const WQLPropertySource* source) const
132 {
|
133 karl 1.17 return _rep->evaluateWhereClause(source);
|
134 chuck 1.12 }
|
135 mike 1.2
|
136 carolann.graves 1.14 void WQLSelectStatement::applyProjection(CIMInstance& ci,
|
137 david.dillard 1.15 Boolean allowMissing)
|
138 chuck 1.12 {
|
139 karl 1.17 _rep->applyProjection(ci, allowMissing);
|
140 chuck 1.12 }
|
141 mike 1.2
|
142 carolann.graves 1.14 void WQLSelectStatement::applyProjection(CIMObject& ci,
|
143 david.dillard 1.15 Boolean allowMissing)
|
144 chuck 1.12 {
|
145 karl 1.17 _rep->applyProjection(ci, allowMissing);
|
146 mike 1.2 }
147
|
148 chuck 1.12 void WQLSelectStatement::print() const
|
149 mike 1.2 {
|
150 karl 1.17 _rep->print();
|
151 chuck 1.12 }
|
152 mike 1.2
|
153 chuck 1.12 Boolean WQLSelectStatement::evaluate(const CIMInstance& inCI)
154 {
|
155 karl 1.17 return _rep->evaluate(inCI);
|
156 chuck 1.12 }
|
157 david.dillard 1.15
158 void WQLSelectStatement::validate()
|
159 chuck 1.12 {
|
160 karl 1.17 _rep->validate();
|
161 mike 1.2 }
|
162 david.dillard 1.15
|
163 karl 1.17 CIMPropertyList WQLSelectStatement::getPropertyList(
164 const CIMObjectPath& inClassName)
|
165 mike 1.2 {
|
166 karl 1.17 return _rep->getPropertyList(inClassName);
|
167 schuur 1.10 }
168
|
169 kumpf 1.18 Array<CIMObjectPath> WQLSelectStatement::getClassPathList() const
|
170 schuur 1.10 {
|
171 karl 1.17 return _rep->getClassPathList();
|
172 schuur 1.10 }
173
|
174 chuck 1.12 Uint32 WQLSelectStatement::getSelectPropertyNameCount() const
|
175 schuur 1.10 {
|
176 chuck 1.12 return _rep->getSelectPropertyNameCount();
|
177 mike 1.2 }
|
178 david.dillard 1.15
|
179 kumpf 1.18 /** Gets the i-th selected property name in the list.
180 This function should only be used if getAllProperties() returns false.
181 */
|
182 chuck 1.12 const CIMName& WQLSelectStatement::getSelectPropertyName(Uint32 i) const
|
183 mike 1.2 {
|
184 chuck 1.12 return _rep->getSelectPropertyName(i);
185 }
|
186 mike 1.2
|
187 chuck 1.12 const CIMName& WQLSelectStatement::getClassName() const
|
188 kumpf 1.18 {
189 return _rep->getClassName();
190 }
191
192 /** Modifier. This method should not be called by the user (only by the
193 parser).
194 */
195 void WQLSelectStatement::setClassName(const CIMName& className)
196 {
197 _rep->setClassName(className);
198 }
|
199 kumpf 1.6
|
200 chuck 1.12 void WQLSelectStatement::appendSelectPropertyName(const CIMName& x)
|
201 kumpf 1.18 {
202 _rep->appendSelectPropertyName(x);
203 }
204
205 /** Returns the number of unique property names from the where clause.
206 */
207 Uint32 WQLSelectStatement::getWherePropertyNameCount() const
208 {
209 return _rep->getWherePropertyNameCount();
210 }
211
212 /** Gets the i-th unique property appearing in the where clause.
213 */
214 const CIMName& WQLSelectStatement::getWherePropertyName(Uint32 i) const
215 {
216 return _rep->getWherePropertyName(i);
217 }
|
218 mike 1.2
|
219 chuck 1.12 void WQLSelectStatement::appendOperation(WQLOperation x)
|
220 kumpf 1.18 {
221 _rep->appendOperation(x);
222 }
223
224 /** Appends an operand to the operation array. This method should only
225 be called by the parser itself.
226 */
227 void WQLSelectStatement::appendOperand(const WQLOperand& x)
228 {
229 _rep->appendOperand(x);
230 }
231
232 /** Returns true if this class has a where clause.
233 */
234 Boolean WQLSelectStatement::hasWhereClause() const
235 {
236 return _rep->hasWhereClause();
237 }
|
238 mike 1.2
239 PEGASUS_NAMESPACE_END
|