47 std::string req_name =
base_name_ +
"_request";
51 std::string resp_name =
base_name_ +
"_response";
62 bool send(
const void*
data,
size_t len, uint64_t timeout_ns)
override
78 void release(
size_t message_size)
override
Abstract interface for IPC client.
IPC client implementation using shared memory.
bool connect() override
Connect to the server.
ShmClient & operator=(const ShmClient &)=delete
std::optional< SpscShm > response_ring_
void release(size_t message_size) override
Release the previously received message.
std::optional< SpscShm > request_ring_
~ShmClient() override=default
ShmClient & operator=(ShmClient &&)=delete
std::span< const uint8_t > receive(uint64_t timeout_ns) override
Receive a message from the server (zero-copy for shared memory)
ShmClient(ShmClient &&)=delete
bool send(const void *data, size_t len, uint64_t timeout_ns) override
Send a message to the server.
ShmClient(const ShmClient &)=delete
void close() override
Close the connection.
ShmClient(std::string base_name)
static SpscShm connect(const std::string &name)
Connect to existing SPSC ring buffer.
const std::vector< MemoryValue > data
bool ring_send_msg(SpscShm &ring, const void *data, size_t len, uint64_t timeout_ns)
std::span< const uint8_t > ring_receive_msg(SpscShm &ring, uint64_t timeout_ns)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Single-producer/single-consumer shared-memory ring buffer (Linux, x86-64 optimized)