12 if (condition(
this)) {
16 if (
Scope* scope = this->represents<Scope>(); scope) {
17 for (
auto& childNode : scope->childNodes) {
19 Node* result = node->
find(condition);
20 if (result !=
nullptr) {
29 if (condition(
this)) {
33 if (
const Scope* scope = this->represents<Scope>(); scope) {
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);
52 if (
Scope* scope = this->represents<Scope>(); scope ) {
53 for (
auto &childNode : scope->childNodes) {
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);
70 if (
const Scope* scope = this->represents<Scope>(); scope ) {
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());
Base class for all core BPMN elements.
T * get()
Casts the element to the specified type T.
Base class for all nodes in a BPMN model.
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.