This commit is contained in:
Сергей Маринкевич
2025-12-02 19:18:36 +07:00
parent 4433568545
commit 785fca07f1
15 changed files with 140 additions and 62 deletions
+31
View File
@@ -0,0 +1,31 @@
#pragma once
#include <ipc/IpcChannel.h>
class ProxyMarshaller {
public:
explicit ProxyMarshaller(IpcChannel& ch) : channel(ch) {}
template<typename Ret, typename... Args>
Ret call(const std::string& method, const Args&... args) {
IpcMessage msg;
// имя метода
msg.add(method);
// аргументы
(msg.add(args), ...);
// отправить
channel.send(msg);
// получить ответ
IpcMessage resp = channel.receive();
return resp.template get<Ret>();
}
private:
IpcChannel& channel;
};