|
UCILoader 1.1.2
Small C++ library that allows user to connect to a chess engines via UCI protocol.
|
Base class for event observers that receive engine events. More...
#include <EngineEvent.h>
Public Member Functions | |
| virtual | ~EventReceiver () |
| Virtual destructor that disconnects from all connected emitters. | |
| void | unlinkAll () |
| Disconnect this receiver from all connected emitters. | |
| virtual uint32_t | eventFilter ()=0 |
| Get the event filter bitmask for this receiver. | |
| virtual void | receiveEvent (const EngineEvent *event)=0 |
| Handle an incoming event. | |
Base class for event observers that receive engine events.
EventReceiver defines the interface for custom event handlers. To receive events from an EngineInstance:
Creating Custom Event Receivers:
|
pure virtual |
Get the event filter bitmask for this receiver.
This method determines which events this receiver will be notified about. The returned value should be a bitwise OR of one or more event constants from NamedEngineEvents.
Example:
Guaranteed that receiveEvent() is only called with events matching this filter.
Implemented in UCILoader::FunctionCallbackEventReceiver.
|
pure virtual |
Handle an incoming event.
| event | Pointer to the EngineEvent to handle |
This method is invoked by the event emitter when an event matching the receiver's eventFilter() is emitted. It's guaranteed that:
Implementations should:
Implemented in UCILoader::FunctionCallbackEventReceiver.
| void UCILoader::EventReceiver::unlinkAll | ( | ) |
Disconnect this receiver from all connected emitters.
Safely removes all connections and prevents further event delivery.