mirror of
https://git.sfja.dk/Mikkel/slige.git
synced 2025-01-18 17:56:30 +00:00
50 lines
1.1 KiB
C++
50 lines
1.1 KiB
C++
#include "rpc_server.hpp"
|
|
#include "vm_provider.hpp"
|
|
#include <memory>
|
|
|
|
namespace sliger::rpc::action {
|
|
|
|
struct Action {
|
|
virtual auto perform_action(std::unique_ptr<BufferedWriter> writer,
|
|
VmProvider& vm_provider) -> void = 0;
|
|
virtual ~Action() = default;
|
|
};
|
|
|
|
class Status : public Action {
|
|
public:
|
|
Status() { }
|
|
auto perform_action(std::unique_ptr<BufferedWriter> writer,
|
|
VmProvider& vm_provider) -> void;
|
|
};
|
|
|
|
class FlameGraph : public Action {
|
|
public:
|
|
FlameGraph() { }
|
|
auto perform_action(std::unique_ptr<BufferedWriter> writer,
|
|
VmProvider& vm_provider) -> void;
|
|
};
|
|
|
|
class CodeCoverage : public Action {
|
|
public:
|
|
CodeCoverage() { }
|
|
auto perform_action(std::unique_ptr<BufferedWriter> writer,
|
|
VmProvider& vm_provider) -> void;
|
|
};
|
|
|
|
class RunDebug : public Action {
|
|
public:
|
|
RunDebug(std::vector<uint32_t> instructions)
|
|
: instructions(instructions)
|
|
{
|
|
}
|
|
auto perform_action(std::unique_ptr<BufferedWriter> writer,
|
|
VmProvider& vm_provider) -> void;
|
|
|
|
private:
|
|
std::vector<uint32_t> instructions;
|
|
};
|
|
|
|
auto action_from_json(const json::Value& value) -> std::unique_ptr<Action>;
|
|
|
|
}
|