UCILoader 1.1.2
Small C++ library that allows user to connect to a chess engines via UCI protocol.
Loading...
Searching...
No Matches
UCILoader::ConcreteEvent< Payload, EventCode > Class Template Reference

Template for creating typed event objects with a payload. More...

#include <EngineEvent.h>

Inheritance diagram for UCILoader::ConcreteEvent< Payload, EventCode >:
UCILoader::EngineEvent

Public Member Functions

 ConcreteEvent (const Payload &p)
 Constructor that stores the payload.
 
uint32_t getType () const override
 Get the event type code.
 
virtual const void * getPayload () const override
 Get pointer to the stored payload.
 
- Public Member Functions inherited from UCILoader::EngineEvent
virtual ~EngineEvent ()
 Virtual destructor for proper cleanup of derived classes.
 
virtual uint32_t getType () const =0
 Get the type code of this event.
 
virtual const void * getPayload () const =0
 Get the payload data associated with this event.
 

Detailed Description

template<class Payload, uint32_t EventCode>
class UCILoader::ConcreteEvent< Payload, EventCode >

Template for creating typed event objects with a payload.

Template Parameters
PayloadThe data type of the event payload
EventCodeThe unique event type code (must be power of 2)

ConcreteEvent is a template base class for implementing concrete event types that carry data. Instances are typically created by factory functions in NamedEngineEvents namespace rather than instantiated directly.

Type Safety: Payload is type-checked at compile time. Getters use virtual methods to return the payload pointer, which the caller must cast to the appropriate type based on getType().

See also
NamedEngineEvents for concrete event type definitions

Constructor & Destructor Documentation

◆ ConcreteEvent()

template<class Payload , uint32_t EventCode>
UCILoader::ConcreteEvent< Payload, EventCode >::ConcreteEvent ( const Payload &  p)
inline

Constructor that stores the payload.

Parameters
pThe payload value to store

Member Function Documentation

◆ getPayload()

template<class Payload , uint32_t EventCode>
virtual const void * UCILoader::ConcreteEvent< Payload, EventCode >::getPayload ( ) const
inlineoverridevirtual

Get pointer to the stored payload.

Returns
Const void pointer to the Payload value

Implements UCILoader::EngineEvent.

◆ getType()

template<class Payload , uint32_t EventCode>
uint32_t UCILoader::ConcreteEvent< Payload, EventCode >::getType ( ) const
inlineoverridevirtual

Get the event type code.

Returns
The EventCode template parameter

Implements UCILoader::EngineEvent.


The documentation for this class was generated from the following file: