| #pragma once |
|
|
| |
| |
| |
| |
| |
| |
|
|
| #include <string> |
| #include <vector> |
| #include <unordered_map> |
| #include <functional> |
| #include <mutex> |
|
|
| namespace autoforge { |
|
|
| |
| struct DAGNode { |
| std::string id; |
| std::string name; |
| std::string type; |
| std::vector<std::string> deps; |
| }; |
|
|
| |
| class DAGEngine { |
| public: |
| DAGEngine(); |
| ~DAGEngine(); |
|
|
| |
| static std::string version(); |
|
|
| |
| void add_node(const DAGNode& node); |
|
|
| |
| size_t node_count() const; |
|
|
| |
| void clear(); |
|
|
| |
| bool validate() const; |
|
|
| |
| |
| bool execute(); |
|
|
| private: |
| std::vector<DAGNode> nodes_; |
| std::unordered_map<std::string, size_t> index_; |
| mutable std::mutex mutex_; |
| }; |
|
|
| } |
|
|