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 humberto 1.1.2.2 void CQLSelectStatement::appendClassPath(const CQLIdentifier& inIdentifier)
137 {
|
138 chuck 1.1.2.6 PEGASUS_ASSERT(_rep != NULL);
139
140 _rep->appendClassPath(inIdentifier);
|
141 humberto 1.1.2.2 }
142
|
143 humberto 1.1.2.13 void CQLSelectStatement::setPredicate(const CQLPredicate& inPredicate)
|
144 humberto 1.1.2.2 {
|
145 chuck 1.1.2.6 PEGASUS_ASSERT(_rep != NULL);
146
147 _rep->setPredicate(inPredicate);
|
148 humberto 1.1.2.2 }
149
150 void CQLSelectStatement::insertClassPathAlias(const CQLIdentifier& inIdentifier, String inAlias)
151 {
|
152 chuck 1.1.2.6 PEGASUS_ASSERT(_rep != NULL);
153
154 _rep->insertClassPathAlias(inIdentifier,inAlias);
|
155 humberto 1.1.2.2 }
156
157 void CQLSelectStatement::appendSelectIdentifier(const CQLChainedIdentifier& x)
158 {
|
159 chuck 1.1.2.6 PEGASUS_ASSERT(_rep != NULL);
160
161 _rep->appendSelectIdentifier(x);
|
162 humberto 1.1.2.2 }
163
|
164 chuck 1.1.2.8 void CQLSelectStatement::applyContext()
165 {
166 PEGASUS_ASSERT(_rep != NULL);
167
168 _rep->applyContext();
169 }
170
171 void CQLSelectStatement::normalizeToDOC()
172 {
173 PEGASUS_ASSERT(_rep != NULL);
174
175 _rep->normalizeToDOC();
176 }
177
178 void CQLSelectStatement::setHasWhereClause()
179 {
180 PEGASUS_ASSERT(_rep != NULL);
181
182 _rep->setHasWhereClause();
|
183 chuck 1.1.2.7 }
184
|
185 chuck 1.1.2.8 Boolean CQLSelectStatement::hasWhereClause()
186 {
187 PEGASUS_ASSERT(_rep != NULL);
188
189 return _rep->hasWhereClause();
|
190 chuck 1.1.2.7 }
191
|
192 chuck 1.1.2.8 String CQLSelectStatement::toString()
193 {
194 PEGASUS_ASSERT(_rep != NULL);
195
196 return _rep->toString();
|
197 chuck 1.1.2.7 }
198
199 void CQLSelectStatement::clear(){
|
200 chuck 1.1.2.8 PEGASUS_ASSERT(_rep != NULL);
201
202 _rep->clear();
|
203 chuck 1.1.2.7 }
204
|
205 humberto 1.1.2.1 PEGASUS_NAMESPACE_END
|