version 1.5, 2002/08/20 17:39:37
|
version 1.6, 2003/02/12 17:18:39
|
|
|
// | // |
// Author: Mike Brasher (mbrasher@bmc.com) | // Author: Mike Brasher (mbrasher@bmc.com) |
// | // |
// Modified By: |
// Modified By: Carol Ann Krug Graves, Hewlett-Packard Company |
|
// (carolann_graves@hp.com) |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
| |
_operations.reserveCapacity(16); | _operations.reserveCapacity(16); |
_operands.reserveCapacity(16); | _operands.reserveCapacity(16); |
|
|
|
_allProperties = false; |
} | } |
| |
WQLSelectStatement::~WQLSelectStatement() | WQLSelectStatement::~WQLSelectStatement() |
|
|
void WQLSelectStatement::clear() | void WQLSelectStatement::clear() |
{ | { |
_className.clear(); | _className.clear(); |
|
_allProperties = false; |
_selectPropertyNames.clear(); | _selectPropertyNames.clear(); |
_operations.clear(); | _operations.clear(); |
_operands.clear(); | _operands.clear(); |
} | } |
| |
Boolean WQLSelectStatement::appendWherePropertyName(const String& x) |
Boolean WQLSelectStatement::getAllProperties() const |
|
{ |
|
return _allProperties; |
|
} |
|
|
|
void WQLSelectStatement::setAllProperties(const Boolean allProperties) |
|
{ |
|
_allProperties = allProperties; |
|
} |
|
|
|
const CIMPropertyList WQLSelectStatement::getSelectPropertyList () const |
|
{ |
|
// |
|
// Check for "*" |
|
// |
|
if (_allProperties) |
|
{ |
|
// |
|
// Return null CIMPropertyList for all properties |
|
// |
|
return CIMPropertyList (); |
|
} |
|
else |
|
{ |
|
// |
|
// Return CIMPropertyList for properties referenced in the projection |
|
// list (SELECT clause) |
|
// |
|
return CIMPropertyList (_selectPropertyNames); |
|
} |
|
} |
|
|
|
const CIMPropertyList WQLSelectStatement::getWherePropertyList () const |
|
{ |
|
// |
|
// Return CIMPropertyList for properties referenced in the condition |
|
// (WHERE clause) |
|
// The list may be empty, but may not be NULL |
|
// |
|
return CIMPropertyList (_wherePropertyNames); |
|
} |
|
|
|
Boolean WQLSelectStatement::appendWherePropertyName(const CIMName& x) |
{ | { |
// | // |
// Reject duplicate property names by returning false. | // Reject duplicate property names by returning false. |
|
|
| |
if (op.getType() == WQLOperand::PROPERTY_NAME) | if (op.getType() == WQLOperand::PROPERTY_NAME) |
{ | { |
const String& propertyName = op.getPropertyName(); |
const CIMName& propertyName = op.getPropertyName(); |
| |
if (!source->getValue(propertyName, op)) | if (!source->getValue(propertyName, op)) |
throw NoSuchProperty(propertyName); |
throw NoSuchProperty(propertyName.getString()); |
} | } |
} | } |
| |
|
|
// Print the class name: | // Print the class name: |
// | // |
| |
cout << " _className: \"" << _className << '"' << endl; |
cout << " _className: \"" << _className.getString() << '"' << endl; |
| |
// | // |
// Print the property: |
// Print the select properties: |
// | // |
| |
for (Uint32 i = 0; i < _selectPropertyNames.size(); i++) |
if (_allProperties) |
|
{ |
|
cout << endl; |
|
cout << " _allProperties: TRUE" << endl; |
|
} |
|
|
|
else for (Uint32 i = 0; i < _selectPropertyNames.size(); i++) |
{ | { |
if (i == 0) | if (i == 0) |
cout << endl; | cout << endl; |
| |
cout << " _selectPropertyNames[" << i << "]: "; | cout << " _selectPropertyNames[" << i << "]: "; |
cout << '"' << _selectPropertyNames[i] << '"' << endl; |
cout << '"' << _selectPropertyNames[i].getString() << '"' << endl; |
} | } |
| |
// | // |