12 if (condition(
this)) {
17 for (
auto& childNode : scope->childNodes) {
18 Node* node = childNode.get();
19 Node* result = node->
find(condition);
20 if (result !=
nullptr) {
29 if (condition(
this)) {
34 for (
const auto& childNode : scope->childNodes) {
35 const Node* node = childNode.get();
36 const Node* result = node->
find(condition);
37 if (result !=
nullptr) {
46 std::vector< Node* > result;
48 if (condition(
this)) {
49 result.push_back(
this);
53 for (
auto &childNode : scope->childNodes) {
54 Node* node = childNode.get();
55 std::vector< Node* > childResults = node->
find_all(condition);
56 result.insert(result.end(), childResults.begin(), childResults.end());
64 std::vector< const Node* > result;
66 if (condition(
this)) {
67 result.push_back(
this);
71 for (
const auto& childNode : scope->childNodes) {
72 const Node* node = childNode.get();
73 std::vector< const Node* > childResults = node->
find_all(condition);
74 result.insert(result.end(), childResults.begin(), childResults.end());
BaseElement(XML::bpmn::tBaseElement *element)
Constructs a BaseElement object representing a BPMN element.
XML::bpmn::tBaseElement * element
T * represents()
Attempts to cast the element to the specified type T.
Node * find(std::function< bool(Node *)> condition)
Returns the first node found matching a given condition.
Node(XML::bpmn::tBaseElement *element)
Constructs a Node object representing a BPMN process or flow node.
std::vector< Node * > find_all(std::function< bool(Node *)> condition)
Returns all nodes matching a given condition.
Base class for BPMN elements that may contain a ChildNode elements.
The BPMN namespace contains linked classes representing a BPMN model.