1 chuck 1.1.2.9 //%2003////////////////////////////////////////////////////////////////////////
|
2 chuck 1.1.2.6 //
3 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Development
4 // Company, L. P., IBM Corp., The Open Group, Tivoli Systems.
|
5 chuck 1.1.2.10 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;
|
6 chuck 1.1.2.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 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 //
24 //==============================================================================
25 //
26 // Authors: David Rosckes (rosckes@us.ibm.com)
27 chuck 1.1.2.6 // 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.2 #include "CQLSelectStatement.h"
|
36 humberto 1.1.2.4 #include "CQLSelectStatementRep.h"
|
37 chuck 1.1.2.6 #include <Pegasus/Common/InternalException.h>
|
38 humberto 1.1.2.1
39 PEGASUS_NAMESPACE_BEGIN
|
40 humberto 1.1.2.2
|
41 chuck 1.1.2.6 CQLSelectStatement::CQLSelectStatement()
42 :SelectStatement()
43 {
44 _rep = new CQLSelectStatementRep();
|
45 chuck 1.1.2.18
46 // Set the _rep into the base class also
47 SelectStatement::_rep = _rep;
|
48 humberto 1.1.2.5 }
49
|
50 chuck 1.1.2.11 CQLSelectStatement::CQLSelectStatement(String& inQlang, String& inQuery, QueryContext& inCtx)
|
51 chuck 1.1.2.6 :SelectStatement()
|
52 humberto 1.1.2.2 {
|
53 chuck 1.1.2.6 _rep = new CQLSelectStatementRep(inQlang,inQuery,inCtx);
|
54 chuck 1.1.2.18
55 // Set the _rep into the base class also
56 SelectStatement::_rep = _rep;
|
57 humberto 1.1.2.4 }
58
|
59 chuck 1.1.2.6 CQLSelectStatement::CQLSelectStatement(const CQLSelectStatement& statement)
60 :SelectStatement()
61 {
62 _rep = new CQLSelectStatementRep(*statement._rep);
|
63 chuck 1.1.2.18
64 // Set the _rep into the base class also
65 SelectStatement::_rep = _rep;
|
66 humberto 1.1.2.5 }
67
|
68 chuck 1.1.2.6 CQLSelectStatement::~CQLSelectStatement()
69 {
70 if(_rep)
71 delete _rep;
|
72 chuck 1.1.2.18
73 // Note - no need to delete the rep in the base class
|
74 humberto 1.1.2.2 }
75
|
76 chuck 1.1.2.6 CQLSelectStatement& CQLSelectStatement::operator=(const CQLSelectStatement& rhs)
|
77 humberto 1.1.2.2 {
|
78 chuck 1.1.2.6 if(&rhs != this)
79 {
80 if(_rep) delete _rep;
81 _rep = new CQLSelectStatementRep(*rhs._rep);
|
82 chuck 1.1.2.18
83 // Set the _rep into the base class also
84 SelectStatement::_rep = _rep;
|
85 chuck 1.1.2.6 }
86
87 return *this;
|
88 humberto 1.1.2.2 }
89
|
90 chuck 1.1.2.6 Boolean CQLSelectStatement::evaluate(const CIMInstance& inCI)
|
91 humberto 1.1.2.1 {
|
92 chuck 1.1.2.6 PEGASUS_ASSERT(_rep != NULL);
93
94 return _rep->evaluate(inCI);
|
95 humberto 1.1.2.2 }
96
|
97 chuck 1.1.2.6 void CQLSelectStatement::applyProjection(CIMInstance& inCI) throw(Exception)
|
98 humberto 1.1.2.1 {
|
99 chuck 1.1.2.6 PEGASUS_ASSERT(_rep != NULL);
100
|
101 lucier 1.1.2.12 _rep->applyProjection(inCI);
|
102 humberto 1.1.2.2 }
103
104 void CQLSelectStatement::validateClass(const CIMObjectPath& inClassName) throw(Exception)
105 {
|
106 chuck 1.1.2.6
107 PEGASUS_ASSERT(_rep != NULL);
108
109 _rep->validateClass(inClassName);
|
110 humberto 1.1.2.2 }
111
112 void CQLSelectStatement::validateProperties() throw(Exception)
113 {
|
114 chuck 1.1.2.6 PEGASUS_ASSERT(_rep != NULL);
115
116 _rep->validateProperties();
|
117 humberto 1.1.2.2 }
118
|
119 chuck 1.1.2.6 Array<CIMObjectPath> CQLSelectStatement::getClassPathList()
|
120 humberto 1.1.2.1 {
|
121 chuck 1.1.2.6 PEGASUS_ASSERT(_rep != NULL);
122
123 return _rep->getClassPathList();
|
124 humberto 1.1.2.2 }
125
126 CIMPropertyList CQLSelectStatement::getPropertyList(const CIMObjectPath& inClassName)
|
127 humberto 1.1.2.1 {
|
128 chuck 1.1.2.6 // Should be set by the concrete sub-classes
129 PEGASUS_ASSERT(_rep != NULL);
130
|
131 humberto 1.1.2.4 return _rep->getPropertyList(inClassName);
|
132 humberto 1.1.2.2 }
133
|
134 chuck 1.1.2.15 CIMPropertyList CQLSelectStatement::getSelectPropertyList(const CIMObjectPath& inClassName)
135 {
136 // Should be set by the concrete sub-classes
137 PEGASUS_ASSERT(_rep != NULL);
138
139 return _rep->getSelectPropertyList(inClassName);
140 }
141
142 CIMPropertyList CQLSelectStatement::getWherePropertyList(const CIMObjectPath& inClassName)
143 {
144 // Should be set by the concrete sub-classes
145 PEGASUS_ASSERT(_rep != NULL);
146
147 return _rep->getWherePropertyList(inClassName);
148 }
149
|
150 chuck 1.1.2.16 Array<CQLChainedIdentifier> CQLSelectStatement::getSelectChainedIdentifiers()
151 {
152 // Should be set by the concrete sub-classes
153 PEGASUS_ASSERT(_rep != NULL);
154
155 return _rep->getSelectChainedIdentifiers();
156 }
157
158 Array<CQLChainedIdentifier> CQLSelectStatement::getWhereChainedIdentifiers()
159 {
160 // Should be set by the concrete sub-classes
161 PEGASUS_ASSERT(_rep != NULL);
162
163 return _rep->getWhereChainedIdentifiers();
164 }
165
|
166 humberto 1.1.2.2 void CQLSelectStatement::appendClassPath(const CQLIdentifier& inIdentifier)
167 {
|
168 chuck 1.1.2.6 PEGASUS_ASSERT(_rep != NULL);
169
170 _rep->appendClassPath(inIdentifier);
|
171 humberto 1.1.2.2 }
172
|
173 humberto 1.1.2.13 void CQLSelectStatement::setPredicate(const CQLPredicate& inPredicate)
|
174 humberto 1.1.2.2 {
|
175 chuck 1.1.2.6 PEGASUS_ASSERT(_rep != NULL);
176
177 _rep->setPredicate(inPredicate);
|
178 humberto 1.1.2.2 }
179
|
180 chuck 1.1.2.17 CQLPredicate CQLSelectStatement::getPredicate() const
181 {
182 PEGASUS_ASSERT(_rep != NULL);
183
184 return _rep->getPredicate();
185 }
186
|
187 humberto 1.1.2.2 void CQLSelectStatement::insertClassPathAlias(const CQLIdentifier& inIdentifier, String inAlias)
188 {
|
189 chuck 1.1.2.6 PEGASUS_ASSERT(_rep != NULL);
190
191 _rep->insertClassPathAlias(inIdentifier,inAlias);
|
192 humberto 1.1.2.2 }
193
194 void CQLSelectStatement::appendSelectIdentifier(const CQLChainedIdentifier& x)
195 {
|
196 chuck 1.1.2.6 PEGASUS_ASSERT(_rep != NULL);
197
198 _rep->appendSelectIdentifier(x);
|
199 humberto 1.1.2.2 }
200
|
201 chuck 1.1.2.8 void CQLSelectStatement::applyContext()
202 {
203 PEGASUS_ASSERT(_rep != NULL);
204
205 _rep->applyContext();
206 }
207
208 void CQLSelectStatement::normalizeToDOC()
209 {
210 PEGASUS_ASSERT(_rep != NULL);
211
212 _rep->normalizeToDOC();
213 }
214
215 void CQLSelectStatement::setHasWhereClause()
216 {
217 PEGASUS_ASSERT(_rep != NULL);
218
219 _rep->setHasWhereClause();
|
220 chuck 1.1.2.7 }
221
|
222 chuck 1.1.2.8 Boolean CQLSelectStatement::hasWhereClause()
223 {
224 PEGASUS_ASSERT(_rep != NULL);
225
226 return _rep->hasWhereClause();
|
227 chuck 1.1.2.7 }
228
|
229 chuck 1.1.2.8 String CQLSelectStatement::toString()
230 {
231 PEGASUS_ASSERT(_rep != NULL);
232
233 return _rep->toString();
|
234 chuck 1.1.2.7 }
235
236 void CQLSelectStatement::clear(){
|
237 chuck 1.1.2.8 PEGASUS_ASSERT(_rep != NULL);
238
239 _rep->clear();
|
240 chuck 1.1.2.7 }
241
|
242 humberto 1.1.2.1 PEGASUS_NAMESPACE_END
|