| 36 | } |
| 37 | |
| 38 | bool mitk::NodePredicateOr::CheckNode(const DataNode *node) const |
| 39 | { |
| 40 | if (m_ChildPredicates.empty()) |
| 41 | throw std::invalid_argument("NodePredicateOr: no child predicates available"); |
| 42 | |
| 43 | if (node == nullptr) |
| 44 | throw std::invalid_argument("NodePredicateOr: invalid node"); |
| 45 | |
| 46 | /* return the disjunction of the child predicate. If any predicate returns true, we return true too. Return false only |
| 47 | * if all child predicates return false */ |
| 48 | for (auto it = m_ChildPredicates.cbegin(); it != m_ChildPredicates.cend(); ++it) |
| 49 | if ((*it)->CheckNode(node) == true) |
| 50 | return true; |
| 51 | return false; // none of the childs was true, so return false |
| 52 | } |