43 [[nodiscard]]
Result<std::
size_t>
write(std::span<const std::
byte> data) override;
47 [[nodiscard]]
Result<std::
size_t>
read(std::span<std::
byte> buffer) override;
53 [[nodiscard]]
bool isOpen() const noexcept override;
56 [[nodiscard]] std::string_view
name() const noexcept override;
75 [[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
Copy construction is disabled.
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
Move-constructs shared-memory state.
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.
~SharedMemory() override
Destroys shared-memory channel.
std::unique_ptr< Impl > impl_
Result< void > attach(ProcessId pid)
Attaches a process to this region.
SharedMemory & operator=(const SharedMemory &)=delete
Copy assignment is disabled.
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...