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

  1 karl  1.13 //%2005////////////////////////////////////////////////////////////////////////
  2 mike  1.2  //
  3 karl  1.11 // 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 karl  1.7  // IBM Corp.; EMC Corporation, The Open Group.
  7 karl  1.11 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
  8            // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
  9 karl  1.13 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 10            // EMC Corporation; VERITAS Software Corporation; The Open Group.
 11 mike  1.2  //
 12            // Permission is hereby granted, free of charge, to any person obtaining a copy
 13 kumpf 1.3  // of this software and associated documentation files (the "Software"), to
 14            // deal in the Software without restriction, including without limitation the
 15            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 16 mike  1.2  // sell copies of the Software, and to permit persons to whom the Software is
 17            // furnished to do so, subject to the following conditions:
 18            // 
 19 kumpf 1.3  // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 20 mike  1.2  // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 21            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 22 kumpf 1.3  // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 23            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 24            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 25 mike  1.2  // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 26            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 27            //
 28            //==============================================================================
 29            //
 30            // Author: Mike Brasher (mbrasher@bmc.com)
 31            //
 32 kumpf 1.6  // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company
 33            //                (carolann_graves@hp.com)
 34 mike  1.2  //
 35            //%/////////////////////////////////////////////////////////////////////////////
 36 chuck 1.12 #include "WQLSelectStatement.h"
 37            #include "WQLSelectStatementRep.h"
 38 mike  1.2  #include <iostream>
 39            #include <Pegasus/Common/Stack.h>
 40            
 41            PEGASUS_USING_STD;
 42            
 43            PEGASUS_NAMESPACE_BEGIN
 44            
 45 chuck 1.12 const WQLSelectStatement WQLSelectStatement::EMPTY=WQLSelectStatement();
 46            
 47            WQLSelectStatement::WQLSelectStatement(String& queryLang, String& query)
 48               :SelectStatement()
 49 mike  1.2  {
 50 chuck 1.12 	_rep = new WQLSelectStatementRep(queryLang,query);
 51            	// Set the _rep into the base class also
 52              	SelectStatement::_rep = _rep;
 53            }
 54 mike  1.2  
 55 chuck 1.12 WQLSelectStatement::WQLSelectStatement(String& queryLang, String& query, QueryContext& inCtx)
 56               :SelectStatement()
 57            {
 58              _rep = new WQLSelectStatementRep(queryLang,query,inCtx);
 59            	// Set the _rep into the base class also
 60              	SelectStatement::_rep = _rep;
 61            }
 62 mike  1.2  
 63 chuck 1.12 WQLSelectStatement::WQLSelectStatement()
 64               :SelectStatement()
 65            {
 66              _rep = new WQLSelectStatementRep();
 67            	// Set the _rep into the base class also
 68              	SelectStatement::_rep = _rep;
 69 mike  1.2  }
 70            
 71 chuck 1.12 WQLSelectStatement::WQLSelectStatement(const WQLSelectStatement& statement)
 72              :SelectStatement()
 73 mike  1.2  {
 74 chuck 1.12   _rep = new WQLSelectStatementRep(*statement._rep);
 75 mike  1.2  
 76 chuck 1.12   // Set the _rep into the base class also
 77              SelectStatement::_rep = _rep;
 78 mike  1.2  }
 79            
 80 chuck 1.12 WQLSelectStatement& WQLSelectStatement::operator=(const WQLSelectStatement& rhs)
 81 mike  1.2  {
 82 chuck 1.12   if(&rhs != this)
 83              {
 84                if(_rep) delete _rep;	
 85                _rep = new WQLSelectStatementRep(*rhs._rep);
 86 mike  1.2  
 87 chuck 1.12     // Set the _rep into the base class also
 88                SelectStatement::_rep = _rep;
 89              }
 90 kumpf 1.6  
 91 chuck 1.12   return *this;
 92 mike  1.2  }
 93            
 94 chuck 1.12 
 95 mike  1.2  WQLSelectStatement::~WQLSelectStatement()
 96            {
 97 chuck 1.12 	if(_rep)
 98            		delete _rep;
 99 mike  1.2  }
