version 1.5, 2002/08/29 00:27:52
|
version 1.6, 2002/09/12 17:27:01
|
|
|
return false; | return false; |
} | } |
| |
Predicate::Predicate(void) : KeyBinding() { } |
Predicate::Predicate(void) : CIMKeyBinding() { } |
| |
Predicate::Predicate(const Predicate& x) | Predicate::Predicate(const Predicate& x) |
: KeyBinding(x), _op(x._op), _truth_value(x._truth_value) { } |
: CIMKeyBinding(x), _op(x._op), _truth_value(x._truth_value) { } |
| |
Predicate::Predicate(const KeyBinding& x, ExpressionOperator op = EQUAL, Boolean truth = true) |
Predicate::Predicate(const CIMKeyBinding& x, ExpressionOperator op = EQUAL, Boolean truth = true) |
{ | { |
if(this != &x) | if(this != &x) |
{ | { |
KeyBinding::operator=(x); |
CIMKeyBinding::operator=(x); |
_op = op; | _op = op; |
_truth_value = truth; | _truth_value = truth; |
} | } |
|
|
Type type, | Type type, |
ExpressionOperator op = EQUAL, | ExpressionOperator op = EQUAL, |
Boolean truth = true) | Boolean truth = true) |
: KeyBinding(name, value, type), _op(op), _truth_value(truth) { } |
: CIMKeyBinding(name, value, type), _op(op), _truth_value(truth) { } |
| |
Predicate::~Predicate() { } | Predicate::~Predicate() { } |
| |
|
|
{ | { |
if(this != &x) | if(this != &x) |
{ | { |
KeyBinding::operator=(x); |
CIMKeyBinding::operator=(x); |
_op = x._op; | _op = x._op; |
_truth_value = x._truth_value; | _truth_value = x._truth_value; |
} | } |
return *this; | return *this; |
} | } |
| |
Boolean Predicate::evaluate(const KeyBinding& key) |
Boolean Predicate::evaluate(const CIMKeyBinding& key) |
{ | { |
_truth_value = false; | _truth_value = false; |
if(true == CIMName::equal(this->getName() , key.getName())) | if(true == CIMName::equal(this->getName() , key.getName())) |
|
|
const String& host, | const String& host, |
const String& nameSpace, | const String& nameSpace, |
const String& className, | const String& className, |
const KeyBindingArray& keyBindings, |
const Array<CIMKeyBinding>& keyBindings, |
const PredicateArray& predicates, | const PredicateArray& predicates, |
Boolean truth , | Boolean truth , |
LogicalOperator lop ) | LogicalOperator lop ) |
|
|
const String& host, | const String& host, |
const String& nameSpace, | const String& nameSpace, |
const String& className, | const String& className, |
const KeyBindingArray& keyBindings, |
const Array<CIMKeyBinding>& keyBindings, |
const PredicateArray& predicates, | const PredicateArray& predicates, |
Boolean truth , | Boolean truth , |
LogicalOperator lop ) | LogicalOperator lop ) |
|
|
{ | { |
_truth_value = false; | _truth_value = false; |
| |
const Array<KeyBinding>& keys = CIMObjectPath::getKeyBindings(); |
const Array<CIMKeyBinding>& keys = CIMObjectPath::getKeyBindings(); |
int x = _predicates.size(); | int x = _predicates.size(); |
int y = keys.size(); | int y = keys.size(); |
int i, j; | int i, j; |
|
|
Predicate& pred = _predicates[i]; | Predicate& pred = _predicates[i]; |
for ( j = 0; j < y; j++ ) | for ( j = 0; j < y; j++ ) |
{ | { |
const KeyBinding& key = keys[i]; |
const CIMKeyBinding& key = keys[i]; |
if(pred == key) | if(pred == key) |
{ | { |
if(true == pred.evaluate(key)) | if(true == pred.evaluate(key)) |