|
UCILoader 1.1.2
Small C++ library that allows user to connect to a chess engines via UCI protocol.
|
Abstract interface for non-blocking reading from a pipe. More...
#include <AbstractPipe.h>
Inherited by UnixPipeReader, and WindowsPipeReader.
Public Member Functions | |
| virtual | ~AbstractPipeReader () noexcept |
| Virtual destructor for proper cleanup of derived classes. | |
| virtual size_t | poll (char *buffer, size_t buffer_size)=0 |
| Poll for available data from the pipe without blocking. | |
| virtual bool | isOpen () const =0 |
| Check if the pipe is currently open. | |
Abstract interface for non-blocking reading from a pipe.
Provides an abstraction for reading data from a pipe in a non-blocking manner. This interface is implemented by platform-specific readers:
The poll() method reads available data without blocking. If no data is available, it returns 0. If the pipe is closed, PipeClosedException is thrown.
Important Notes:
|
pure virtual |
Check if the pipe is currently open.
|
pure virtual |
Poll for available data from the pipe without blocking.
| buffer | Pointer to memory where data will be written |
| buffer_size | Maximum number of bytes to read |
| PipeClosedException | if the pipe is closed or broken |
This method is non-blocking:
Exception Safety: If PipeClosedException is thrown, the pipe is corrupted or closed and should not be used further. Pre-checking isOpen() does not guarantee safety against concurrent closure.
Typical Usage Pattern: Use PipeScanner which wraps this method to provide blocking line-based reading.