version 1.2, 2004/10/17 20:40:15
|
version 1.6, 2007/04/17 12:38:31
|
|
|
//%2004//////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development | // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. | // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
|
// IBM Corp.; EMC Corporation, The Open Group. | // IBM Corp.; EMC Corporation, The Open Group. |
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; | // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; |
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. | // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; Symantec Corporation; The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Author: Adrian Schuur (schuur@de.ibm.com) |
|
// |
|
// Modified By: |
|
// |
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#include "WQLQueryExpressionRep.h" | #include "WQLQueryExpressionRep.h" |
|
|
return _stmt->getSelectPropertyList(); | return _stmt->getSelectPropertyList(); |
} | } |
| |
WQLQueryExpressionRep::~WQLQueryExpressionRep() { |
WQLQueryExpressionRep::~WQLQueryExpressionRep() |
|
{ |
if (_stmt) delete _stmt; | if (_stmt) delete _stmt; |
} | } |
| |
void WQLQueryExpressionRep::_parse() | void WQLQueryExpressionRep::_parse() |
{ | { |
if (_queryLanguage=="WQL") { |
if (_queryLanguage=="WQL") |
|
{ |
_stmt=new WQLSelectStatement(); | _stmt=new WQLSelectStatement(); |
WQLParser::parse(_query, *_stmt); | WQLParser::parse(_query, *_stmt); |
} | } |
else throw | else throw |
PEGASUS_CIM_EXCEPTION(CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED, _queryLanguage); |
PEGASUS_CIM_EXCEPTION(CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED, |
|
_queryLanguage); |
} | } |
| |
Boolean WQLQueryExpressionRep::evaluate(const CIMInstance & inst) const | Boolean WQLQueryExpressionRep::evaluate(const CIMInstance & inst) const |
|
|
if (_stmt==NULL) ((WQLQueryExpressionRep*)this)->_parse(); | if (_stmt==NULL) ((WQLQueryExpressionRep*)this)->_parse(); |
| |
WQLInstancePropertySource ips(inst); | WQLInstancePropertySource ips(inst); |
try { |
try |
|
{ |
if (_stmt->evaluateWhereClause(&ips)) return true; | if (_stmt->evaluateWhereClause(&ips)) return true; |
} | } |
catch (...) { |
catch (...) |
|
{ |
return false; | return false; |
} | } |
return false; | return false; |
} | } |
| |
void WQLQueryExpressionRep::applyProjection(CIMInstance & ci) { |
void WQLQueryExpressionRep::applyProjection(CIMInstance & ci, |
|
Boolean allowMissing) |
|
{ |
if (_stmt==NULL) ((WQLQueryExpressionRep*)this)->_parse(); | if (_stmt==NULL) ((WQLQueryExpressionRep*)this)->_parse(); |
| |
_stmt->applyProjection(ci); |
_stmt->applyProjection(ci, allowMissing); |
} | } |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |