yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
agent_control_server.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef YAZE_WITH_GRPC
4
5#include <functional>
6#include <memory>
7#include <string>
8#include <thread>
9
11
12#include <grpcpp/server.h>
13
14namespace yaze {
15class Rom;
16}
17
18namespace yaze::emu {
19class Emulator;
20}
21
22namespace yaze::agent {
23
24class AgentControlServer {
25 public:
26 using RomGetter = std::function<Rom*()>;
27 using RomLoader = std::function<bool(const std::string& path)>;
28
29 AgentControlServer(yaze::emu::Emulator* emulator,
30 RomGetter rom_getter = nullptr,
31 RomLoader rom_loader = nullptr);
32 ~AgentControlServer();
33
34 void Start();
35 void Stop();
36
37 private:
38 void Run();
39
40 yaze::emu::Emulator* emulator_; // Non-owning pointer
41 RomGetter rom_getter_;
42 RomLoader rom_loader_;
43 std::unique_ptr<grpc::Server> server_;
44 std::thread server_thread_;
45};
46
47} // namespace yaze::agent
48
49#endif // YAZE_WITH_GRPC
A class for emulating and debugging SNES games.
Definition emulator.h:39
SNES Emulation and debugging tools.
Definition editor.h:29