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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2