bpmn++
A BPMN parser library, written in C++
Loading...
Searching...
No Matches
Node.h
Go to the documentation of this file.
1#ifndef BPMN_Node_H
2#define BPMN_Node_H
3
5#include <memory>
6#include <vector>
7#include <optional>
8#include <functional>
9#include "BaseElement.h"
10#include "ExtensionElements.h"
11
12namespace BPMN {
13
14class Model;
15class Scope;
16
17class MessageFlow;
18/**
19 * @brief Base class for all nodes in a BPMN model.
20 *
21 * The Node class encapsulates the information and relationships associated with a node in a BPMN process.
22 * It can represent both a BPMN process itself or a flow node within a process.
23 */
24class Node : public BaseElement {
25 friend class Model;
26public:
27 /// @brief Constructs a Node object representing a BPMN process or flow node.
29
30 /// @brief Vector containing all message flows going in to the node.
31 std::vector< MessageFlow* > receiving;
32
33 /// @brief Vector containing all message flows going out of the node.
34 std::vector< MessageFlow* > sending;
35
36 /**
37 * @brief Returns the first node found matching a given condition.
38 *
39 * @return A pointer to a node matching condition, or `nullptr` if no such node exists
40 */
41 Node* find(std::function<bool(Node*)> condition);
42
43 /**
44 * @brief Returns the first node found matching a given condition.
45 *
46 * @return A pointer to a node matching condition, or `nullptr` if no such node exists
47 */
48 const Node* find(std::function<bool(const Node*)> condition) const;
49
50 /**
51 * @brief Returns all nodes matching a given condition.
52 *
53 * @return A vector of pointers to nodes matching condition
54 */
55 std::vector< Node* > find_all(std::function<bool(Node*)> condition);
56
57 /**
58 * @brief Returns all nodes matching a given condition.
59 *
60 * @return A vector of pointers to nodes matching condition
61 */
62 std::vector< const Node* > find_all(std::function<bool(const Node*)> condition) const;
63
64};
65
66} // namespace BPMN
67
68#endif // BPMN_Node_H
Base class for all core BPMN elements.
Definition BaseElement.h:15
XML::bpmn::tBaseElement * element
Definition BaseElement.h:20
Represents a BPMN model with all its processes and message flows.
Definition Model.h:170
Base class for all nodes in a BPMN model.
Definition Node.h:24
Node * find(std::function< bool(Node *)> condition)
Returns the first node found matching a given condition.
Definition Node.cpp:11
std::vector< Node * > find_all(std::function< bool(Node *)> condition)
Returns all nodes matching a given condition.
Definition Node.cpp:45
std::vector< MessageFlow * > receiving
Vector containing all message flows going in to the node.
Definition Node.h:31
std::vector< MessageFlow * > sending
Vector containing all message flows going out of the node.
Definition Node.h:34
The BPMN namespace contains linked classes representing a BPMN model.