|
UCILoader 1.1.2
Small C++ library that allows user to connect to a chess engines via UCI protocol.
|
Abstract interface for writing to a pipe. More...
#include <AbstractPipe.h>
Inherited by UnixPipeWriter, and WindowsPipeWriter.
Public Member Functions | |
| virtual | ~AbstractPipeWriter () noexcept |
| Virtual destructor for proper cleanup of derived classes. | |
| virtual void | write (const char *buffer, size_t buffer_size)=0 |
| Write data to the pipe, blocking until complete. | |
| virtual bool | isOpen () const =0 |
| Check if the pipe is currently open. | |
Abstract interface for writing to a pipe.
Provides an abstraction for writing data to a pipe. This interface is implemented by platform-specific writers:
The write() method is designed to write all requested bytes or throw an exception. It differs from poll() in that it always writes the complete buffer or fails.
Important Notes:
|
pure virtual |
Check if the pipe is currently open.
|
pure virtual |
Write data to the pipe, blocking until complete.
| buffer | Pointer to the data to write |
| buffer_size | Number of bytes to write |
| PipeClosedException | if the pipe is closed or broken |
This method guarantees that either:
The method blocks until the complete buffer is written. It's suitable for sending UCI commands and other structured messages that must be transmitted completely.
Exception Safety: If PipeClosedException is thrown, the pipe is broken and should not be used further. Some or all of the data may have been written before the exception.
Typical Usage: