1 karl 1.7 //%2006////////////////////////////////////////////////////////////////////////
|
2 chuck 1.2 //
|
3 karl 1.4 // 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.4 // 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 karl 1.7 //
|
21 chuck 1.2 // 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 //%/////////////////////////////////////////////////////////////////////////////
33
34 #include "CQLSelectStatement.h"
35 #include "CQLSelectStatementRep.h"
36 #include <Pegasus/Common/InternalException.h>
|
37 david.dillard 1.6 #include <Pegasus/CQL/CQLPredicate.h>
|
38 chuck 1.2
39 PEGASUS_NAMESPACE_BEGIN
40
41 CQLSelectStatement::CQLSelectStatement()
|
42 karl 1.8 :SelectStatement()
|
43 chuck 1.2 {
|
44 karl 1.8 _rep = new CQLSelectStatementRep();
|
45 david.dillard 1.6
|
46 karl 1.8 // Set the _rep into the base class also
47 SelectStatement::_rep = _rep;
|
48 chuck 1.2 }
49
|
50 karl 1.8 CQLSelectStatement::CQLSelectStatement(String& inQlang, String& inQuery,
51 QueryContext& inCtx)
52 :SelectStatement()
|
53 chuck 1.2 {
|
54 karl 1.8 _rep = new CQLSelectStatementRep(inQlang,inQuery,inCtx);
55
56 // Set the _rep into the base class also
57 SelectStatement::_rep = _rep;
|
58 chuck 1.2 }
59
60 CQLSelectStatement::CQLSelectStatement(String& inQlang, String& inQuery)
|
61 karl 1.8 :SelectStatement()
|
62 chuck 1.2 {
|
63 karl 1.8 _rep = new CQLSelectStatementRep(inQlang,inQuery);
64
65 // Set the _rep into the base class also
66 SelectStatement::_rep = _rep;
|
67 chuck 1.2 }
68
69 CQLSelectStatement::CQLSelectStatement(const CQLSelectStatement& statement)
|
70 karl 1.8 :SelectStatement()
|
71 chuck 1.2 {
|
72 karl 1.8 _rep = new CQLSelectStatementRep(*statement._rep);
73
74 // Set the _rep into the base class also
75 SelectStatement::_rep = _rep;
|
76 chuck 1.2 }
77
78 CQLSelectStatement::~CQLSelectStatement()
79 {
|
80 karl 1.8 if(_rep)
81 delete _rep;
|
82 chuck 1.2
|
83 karl 1.8 // Note - no need to delete the rep in the base class
|
84 chuck 1.2 }
85
86 CQLSelectStatement& CQLSelectStatement::operator=(const CQLSelectStatement& rhs)
87 {
|
88 karl 1.8 if(&rhs != this)
89 {
90 if(_rep)
91 delete _rep;
92 _rep = new CQLSelectStatementRep(*rhs._rep);
93
94 // Set the _rep into the base class also
95 SelectStatement::_rep = _rep;
96 }
97 return *this;
|
98 chuck 1.2 }
99
100 Boolean CQLSelectStatement::evaluate(const CIMInstance& inCI)
101 {
|
102 karl 1.8 PEGASUS_ASSERT(_rep != NULL);
103
104 return _rep->evaluate(inCI);
|
105 chuck 1.2 }
106
|
107 carolann.graves 1.5 void CQLSelectStatement::applyProjection(CIMInstance& inCI,
|
108 david.dillard 1.6 Boolean allowMissing)
|
109 chuck 1.2 {
|
110 karl 1.8 PEGASUS_ASSERT(_rep != NULL);
111
112 _rep->applyProjection(inCI, allowMissing);
|
113 chuck 1.2 }
114
|
115 david.dillard 1.6 void CQLSelectStatement::validate()
|
116 chuck 1.2 {
|
117 karl 1.8 PEGASUS_ASSERT(_rep != NULL);
118
119 _rep->validate();
|
120 chuck 1.2 }
121
122 Array<CIMObjectPath> CQLSelectStatement::getClassPathList()
123 {
|
124 karl 1.8 PEGASUS_ASSERT(_rep != NULL);
125
126 return _rep->getClassPathList();
|
127 chuck 1.2 }
128
|
129 karl 1.8 CIMPropertyList CQLSelectStatement::getPropertyList(
130 const CIMObjectPath& inClassName)
|
131 chuck 1.2 {
|
132 karl 1.8 // Should be set by the concrete sub-classes
133 PEGASUS_ASSERT(_rep != NULL);
134
135 return _rep->getPropertyList(inClassName);
|
136 chuck 1.2 }
137
|
138 karl 1.8 CIMPropertyList CQLSelectStatement::getSelectPropertyList(
139 const CIMObjectPath& inClassName)
|
140 chuck 1.2 {
|
141 karl 1.8 // Should be set by the concrete sub-classes
142 PEGASUS_ASSERT(_rep != NULL);
143
144 return _rep->getSelectPropertyList(inClassName);
|
145 chuck 1.2 }
146
|
147 karl 1.8 CIMPropertyList CQLSelectStatement::getWherePropertyList(
148 const CIMObjectPath& inClassName)
|
149 chuck 1.2 {
|
150 karl 1.8 // Should be set by the concrete sub-classes
151 PEGASUS_ASSERT(_rep != NULL);
152
153 return _rep->getWherePropertyList(inClassName);
|
154 chuck 1.2 }
155
156 Array<CQLChainedIdentifier> CQLSelectStatement::getSelectChainedIdentifiers()
157 {
|
158 karl 1.8 // Should be set by the concrete sub-classes
159 PEGASUS_ASSERT(_rep != NULL);
160
161 return _rep->getSelectChainedIdentifiers();
|
162 chuck 1.2 }
163
164 Array<CQLChainedIdentifier> CQLSelectStatement::getWhereChainedIdentifiers()
165 {
|
166 karl 1.8 // Should be set by the concrete sub-classes
167 PEGASUS_ASSERT(_rep != NULL);
168
169 return _rep->getWhereChainedIdentifiers();
|
170 chuck 1.2 }
171
172 void CQLSelectStatement::appendClassPath(const CQLIdentifier& inIdentifier)
173 {
|
174 karl 1.8 PEGASUS_ASSERT(_rep != NULL);
175
176 _rep->appendClassPath(inIdentifier);
|
177 chuck 1.2 }
178
179 void CQLSelectStatement::setPredicate(const CQLPredicate& inPredicate)
180 {
|
181 karl 1.8 PEGASUS_ASSERT(_rep != NULL);
182
183 _rep->setPredicate(inPredicate);
|
184 chuck 1.2 }
185
186 CQLPredicate CQLSelectStatement::getPredicate() const
187 {
|
188 karl 1.8 PEGASUS_ASSERT(_rep != NULL);
189
190 return _rep->getPredicate();
|
191 chuck 1.2 }
192
|
193 karl 1.8 void CQLSelectStatement::insertClassPathAlias(
194 const CQLIdentifier& inIdentifier, String inAlias)
|
195 chuck 1.2 {
|
196 karl 1.8 PEGASUS_ASSERT(_rep != NULL);
197
198 _rep->insertClassPathAlias(inIdentifier,inAlias);
|
199 chuck 1.2 }
200
201 void CQLSelectStatement::appendSelectIdentifier(const CQLChainedIdentifier& x)
202 {
|
203 karl 1.8 PEGASUS_ASSERT(_rep != NULL);
204
205 _rep->appendSelectIdentifier(x);
|
206 chuck 1.2 }
207
208 void CQLSelectStatement::applyContext()
209 {
|
210 karl 1.8 PEGASUS_ASSERT(_rep != NULL);
211
212 _rep->applyContext();
|
213 chuck 1.2 }
214
215 void CQLSelectStatement::normalizeToDOC()
216 {
|
217 karl 1.8 PEGASUS_ASSERT(_rep != NULL);
218
219 _rep->normalizeToDOC();
|
220 chuck 1.2 }
221
222 void CQLSelectStatement::setHasWhereClause()
223 {
|
224 karl 1.8 PEGASUS_ASSERT(_rep != NULL);
225
226 _rep->setHasWhereClause();
|
227 chuck 1.2 }
228
229 Boolean CQLSelectStatement::hasWhereClause()
230 {
|
231 karl 1.8 PEGASUS_ASSERT(_rep != NULL);
232
233 return _rep->hasWhereClause();
|
234 chuck 1.2 }
235
236 String CQLSelectStatement::toString()
237 {
|
238 karl 1.8 PEGASUS_ASSERT(_rep != NULL);
239
240 return _rep->toString();
|
241 chuck 1.2 }
242
243 void CQLSelectStatement::clear(){
|
244 karl 1.8 PEGASUS_ASSERT(_rep != NULL);
245
246 _rep->clear();
|
247 chuck 1.2 }
248
249 PEGASUS_NAMESPACE_END
|