35 [[nodiscard]]
Result<std::
size_t>
write(std::span<const std::
byte> data) override;
39 [[nodiscard]]
Result<std::
size_t>
read(std::span<std::
byte> buffer) override;
45 [[nodiscard]]
bool isOpen() const noexcept override;
48 [[nodiscard]] std::string_view
name() const noexcept override;
67 [[nodiscard]] std::
size_t size() const noexcept;
Common interface for IPC channels.
A result type that holds either a success value of type T or an ErrorCode.
bool isAttached(ProcessId pid) const noexcept
Returns true if process is attached.
void close() override
Closes the region, clears attachments, and resets data.
SharedMemory(const SharedMemory &)=delete
Result< std::size_t > write(std::span< const std::byte > data) override
Writes bytes into the beginning of the shared region.
std::size_t size() const noexcept
Region size in bytes.
Result< std::size_t > read(std::span< std::byte > buffer) override
Reads bytes from the beginning of the shared region.
SharedMemory(SharedMemory &&) noexcept
Result< void > detach(ProcessId pid)
Detaches a process from this region.
bool isOpen() const noexcept override
Returns whether the region is open.
std::size_t attachedCount() const noexcept
Number of attached processes.
std::string_view name() const noexcept override
Region name.
std::unique_ptr< Impl > impl_
Result< void > attach(ProcessId pid)
Attaches a process to this region.
SharedMemory & operator=(const SharedMemory &)=delete
SharedMemory(std::string name, std::size_t bytes)
Creates a named shared-memory region.
IIpcChannel interface for inter-process communication channels.
std::uint32_t ProcessId
Unique identifier for a process.
Common type aliases, sentinel constants, and forward declarations used throughout the Contur 2 kernel...