Porytiles
Loading...
Searching...
No Matches
pipeline.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <expected>
4#include <memory>
5#include <unordered_map>
6#include <vector>
7
10
11namespace porytiles2 {
12
22class Pipeline {
23 public:
34 explicit Pipeline(const std::vector<Operation *> &ops);
35
45 [[nodiscard]] ChainableResult<void> run() const;
46
47 private:
48 std::unordered_map<std::string, Operation *> producers_;
49 std::unordered_map<Operation *, std::vector<Operation *>> adj_;
50 std::unordered_map<Operation *, int> in_degree_;
51 std::vector<Operation *> sorted_;
52};
53
54} // namespace porytiles2
A result type that maintains a chainable sequence of errors for debugging and error reporting.
Manages and executes a collection of operations in dependency order.
Definition pipeline.hpp:22
ChainableResult< void > run() const
Executes all operations in the pipeline in dependency order.
Definition pipeline.cpp:66