mirror of
https://git.sfja.dk/Mikkel/slige.git
synced 2025-01-18 13:06:30 +00:00
36 lines
719 B
C++
36 lines
719 B
C++
#pragma once
|
|
|
|
#include "vm.hpp"
|
|
#include <cstdint>
|
|
#include <mutex>
|
|
#include <thread>
|
|
#include <vector>
|
|
|
|
namespace sliger::rpc {
|
|
|
|
class VmProvider {
|
|
public:
|
|
VmProvider() { }
|
|
|
|
VmProvider(const VmProvider&) = delete;
|
|
VmProvider operator=(const VmProvider&) = delete;
|
|
VmProvider(VmProvider&&) = delete;
|
|
VmProvider operator=(VmProvider&&) = delete;
|
|
|
|
auto load_and_start(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;
|
|
};
|
|
|
|
}
|