|
UCILoader 1.1.2
Small C++ library that allows user to connect to a chess engines via UCI protocol.
|
Factory builder for creating EngineInstance objects. More...
#include <EngineConnection.h>
Public Member Functions | |
| EngineInstanceBuilder (std::shared_ptr< PatternMatcher > validator, std::shared_ptr< Marschaler< Move > > marschaler) | |
| Constructor for the builder. | |
| EngineInstance< Move > * | build (ProcessWrapper *engineProcess) |
| Build an EngineInstance with default logging (no-op logger). | |
| EngineInstance< Move > * | build (ProcessWrapper *engineProcess, LoggerBuilder logger) |
| Build an EngineInstance with custom logging configuration. | |
Factory builder for creating EngineInstance objects.
| Move | The move type to use (standard chess, variant, etc.) |
EngineInstanceBuilder is a factory class that creates and configures EngineInstance objects. It encapsulates move validation and parsing logic, allowing different chess variants to be supported.
Standard Chess Usage: If developing for standard chess, use the preconfigured StandardChess::ChessEngineInstanceBuilder:
Custom Variant Usage: For custom chess variants, provide your own PatternMatcher and Marschaler:
|
inline |
Constructor for the builder.
| validator | Shared pointer to PatternMatcher for move validation |
| marschaler | Shared pointer to Marschaler for move parsing |
|
inline |
Build an EngineInstance with default logging (no-op logger).
| engineProcess | Raw pointer to a ProcessWrapper for the engine executable |
The EngineInstance takes ownership of the engine process, so the caller does NOT need to manage its lifetime. However, the caller IS responsible for deleting the returned EngineInstance pointer when no longer needed.
For obtaining a ProcessWrapper, see the documentation of openEngineProcessFunction.
|
inline |
Build an EngineInstance with custom logging configuration.
| engineProcess | Raw pointer to a ProcessWrapper for the engine executable |
| logger | Configured LoggerBuilder for logging UCI messages |
The EngineInstance takes ownership of both the engine process and the logger instance, so the caller does NOT need to manage their lifetimes. However, the caller IS responsible for deleting the returned EngineInstance pointer when no longer needed.
Example:
For obtaining a ProcessWrapper, see the documentation of openEngineProcessFunction. For logger configuration options, see the Logger and Loggers documentation.