refactor(furvm): refactor executor

Refs: #12
This commit is contained in:
2026-06-16 14:45:36 +02:00
parent 78acfb6ee2
commit 0dfa8c1c02
4 changed files with 15 additions and 46 deletions
+7
View File
@@ -5,6 +5,7 @@
#include "furvm/fwd.hpp"
#include "furvm/module.hpp"
#include <memory>
#include <queue>
#include <string>
#include <type_traits>
@@ -86,6 +87,12 @@ public:
* @return The module count.
*/
constexpr size_t module_count() const { return m_modules.size(); }
public:
template <typename... Args, typename = std::enable_if_t<std::is_constructible_v<executor, Args...>>>
auto& emplace_executor(Args&&... args) {
executor_p executor = std::make_shared<class executor>(std::forward<Args>(args)...);
return m_executors.emplace_back(std::move(executor));
}
public:
/**
* @brief Removes unreferenced things from the thing list.