aboutsummaryrefslogtreecommitdiff
path: root/core/src/Model/Workflow/Workflow.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/Model/Workflow/Workflow.hpp')
-rw-r--r--core/src/Model/Workflow/Workflow.hpp44
1 files changed, 19 insertions, 25 deletions
diff --git a/core/src/Model/Workflow/Workflow.hpp b/core/src/Model/Workflow/Workflow.hpp
index ded9bfb..161400e 100644
--- a/core/src/Model/Workflow/Workflow.hpp
+++ b/core/src/Model/Workflow/Workflow.hpp
@@ -5,6 +5,7 @@
#include "cplt_fwd.hpp"
#include <imgui_node_editor.h>
+#include <any>
#include <cstddef>
#include <cstdint>
#include <filesystem>
@@ -240,34 +241,27 @@ public:
/* Graph rebuild */
- struct GraphUpdateResult
+ enum GraphUpdateResult
{
- struct Success
- {
- };
-
- struct NoWorkToDo
- {
- };
-
- struct UnsatisfiedDependencies
- {
- std::vector<uint32_t> UnsatisfiedNodes;
- };
-
- struct UnreachableNodes
- {
- std::vector<uint32_t> UnreachableNodes;
- };
-
- using T = std::variant<
- Success,
- NoWorkToDo,
- UnsatisfiedDependencies,
- UnreachableNodes>;
+ /// Successfully rebuilt graph dependent data.
+ /// Details: nothing is written.
+ GUR_Success,
+ /// Nothing has changed since last time UpdateGraph() was called.
+ /// Details: nothing is written.
+ GUR_NoWorkToDo,
+ /// Details: list of nodes is written.
+ GUR_UnsatisfiedDependencies,
+ /// Details: list of nodes is written.
+ GUR_UnreachableNodes,
};
- GraphUpdateResult::T UpdateGraph();
+ using GraphUpdateDetails = std::variant<
+ // Case: nothing
+ std::monostate,
+ // Case: list of nodes (ids)
+ std::vector<uint32_t>>;
+
+ GraphUpdateResult UpdateGraph(GraphUpdateDetails* details = nullptr);
/* Serialization */