(file) Return to CQLSelectStatement.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / CQL

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2