contur2
Loading...
Searching...
No Matches
contur::IIpcChannel Class Referenceabstract

Common interface for IPC channels. More...

#include <i_ipc_channel.h>

Inheritance diagram for contur::IIpcChannel:

Public Member Functions

virtual ~IIpcChannel ()=default
virtual Result< std::size_t > write (std::span< const std::byte > data)=0
 Writes up to data.size() bytes into the channel.
virtual Result< std::size_t > read (std::span< std::byte > buffer)=0
 Reads up to buffer.size() bytes from the channel.
virtual void close ()=0
 Closes the channel and releases transient state.
virtual bool isOpen () const noexcept=0
 Returns whether the channel accepts read/write operations.
virtual std::string_view name () const noexcept=0
 Human-readable channel name.

Detailed Description

Common interface for IPC channels.

Implementations provide byte-level read/write semantics and lifecycle control through open/close state.

Definition at line 18 of file i_ipc_channel.h.

Constructor & Destructor Documentation

◆ ~IIpcChannel()

virtual contur::IIpcChannel::~IIpcChannel ( )
virtualdefault

Member Function Documentation

◆ close()

virtual void contur::IIpcChannel::close ( )
pure virtual

Closes the channel and releases transient state.

Implemented in contur::MessageQueue, contur::Pipe, and contur::SharedMemory.

◆ isOpen()

virtual bool contur::IIpcChannel::isOpen ( ) const
nodiscardpure virtualnoexcept

Returns whether the channel accepts read/write operations.

Implemented in contur::MessageQueue, contur::Pipe, and contur::SharedMemory.

◆ name()

virtual std::string_view contur::IIpcChannel::name ( ) const
nodiscardpure virtualnoexcept

Human-readable channel name.

Implemented in contur::MessageQueue, contur::Pipe, and contur::SharedMemory.

◆ read()

virtual Result< std::size_t > contur::IIpcChannel::read ( std::span< std::byte > buffer)
nodiscardpure virtual

Reads up to buffer.size() bytes from the channel.

Parameters
bufferDestination buffer.
Returns
Number of bytes read, or an error code.

Implemented in contur::MessageQueue, contur::Pipe, and contur::SharedMemory.

◆ write()

virtual Result< std::size_t > contur::IIpcChannel::write ( std::span< const std::byte > data)
nodiscardpure virtual

Writes up to data.size() bytes into the channel.

Parameters
dataSource bytes.
Returns
Number of bytes written, or an error code.

Implemented in contur::MessageQueue, contur::Pipe, and contur::SharedMemory.


The documentation for this class was generated from the following file: