Exemple #1
0
bool InternalJob::IsConflicting(InternalJob::Pointer otherJob) const
{
  ISchedulingRule::Pointer otherRule = otherJob->GetRule();
  if (sptr_schedulingRule.GetPointer() == 0 || otherRule.GetPointer() == 0)
    return false;
  // TODO MultiRule: extend the IsConflicting (...) method with MultiRule
  // if one of the rules is a compound rule, it must be asked the question.
  //if (schedulingRule.GetClass() == MultiRule.class)
  //  return schedulingRule.IsConflicting(otherRule);
  return otherRule->IsConflicting(sptr_schedulingRule);
}
Exemple #2
0
// dummy validateRule implemenation
void JobManager::ValidateRule(ISchedulingRule::Pointer sptr_rule)
{
  //null rule always valid
  if (sptr_rule == 0)
    return;

  //contains method must be reflexive
  poco_assert(sptr_rule->Contains(sptr_rule))
; //contains method must return false when given an unknown rule
  poco_assert(!sptr_rule->Contains(sptr_testRule));
  //isConflicting method must be reflexive
  poco_assert(sptr_rule->IsConflicting(sptr_rule));
  //isConflicting method must return false when given an unknown rule
  poco_assert(!sptr_rule->IsConflicting(sptr_testRule));

}