|
| NamedPipe () noexcept=default |
| Default constructor.
|
|
| NamedPipe (std::reference_wrapper< const io::StopSource > stopSource) noexcept |
| Constructor that associates a stop source with the named pipe.
|
|
| ~NamedPipe () noexcept=default |
| Noexcept Destructor.
|
|
internal | operator bool () const noexcept |
| Checks whether the object contains a valid named pipe.
|
|
auto | setStopSource (std::reference_wrapper< const io::StopSource > stopSource) -> void |
| Associates a stop source with the named pipe.
|
|
auto | removeStopSource () -> void |
| Removes any associated stop source from the named pipe.
|
|
auto | connect (std::string_view pipeName) -> void |
| Connects the pipe to a specific named pipe instance.
|
|
auto | close () noexcept -> void |
| Closes the named pipe, if one is open.
|
|
virtual | ~InputDevice () noexcept(false)=0 |
| Virtual, throwing destructor.
|
|
auto | read (std::size_t size) -> core::RawDataBlock |
| Reads a block of data of a specific size.
|
|
auto | readByte () -> std::byte |
| Reads a single byte.
|
|
auto | tryReadByte () -> std::optional< std::byte > |
| Tries to read a single byte from a device.
|
|
auto | readAll () -> core::RawDataBlock |
| Reads all remaining data.
|
|
auto | readAll (std::size_t maxSize) -> core::RawDataBlock |
| Reads all remaining data up to a maximum size.
|
|
auto | readChunk () -> core::RawDataBlock |
| Reads a single chunk of data.
|
|
auto | readChunk (std::size_t maxSize) -> core::RawDataBlock |
| Reads a single chunk of data up to a maximum size.
|
|
auto | readAvailable () -> std::pair< core::RawDataBlock, bool > |
| Reads all immediately available data.
|
|
auto | readAvailable (std::size_t maxSize) -> std::pair< core::RawDataBlock, bool > |
| Reads immediately available data up to a maximum size.
|
|
template<std::size_t kArraySize> |
auto | read (std::byte(&array)[kArraySize]) -> void |
| Read a block of data into an array.
|
|
template<std::size_t kArraySize> |
auto | read (std::array< std::byte, kArraySize > &array) -> void |
| Read a block of data into an array.
|
|
template<std::size_t kArraySize> |
auto | readChunk (std::byte(&array)[kArraySize]) -> core::RawDataBlock |
| Reads a single chunk of data into an array.
|
|
template<std::size_t kArraySize> |
auto | readChunk (std::array< std::byte, kArraySize > &array) -> core::RawDataBlock |
| Reads a single chunk of data into an array.
|
|
template<std::size_t kArraySize> |
auto | readAvailable (std::byte(&array)[kArraySize]) -> std::pair< std::size_t, bool > |
| Reads immediately available data into an array.
|
|
template<std::size_t kArraySize> |
auto | readAvailable (std::array< std::byte, kArraySize > &array) -> std::pair< std::size_t, bool > |
| Reads immediately available data into an array.
|
|
template<std::contiguous_iterator Iterator, std::sized_sentinel_for< Iterator > Sentinel>
requires std::same_as<std::remove_volatile_t<std::iter_value_t<Iterator>>, std::byte> |
auto | read (Iterator first, Sentinel last) -> void |
| Read data to fill an iterator range.
|
|
template<std::contiguous_iterator Iterator, std::sized_sentinel_for< Iterator > Sentinel>
requires std::same_as<std::iter_value_t<Iterator>, std::byte> |
auto | readChunk (Iterator first, Sentinel last) -> Iterator |
| Reads a single chunk of data data into an iterator range.
|
|
template<std::contiguous_iterator Iterator, std::sized_sentinel_for< Iterator > Sentinel>
requires std::same_as<std::iter_value_t<Iterator>, std::byte> |
auto | readAvailable (Iterator first, Sentinel last) -> std::pair< Iterator, bool > |
| Reads immediately available data into an iterator range.
|
|
auto | read (std::byte *buffer, std::size_t size) -> void |
| Read a block of data into a buffer.
|
|
auto | readChunk (std::byte *buffer, std::size_t size) -> std::size_t |
| Reads a single chunk of data into a buffer.
|
|
auto | readAvailable (std::byte *buffer, std::size_t size) -> std::pair< std::size_t, bool > |
| Reads immediately available data into a buffer.
|
|
auto | availableReadSize () const -> std::optional< std::size_t > |
| Get the number of bytes for reading without blocking.
|
|
auto | remainingReadSize () const -> std::optional< std::size_t > |
| Get the number of bytes remaining before the end of the device.
|
|
auto | readPosition () const -> std::optional< std::size_t > |
| Gets the current read position within the device.
|
|
auto | setReadPosition (std::size_t position) -> std::optional< std::size_t > |
| Sets the current read position within the device.
|
|
auto | moveReadPosition (std::ptrdiff_t offset, std::ios_base::seekdir origin=std::ios_base::cur) -> std::optional< std::size_t > |
| Advances or retreats the current read position within the device.
|
|
auto | advanceReadPosition (std::size_t offset) -> std::optional< std::size_t > |
| Advance the current read position within the device.
|
|
auto | rewind () -> bool |
| Sets the current read position to the beginning of the device.
|
|
auto | waitForData () -> void |
| Waits for more read data to become available.
|
|
auto | waitForData (std::optional< std::chrono::nanoseconds > timeout) -> bool |
| Waits for more read data to become available within a certain time.
|
|
auto | readTimeout () const noexcept -> std::chrono::nanoseconds |
| Returns the read timeout for communication devices.
|
|
auto | throwEndOfStreamError () const -> void |
| Throws an error denoting the end of the stream.
|
|
virtual | ~DeviceBase () noexcept(false)=0 |
| Virtual, throwing destructor.
|
|
auto | deviceDescription () const -> std::string |
| Get a description of the device.
|
|
virtual | ~OutputDevice () noexcept(false)=0 |
| Virtual, throwing destructor.
|
|
template<std::ranges::contiguous_range Data>
requires std::same_as<std::remove_cv_t<std::ranges::range_value_t<Data>>, std::byte> |
auto | write (const Data &data) -> void |
| Writes a block of data.
|
|
auto | writeByte (std::byte byte) -> void |
| Write a single byte.
|
|
template<std::ranges::contiguous_range Data>
requires std::same_as<std::remove_cv_t<std::ranges::range_value_t<Data>>, std::byte> |
auto | writeChunk (const Data &data) -> std::ranges::range_size_t< Data > |
| Writes a single chunk of data contained in an iterator range.
|
|
template<std::ranges::contiguous_range Data>
requires std::same_as<std::remove_cv_t<std::ranges::range_value_t<Data>>, std::byte> |
auto | tryWrite (const Data &data) -> std::ranges::range_size_t< Data > |
| Write as much of a data block as is possible without blocking.
|
|
auto | tryWriteByte (std::byte byte) -> bool |
| Write a single byte, if this can be done without blocking.
|
|
template<std::contiguous_iterator Iterator, std::sized_sentinel_for< Iterator > Sentinel>
requires std::same_as<std::remove_cv_t<std::iter_value_t<Iterator>>, std::byte> |
auto | write (Iterator first, Sentinel last) -> void |
| Writes the data contained in an iterator range.
|
|
template<std::contiguous_iterator Iterator, std::sized_sentinel_for< Iterator > Sentinel>
requires std::same_as<std::remove_cv_t<std::iter_value_t<Iterator>>, std::byte> |
auto | writeChunk (Iterator first, Sentinel last) -> Iterator |
| Writes a single chunk of data from an an iterator range.
|
|
template<std::contiguous_iterator Iterator, std::sized_sentinel_for< Iterator > Sentinel>
requires std::same_as<std::iter_value_t<Iterator>, std::byte> |
auto | tryWrite (Iterator first, Sentinel last) -> Iterator |
| Write as much of the data contained in an iterator range as is possible without blocking.
|
|
auto | write (const std::byte *data, std::size_t size) -> void |
| Write a block of data.
|
|
auto | writeChunk (const std::byte *data, std::size_t size) -> std::size_t |
| Writes a single chunk of data.
|
|
auto | tryWrite (const std::byte *data, std::size_t size) -> std::size_t |
| Write as much of a data block as is possible without blocking.
|
|
auto | writePosition () const -> std::optional< std::size_t > |
| Gets the current write position within the device.
|
|
auto | setWritePosition (std::size_t position) -> std::optional< std::size_t > |
| Sets the current write position within the device.
|
|
auto | moveWritePosition (std::ptrdiff_t offset, std::ios_base::seekdir origin=std::ios_base::cur) -> std::optional< std::size_t > |
| Advances or retreats the current write position within the device.
|
|
auto | waitUntilWritable (std::chrono::nanoseconds timeout) -> bool |
| Waits for the device to be able to accept more write data within a certain time.
|
|
auto | writeTimeout () const noexcept -> std::chrono::nanoseconds |
| Returns the write timeout for communication devices.
|
|
|
virtual auto | doRead (std::byte *buffer, std::size_t size) -> std::optional< std::size_t >=0 |
| Called by the framework to read available data into a buffer up to a maximum size.
|
|
virtual auto | doThrowEndOfStreamError () const -> void |
| Called by the framework to throw an error denoting the end of the stream.
|
|
virtual auto | doGetAvailableReadSize () const -> std::optional< std::size_t > |
| Called by the framework to get the number of bytes that will be read by the next call to doRead().
|
|
virtual auto | doGetRemainingReadSize () const -> std::optional< std::size_t > |
| Called by the framework to get the number of bytes remaining before the end of the device.
|
|
virtual auto | doWaitForData (std::optional< std::chrono::nanoseconds > timeout) -> bool |
| Called by the framework to wait for more read data to become available.
|
|
virtual auto | doWaitForDataAndRead (std::byte *buffer, std::size_t size, std::chrono::nanoseconds timeout) -> std::optional< std::size_t > |
| Called by the framework to wait for read data to become available, and then read it.
|
|
virtual auto | doGetReadTimeout () const noexcept -> std::chrono::nanoseconds |
| Called by the framework to get the read timeout.
|
|
virtual auto | doGetReadPosition () const -> std::optional< std::size_t > |
| Called by the framework to get the current read position within the device.
|
|
virtual auto | doSetReadPosition (std::size_t position) -> std::optional< std::size_t > |
| Called by the framework to set the current read position within the device.
|
|
virtual auto | doMoveReadPosition (std::ptrdiff_t offset, std::ios_base::seekdir origin=std::ios_base::cur) -> std::optional< std::size_t > |
| Called by the framework to advance or retreat the current read position within the device.
|
|
virtual auto | doAdvanceReadPosition (std::size_t offset) -> std::optional< std::size_t > |
| Called by the framework to advance the current read position within the device.
|
|
virtual auto | doGetDeviceDescription () const -> std::string=0 |
| Called by the framework to get a description of the device.
|
|
virtual auto | doWrite (const std::byte *data, std::size_t size) -> std::size_t=0 |
| Called by the framework to write data up to a maximum size.
|
|
virtual auto | doWaitUntilWritable (std::optional< std::chrono::nanoseconds > timeout) -> bool |
| Called by the framework to wait for the device to be able to accept more write data with an optional timeout.
|
|
virtual auto | doWaitUntilWritableAndWrite (const std::byte *data, std::size_t size, std::chrono::nanoseconds timeout) -> std::size_t |
| Called by the framework to wait for the device to be able to accept more write data, and then write to it.
|
|
virtual auto | doGetWriteTimeout () const noexcept -> std::chrono::nanoseconds |
| Called by the framework to get the write timeout.
|
|
virtual auto | doGetWritePosition () const -> std::optional< std::size_t > |
| Called by the framework to get the current write position within the device.
|
|
virtual auto | doSetWritePosition (std::size_t position) -> std::optional< std::size_t > |
| Called by the framework to set the current write position within the device.
|
|
virtual auto | doMoveWritePosition (std::ptrdiff_t offset, std::ios_base::seekdir origin=std::ios_base::cur) -> std::optional< std::size_t > |
| Called by the framework to advance or retreat the current write position within the device.
|
|
A named pipe for communication with other processes.