mirror of
https://git.sfja.dk/Mikkel/slige.git
synced 2025-01-18 18:16:31 +00:00
44 lines
1.0 KiB
C++
44 lines
1.0 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,
|
|
vm_provider::VmProvider& vm_provider) -> void
|
|
= 0;
|
|
virtual ~Action() = default;
|
|
};
|
|
|
|
class FlameGraph : public Action {
|
|
public:
|
|
FlameGraph() { }
|
|
auto perform_action(std::unique_ptr<BufferedWriter> writer,
|
|
vm_provider::VmProvider& vm_provider) -> void;
|
|
};
|
|
|
|
class CodeCoverage : public Action {
|
|
public:
|
|
CodeCoverage() { }
|
|
auto perform_action(std::unique_ptr<BufferedWriter> writer,
|
|
vm_provider::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,
|
|
vm_provider::VmProvider& vm_provider) -> void;
|
|
|
|
private:
|
|
std::vector<uint32_t> instructions;
|
|
};
|
|
|
|
auto action_from_json(const json::Value& value) -> std::unique_ptr<Action>;
|
|
|
|
}
|