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

  1 karl  1.16 //%2006////////////////////////////////////////////////////////////////////////
  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 karl  1.16 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 12            // EMC Corporation; Symantec Corporation; The Open Group.
 13 mike  1.2  //
 14            // Permission is hereby granted, free of charge, to any person obtaining a copy
 15 kumpf 1.3  // 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 mike  1.2  // 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.16 // 
 21 kumpf 1.3  // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 22 mike  1.2  // 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 kumpf 1.3  // 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 mike  1.2  // 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            // Author: Mike Brasher (mbrasher@bmc.com)
 33            //
 34 kumpf 1.6  // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company
 35            //                (carolann_graves@hp.com)
 36 david.dillard 1.15 //              David Dillard, VERITAS Software Corp.
 37                    //                  (david.dillard@veritas.com)
 38 mike          1.2  //
 39                    //%/////////////////////////////////////////////////////////////////////////////
 40 chuck         1.12 #include "WQLSelectStatement.h"
 41                    #include "WQLSelectStatementRep.h"
 42 mike          1.2  #include <iostream>
 43                    #include <Pegasus/Common/Stack.h>
 44                    
 45                    PEGASUS_USING_STD;
 46                    
 47                    PEGASUS_NAMESPACE_BEGIN
 48                    
 49 chuck         1.12 const WQLSelectStatement WQLSelectStatement::EMPTY=WQLSelectStatement();
 50                    
 51                    WQLSelectStatement::WQLSelectStatement(String& queryLang, String& query)
 52                       :SelectStatement()
 53 mike          1.2  {
 54 chuck         1.12 	_rep = new WQLSelectStatementRep(queryLang,query);
 55                    	// Set the _rep into the base class also
 56 david.dillard 1.15 	SelectStatement::_rep = _rep;
 57 chuck         1.12 }
 58 mike          1.2  
 59 chuck         1.12 WQLSelectStatement::WQLSelectStatement(String& queryLang, String& query, QueryContext& inCtx)
 60                       :SelectStatement()
 61                    {
 62 david.dillard 1.15 	_rep = new WQLSelectStatementRep(queryLang,query,inCtx);
 63 chuck         1.12 	// Set the _rep into the base class also
 64 david.dillard 1.15 	SelectStatement::_rep = _rep;
 65 chuck         1.12 }
 66 mike          1.2  
 67 chuck         1.12 WQLSelectStatement::WQLSelectStatement()
 68                       :SelectStatement()
 69                    {
 70 david.dillard 1.15 	_rep = new WQLSelectStatementRep();
 71 chuck         1.12 	// Set the _rep into the base class also
 72 david.dillard 1.15 	SelectStatement::_rep = _rep;
 73 mike          1.2  }
 74                    
 75 chuck         1.12 WQLSelectStatement::WQLSelectStatement(const WQLSelectStatement& statement)
 76                      :SelectStatement()
 77 mike          1.2  {
 78 chuck         1.12   _rep = new WQLSelectStatementRep(*statement._rep);
 79 mike          1.2  
 80 chuck         1.12   // Set the _rep into the base class also
 81                      SelectStatement::_rep = _rep;
 82 mike          1.2  }
 83                    
 84 chuck         1.12 WQLSelectStatement& WQLSelectStatement::operator=(const WQLSelectStatement& rhs)
 85 mike          1.2  {
 86 chuck         1.12   if(&rhs != this)
 87                      {
 88 david.dillard 1.15     if(_rep) delete _rep;
 89 chuck         1.12     _rep = new WQLSelectStatementRep(*rhs._rep);
 90 mike          1.2  
 91 chuck         1.12     // Set the _rep into the base class also
 92                        SelectStatement::_rep = _rep;
 93                      }
 94 kumpf         1.6  
 95 chuck         1.12   return *this;
 96 mike          1.2  }
 97                    
 98 chuck         1.12 
 99 mike          1.2  WQLSelectStatement::~WQLSelectStatement()
