iw4x-client/src/Components/Modules/IPCHandler.hpp
2017-01-30 20:47:01 +01:00

28 lines
635 B
C++

#pragma once
namespace Components
{
class IPCHandler : public Component
{
public:
typedef Utils::Slot<void(std::string)> Callback;
IPCHandler();
~IPCHandler();
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* getName() override { return "IPCHandler"; };
#endif
static void SendClient(std::string message, std::string data);
static void OnClient(std::string message, Callback callback);
private:
static std::unique_ptr<Utils::IPC::BidirectionalChannel> ClientChannel;
static std::unordered_map<std::string, Callback> ClientCallbacks;
static void InitChannel();
static void HandleClient();
};
}