Maki
Formally verfied low-code orchestration
Loading...
Searching...
No Matches
flow.h
1#pragma once
2
3#include <QMap>
4#include <QString>
5
6#include "elements/transition.h"
7#include "ids.h"
8#include "save_info.h"
9
10class NodeItem;
11class TransitionItem;
12
16class Flow
17{
18public:
19 enum
20 {
21 Type = Types::FLOW
22 };
23
30 Flow(const QString& flowName, std::shared_ptr<FlowSaveInfo> storage);
31
37 QString id() const;
38
44 int type() const;
45
51 QString name() const;
52
58 bool modifiable() const;
59
65 void removeNode(NodeItem* node);
66
73 void updateFlow(NodeItem* node, std::shared_ptr<NodeSaveInfo> storage);
74
80 QVector<std::shared_ptr<NodeSaveInfo>> getNodes() const;
81
87 QVector<TransitionItem*> transitions() const;
88
94 void addTransition(TransitionItem* transition);
95
101 void removeTransition(TransitionItem* transition);
102
103 std::shared_ptr<FlowSaveInfo> config() const;
104
105private:
107 const QString mId;
108
110 QString mName;
111
113 std::shared_ptr<FlowSaveInfo> mStorage;
114
116 QVector<TransitionItem*> mTransitions;
117};
int type() const
Returns the type of the flow.
Definition flow.cpp:21
void removeNode(NodeItem *node)
Removes a node from the flow.
Definition flow.cpp:36
QVector< TransitionItem * > transitions() const
Returns a list of transitions connected to this node.
Definition flow.cpp:62
std::shared_ptr< FlowSaveInfo > mStorage
Storage for flow save information.
Definition flow.h:113
QString mName
Name of the flow.
Definition flow.h:110
Flow(const QString &flowName, std::shared_ptr< FlowSaveInfo > storage)
Constructs a new Flow object.
Definition flow.cpp:7
QVector< TransitionItem * > mTransitions
List of transitions in this flow.
Definition flow.h:116
QVector< std::shared_ptr< NodeSaveInfo > > getNodes() const
Retrieves a list of all nodes in the flow.
Definition flow.cpp:52
QString name() const
Returns the name of the flow.
Definition flow.cpp:26
void addTransition(TransitionItem *transition)
Adds a transition to the node.
Definition flow.cpp:67
void updateFlow(NodeItem *node, std::shared_ptr< NodeSaveInfo > storage)
Updates a node in the flow with new save information.
Definition flow.cpp:41
const QString mId
Unique identifier for the flow.
Definition flow.h:107
QString id() const
Returns the unique identifier of the flow.
Definition flow.cpp:16
void removeTransition(TransitionItem *transition)
Removes a transition from the node.
Definition flow.cpp:99
bool modifiable() const
Checks if the flow is modifiable.
Definition flow.cpp:31
Represents a graphical node item in a flowchart.
Definition node.h:26
Represents a transition between two nodes in a graphical representation.
Definition transition.h:15