mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2025-08-17 16:57:11 +00:00
34 lines
939 B
C++
34 lines
939 B
C++
///
|
|
/// Created by Anonymous275 on 1/26/22
|
|
/// Copyright (c) 2021-present Anonymous275 read the LICENSE file for more info.
|
|
///
|
|
|
|
#pragma once
|
|
#include <string>
|
|
|
|
class IPC {
|
|
public:
|
|
IPC() = delete;
|
|
IPC(const char* MemID, const char* SemID, const char* SemID2, size_t Size) noexcept;
|
|
[[nodiscard]] size_t size() const noexcept;
|
|
[[nodiscard]] char* c_str() const noexcept;
|
|
void send(const std::string& msg) noexcept;
|
|
[[nodiscard]] void* raw() const noexcept;
|
|
[[nodiscard]] bool receive_timed_out() const noexcept;
|
|
[[nodiscard]] bool send_timed_out() const noexcept;
|
|
const std::string& msg() noexcept;
|
|
void confirm_receive() noexcept;
|
|
void try_receive() noexcept;
|
|
void receive() noexcept;
|
|
~IPC() noexcept;
|
|
private:
|
|
void* SemConfHandle_;
|
|
void* MemoryHandle_;
|
|
void* SemHandle_;
|
|
std::string Msg_;
|
|
bool SendTimeout;
|
|
bool RcvTimeout;
|
|
size_t Size_;
|
|
char* Data_;
|
|
};
|