100                    {
101 david.dillard 1.15 	delete _rep;
102 mike          1.2  }
103                    
104                    void WQLSelectStatement::clear()
105                    {
106 chuck         1.12 	_rep->clear();
107 mike          1.2  }
108                    
109 kumpf         1.6  Boolean WQLSelectStatement::getAllProperties() const
110                    {
111 chuck         1.12     return _rep->getAllProperties();
112 kumpf         1.6  }
113                    
114                    void WQLSelectStatement::setAllProperties(const Boolean allProperties)
115                    {
116 chuck         1.12     _rep->setAllProperties(allProperties);
117 kumpf         1.6  }
118                    
119 carolann.graves 1.14 CIMPropertyList WQLSelectStatement::getSelectPropertyList
120                          (const CIMObjectPath& inClassName)
121 kumpf           1.6  {
122 carolann.graves 1.14 	return _rep->getSelectPropertyList(inClassName);
123 kumpf           1.6  }
124                      
125 carolann.graves 1.14 CIMPropertyList WQLSelectStatement::getWherePropertyList
126                          (const CIMObjectPath& inClassName)
127 kumpf           1.6  {
128 carolann.graves 1.14     return _rep->getWherePropertyList(inClassName);
129 kumpf           1.6  }
130                      
131                      Boolean WQLSelectStatement::appendWherePropertyName(const CIMName& x)
132 mike            1.2  {
133 chuck           1.12     return _rep->appendWherePropertyName(x);
134                      }
135 mike            1.2  
136 chuck           1.12 Boolean WQLSelectStatement::evaluateWhereClause(
137                          const WQLPropertySource* source) const
138                      {
139                      	return _rep->evaluateWhereClause(source);
140                      }
141 mike            1.2  
142 carolann.graves 1.14 void WQLSelectStatement::applyProjection(CIMInstance& ci,
143 david.dillard   1.15     Boolean allowMissing)
144 chuck           1.12 {
145 carolann.graves 1.14 	_rep->applyProjection(ci, allowMissing);
146 chuck           1.12 }
147 mike            1.2  
148 carolann.graves 1.14 void WQLSelectStatement::applyProjection(CIMObject& ci,
149 david.dillard   1.15     Boolean allowMissing)
150 chuck           1.12 {
151 carolann.graves 1.14 	_rep->applyProjection(ci, allowMissing);
152 mike            1.2  }
153                      
154 chuck           1.12 void WQLSelectStatement::print() const
155 mike            1.2  {
156 chuck           1.12 	_rep->print();
157                      }
158 mike            1.2  
159 chuck           1.12 Boolean WQLSelectStatement::evaluate(const CIMInstance& inCI)
160                      {
161                      	return _rep->evaluate(inCI);
162                      }
163 david.dillard   1.15 
164                      void WQLSelectStatement::validate()
165 chuck           1.12 {
166                      	_rep->validate();
167 mike            1.2  }
168 david.dillard   1.15 
169 chuck           1.12 CIMPropertyList WQLSelectStatement::getPropertyList(const CIMObjectPath& inClassName)
170 mike            1.2  {
171 chuck           1.12 	return _rep->getPropertyList(inClassName);
172 schuur          1.10 }
173                      
174 chuck           1.12 Array<CIMObjectPath> WQLSelectStatement::getClassPathList()
175 schuur          1.10 {
176 chuck           1.12 	return _rep->getClassPathList();
177 schuur          1.10 }
178                      
179 chuck           1.12 Uint32 WQLSelectStatement::getSelectPropertyNameCount() const
180 schuur          1.10 {
181 chuck           1.12         return _rep->getSelectPropertyNameCount();
182 mike            1.2  }
183 david.dillard   1.15 
184 chuck           1.12     /** Gets the i-th selected property name in the list.
185                              This function should only be used if getAllProperties() returns false.
186                          */
187                      const CIMName& WQLSelectStatement::getSelectPropertyName(Uint32 i) const
188 mike            1.2  {
189 chuck           1.12      return _rep->getSelectPropertyName(i);
190                      }
191 mike            1.2  
192 chuck           1.12 const CIMName& WQLSelectStatement::getClassName() const
193                          {
194                              return _rep->getClassName();
195                          }
196 david.dillard   1.15 
197 chuck           1.12     /** Modifier. This method should not be called by the user (only by the
198                              parser).
199                          */
200                          void WQLSelectStatement::setClassName(const CIMName& className)
201 kumpf           1.6      {
202 chuck           1.12         _rep->setClassName(className);
203 kumpf           1.6      }
204                      
205 chuck           1.12 void WQLSelectStatement::appendSelectPropertyName(const CIMName& x)
206 mike            1.2      {
207 chuck           1.12         _rep->appendSelectPropertyName(x);
208                          }
209 david.dillard   1.15 
210 chuck           1.12     /** Returns the number of unique property names from the where clause.
211                          */
212                          Uint32 WQLSelectStatement::getWherePropertyNameCount() const
213                          {
214                              return _rep->getWherePropertyNameCount();
215                          }
216 david.dillard   1.15 
217 chuck           1.12     /** Gets the i-th unique property appearing in the where clause.
218                          */
219                          const CIMName& WQLSelectStatement::getWherePropertyName(Uint32 i) const
220                          {
221                              return _rep->getWherePropertyName(i);
222                          }
223 mike            1.2  
224 chuck           1.12 void WQLSelectStatement::appendOperation(WQLOperation x)
225                          {
226                              _rep->appendOperation(x);
227 mike            1.2      }
228 david.dillard   1.15 
229 chuck           1.12     /** Appends an operand to the operation array. This method should only
230                              be called by the parser itself.
231                          */
232                          void WQLSelectStatement::appendOperand(const WQLOperand& x)
233 mike            1.2      {
234 chuck           1.12         _rep->appendOperand(x);
235 mike            1.2      }
236 david.dillard   1.15 
237 chuck           1.12     /** Returns true if this class has a where clause.
238                          */
239                          Boolean WQLSelectStatement::hasWhereClause() const
240 mike            1.2      {
241 chuck           1.12         return _rep->hasWhereClause();
242 mike            1.2      }
243                      
244                      PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2