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 humberto 1.1.2.5 }
46
|
47 chuck 1.1.2.11 CQLSelectStatement::CQLSelectStatement(String& inQlang, String& inQuery, QueryContext& inCtx)
|
48 chuck 1.1.2.6 :SelectStatement()
|
49 humberto 1.1.2.2 {
|
50 chuck 1.1.2.6 _rep = new CQLSelectStatementRep(inQlang,inQuery,inCtx);
|
51 humberto 1.1.2.4 }
52
|
53 chuck 1.1.2.6 CQLSelectStatement::CQLSelectStatement(const CQLSelectStatement& statement)
54 :SelectStatement()
55 {
56 _rep = new CQLSelectStatementRep(*statement._rep);
|
57 humberto 1.1.2.5 }
58
|
59 chuck 1.1.2.6 CQLSelectStatement::~CQLSelectStatement()
60 {
61 if(_rep)
62 delete _rep;
|
63 humberto 1.1.2.2 }
64
|
65 chuck 1.1.2.6 CQLSelectStatement& CQLSelectStatement::operator=(const CQLSelectStatement& rhs)
|
66 humberto 1.1.2.2 {
|
67 chuck 1.1.2.6 if(&rhs != this)
68 {
69 if(_rep) delete _rep;
70 _rep = new CQLSelectStatementRep(*rhs._rep);
71 }
72
73 return *this;
|
74 humberto 1.1.2.2 }
75
|
76 chuck 1.1.2.6 Boolean CQLSelectStatement::evaluate(const CIMInstance& inCI)
|
77 humberto 1.1.2.1 {
|
78 chuck 1.1.2.6 PEGASUS_ASSERT(_rep != NULL);
79
80 return _rep->evaluate(inCI);
|
81 humberto 1.1.2.2 }
82
|
83 chuck 1.1.2.6 void CQLSelectStatement::applyProjection(CIMInstance& inCI) throw(Exception)
|
84 humberto 1.1.2.1 {
|
85 chuck 1.1.2.6 PEGASUS_ASSERT(_rep != NULL);
86
|
87 lucier 1.1.2.12 _rep->applyProjection(inCI);
|
88 humberto 1.1.2.2 }
89
90 void CQLSelectStatement::validateClass(const CIMObjectPath& inClassName) throw(Exception)
91 {
|
92 chuck 1.1.2.6
93 PEGASUS_ASSERT(_rep != NULL);
94
95 _rep->validateClass(inClassName);
|
96 humberto 1.1.2.2 }
97
98 void CQLSelectStatement::validateProperties() throw(Exception)
99 {
|
100 chuck 1.1.2.6 PEGASUS_ASSERT(_rep != NULL);
101
102 _rep->validateProperties();
|
103 humberto 1.1.2.2 }
104
|
105 chuck 1.1.2.6 Array<CIMObjectPath> CQLSelectStatement::getClassPathList()
|
106 humberto 1.1.2.1 {
|
107 chuck 1.1.2.6 PEGASUS_ASSERT(_rep != NULL);
108
109 return _rep->getClassPathList();
|
110 humberto 1.1.2.2 }
111
112 CIMPropertyList CQLSelectStatement::getPropertyList(const CIMObjectPath& inClassName)
|
113 humberto 1.1.2.1 {
|
114 chuck 1.1.2.6 // Should be set by the concrete sub-classes
115 PEGASUS_ASSERT(_rep != NULL);
116
|
117 humberto 1.1.2.4 return _rep->getPropertyList(inClassName);
|
118 humberto 1.1.2.2 }
119
|
120 chuck 1.1.2.15 CIMPropertyList CQLSelectStatement::getSelectPropertyList(const CIMObjectPath& inClassName)
121 {
122 // Should be set by the concrete sub-classes
123 PEGASUS_ASSERT(_rep != NULL);
124
125 return _rep->getSelectPropertyList(inClassName);
126 }
127
128 CIMPropertyList CQLSelectStatement::getWherePropertyList(const CIMObjectPath& inClassName)
129 {
130 // Should be set by the concrete sub-classes
131 PEGASUS_ASSERT(_rep != NULL);
132
133 return _rep->getWherePropertyList(inClassName);
134 }
135
|
136 chuck 1.1.2.16 Array<CQLChainedIdentifier> CQLSelectStatement::getSelectChainedIdentifiers()
137 {
138 // Should be set by the concrete sub-classes
139 PEGASUS_ASSERT(_rep != NULL);
140
141 return _rep->getSelectChainedIdentifiers();
142 }
143
144 Array<CQLChainedIdentifier> CQLSelectStatement::getWhereChainedIdentifiers()
145 {
146 // Should be set by the concrete sub-classes
147 PEGASUS_ASSERT(_rep != NULL);
148
149 return _rep->getWhereChainedIdentifiers();
150 }
151
|
152 humberto 1.1.2.2 void CQLSelectStatement::appendClassPath(const CQLIdentifier& inIdentifier)
153 {
|
154 chuck 1.1.2.6 PEGASUS_ASSERT(_rep != NULL);
155
156 _rep->appendClassPath(inIdentifier);
|
157 humberto 1.1.2.2 }
158
|
159 humberto 1.1.2.13 void CQLSelectStatement::setPredicate(const CQLPredicate& inPredicate)
|
160 humberto 1.1.2.2 {
|
161 chuck 1.1.2.6 PEGASUS_ASSERT(_rep != NULL);
162
163 _rep->setPredicate(inPredicate);
|
164 humberto 1.1.2.2 }
165
|
166 chuck 1.1.2.17 CQLPredicate CQLSelectStatement::getPredicate() const
167 {
168 PEGASUS_ASSERT(_rep != NULL);
169
170 return _rep->getPredicate();
171 }
172
|
173 humberto 1.1.2.2 void CQLSelectStatement::insertClassPathAlias(const CQLIdentifier& inIdentifier, String inAlias)
174 {
|
175 chuck 1.1.2.6 PEGASUS_ASSERT(_rep != NULL);
176
177 _rep->insertClassPathAlias(inIdentifier,inAlias);
|
178 humberto 1.1.2.2 }
179
180 void CQLSelectStatement::appendSelectIdentifier(const CQLChainedIdentifier& x)
181 {
|
182 chuck 1.1.2.6 PEGASUS_ASSERT(_rep != NULL);
183
184 _rep->appendSelectIdentifier(x);
|
185 humberto 1.1.2.2 }
186
|
187 chuck 1.1.2.8 void CQLSelectStatement::applyContext()
188 {
189 PEGASUS_ASSERT(_rep != NULL);
190
191 _rep->applyContext();
192 }
193
194 void CQLSelectStatement::normalizeToDOC()
195 {
196 PEGASUS_ASSERT(_rep != NULL);
197
198 _rep->normalizeToDOC();
199 }
200
201 void CQLSelectStatement::setHasWhereClause()
202 {
203 PEGASUS_ASSERT(_rep != NULL);
204
205 _rep->setHasWhereClause();
|
206 chuck 1.1.2.7 }
207
|
208 chuck 1.1.2.8 Boolean CQLSelectStatement::hasWhereClause()
209 {
210 PEGASUS_ASSERT(_rep != NULL);
211
212 return _rep->hasWhereClause();
|
213 chuck 1.1.2.7 }
214
|
215 chuck 1.1.2.8 String CQLSelectStatement::toString()
216 {
217 PEGASUS_ASSERT(_rep != NULL);
218
219 return _rep->toString();
|
220 chuck 1.1.2.7 }
221
222 void CQLSelectStatement::clear(){
|
223 chuck 1.1.2.8 PEGASUS_ASSERT(_rep != NULL);
224
225 _rep->clear();
|
226 chuck 1.1.2.7 }
227
|
228 humberto 1.1.2.1 PEGASUS_NAMESPACE_END
|