100            
101            void WQLSelectStatement::clear()
102            {
103 chuck 1.12 	_rep->clear();
104 mike  1.2  }
105            
106 kumpf 1.6  Boolean WQLSelectStatement::getAllProperties() const
107            {
108 chuck 1.12     return _rep->getAllProperties();
109 kumpf 1.6  }
110            
111            void WQLSelectStatement::setAllProperties(const Boolean allProperties)
112            {
113 chuck 1.12     _rep->setAllProperties(allProperties);
114 kumpf 1.6  }
115            
116 carolann.graves 1.14 CIMPropertyList WQLSelectStatement::getSelectPropertyList
117                          (const CIMObjectPath& inClassName)
118 kumpf           1.6  {
119 carolann.graves 1.14 	return _rep->getSelectPropertyList(inClassName);
120 kumpf           1.6  }
121                      
122 carolann.graves 1.14 CIMPropertyList WQLSelectStatement::getWherePropertyList
123                          (const CIMObjectPath& inClassName)
124 kumpf           1.6  {
125 carolann.graves 1.14     return _rep->getWherePropertyList(inClassName);
126 kumpf           1.6  }
127                      
128                      Boolean WQLSelectStatement::appendWherePropertyName(const CIMName& x)
129 mike            1.2  {
130 chuck           1.12     return _rep->appendWherePropertyName(x);
131                      }
132 mike            1.2  
133 chuck           1.12 Boolean WQLSelectStatement::evaluateWhereClause(
134                          const WQLPropertySource* source) const
135                      {
136                      	return _rep->evaluateWhereClause(source);
137                      }
138 mike            1.2  
139 carolann.graves 1.14 void WQLSelectStatement::applyProjection(CIMInstance& ci,
140                          Boolean allowMissing) throw (Exception)
141 chuck           1.12 {
142 carolann.graves 1.14 	_rep->applyProjection(ci, allowMissing);
143 chuck           1.12 }
144 mike            1.2  
145 carolann.graves 1.14 void WQLSelectStatement::applyProjection(CIMObject& ci,
146                          Boolean allowMissing) 
147 chuck           1.12 {
148 carolann.graves 1.14 	_rep->applyProjection(ci, allowMissing);
149 mike            1.2  }
150                      
151 chuck           1.12 void WQLSelectStatement::print() const
152 mike            1.2  {
153 chuck           1.12 	_rep->print();
154                      }
155 mike            1.2  
156 chuck           1.12 Boolean WQLSelectStatement::evaluate(const CIMInstance& inCI)
157                      {
158                      	return _rep->evaluate(inCI);
159                      }
160                                 
161                      void WQLSelectStatement::validate() throw (Exception)
162                      {
163                      	_rep->validate();
164 mike            1.2  }
165 chuck           1.12               
166                      CIMPropertyList WQLSelectStatement::getPropertyList(const CIMObjectPath& inClassName)
167 mike            1.2  {
168 chuck           1.12 	return _rep->getPropertyList(inClassName);
169 schuur          1.10 }
170                      
171 chuck           1.12 Array<CIMObjectPath> WQLSelectStatement::getClassPathList()
172 schuur          1.10 {
173 chuck           1.12 	return _rep->getClassPathList();
174 schuur          1.10 }
175                      
176 chuck           1.12 Uint32 WQLSelectStatement::getSelectPropertyNameCount() const
177 schuur          1.10 {
178 chuck           1.12         return _rep->getSelectPropertyNameCount();
179 mike            1.2  }
180 chuck           1.12                                               
181                          /** Gets the i-th selected property name in the list.
182                              This function should only be used if getAllProperties() returns false.
183                          */
184                      const CIMName& WQLSelectStatement::getSelectPropertyName(Uint32 i) const
185 mike            1.2  {
186 chuck           1.12      return _rep->getSelectPropertyName(i);
187                      }
188 mike            1.2  
189 chuck           1.12 const CIMName& WQLSelectStatement::getClassName() const
190                          {
191                              return _rep->getClassName();
192                          }
193                                                                      
194                          /** Modifier. This method should not be called by the user (only by the
195                              parser).
196                          */
197                          void WQLSelectStatement::setClassName(const CIMName& className)
198 kumpf           1.6      {
199 chuck           1.12         _rep->setClassName(className);
200 kumpf           1.6      }
201                      
202 chuck           1.12 void WQLSelectStatement::appendSelectPropertyName(const CIMName& x)
203 mike            1.2      {
204 chuck           1.12         _rep->appendSelectPropertyName(x);
205                          }
206                                                                      
207                          /** Returns the number of unique property names from the where clause.
208                          */
209                          Uint32 WQLSelectStatement::getWherePropertyNameCount() const
210                          {
211                              return _rep->getWherePropertyNameCount();
212                          }
213                                                                     
214                          /** Gets the i-th unique property appearing in the where clause.
215                          */
216                          const CIMName& WQLSelectStatement::getWherePropertyName(Uint32 i) const
217                          {
218                              return _rep->getWherePropertyName(i);
219                          }
220 mike            1.2  
221 chuck           1.12 void WQLSelectStatement::appendOperation(WQLOperation x)
222                          {
223                              _rep->appendOperation(x);
224 mike            1.2      }
225 chuck           1.12                                                
226                          /** Appends an operand to the operation array. This method should only
227                              be called by the parser itself.
228                          */
229                          void WQLSelectStatement::appendOperand(const WQLOperand& x)
230 mike            1.2      {
231 chuck           1.12         _rep->appendOperand(x);
232 mike            1.2      }
233 chuck           1.12                                                 
234                          /** Returns true if this class has a where clause.
235                          */
236                          Boolean WQLSelectStatement::hasWhereClause() const
237 mike            1.2      {
238 chuck           1.12         return _rep->hasWhereClause();
239 mike            1.2      }
240                      
241                      PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2