28 lines
505 B
C++
28 lines
505 B
C++
#pragma once
|
|
|
|
#include "vm.hpp"
|
|
#include <mutex>
|
|
#include <thread>
|
|
|
|
namespace sliger::rpc::vm_provider {
|
|
class VmProvider {
|
|
public:
|
|
VmProvider() { }
|
|
|
|
auto load_and_run(std::vector<uint32_t> instructions) -> void;
|
|
auto flame_graph_json() -> std::optional<std::string>;
|
|
auto code_coverage_json() -> std::optional<std::string>;
|
|
|
|
auto done() -> bool;
|
|
|
|
private:
|
|
void run_timeslot();
|
|
|
|
std::mutex mutex;
|
|
|
|
std::optional<VM> vm;
|
|
std::optional<std::thread> running_thread;
|
|
};
|
|
|
|
}
|