Cute Chess  0.1
Public Types | Public Member Functions | List of all members
EngineConfiguration Class Reference

The EngineConfiguration class defines a chess engine configuration. More...

#include <engineconfiguration.h>

Public Types

enum  RestartMode { RestartAuto, RestartOn, RestartOff }
 

Public Member Functions

void addArgument (const QString &argument)
 
void addInitString (const QString &initString)
 
void addOption (EngineOption *option)
 
bool areClaimsValidated () const
 
QStringList arguments () const
 
QString command () const
 
 EngineConfiguration ()
 
 EngineConfiguration (const QString &name, const QString &command, const QString &protocol)
 
 EngineConfiguration (const QVariant &variant)
 
 EngineConfiguration (const EngineConfiguration &other)
 
QStringList initStrings () const
 
QString name () const
 
EngineConfigurationoperator= (EngineConfiguration &&other)
 
EngineConfigurationoperator= (const EngineConfiguration &other)
 
QList< EngineOption * > options () const
 
bool pondering () const
 
QString protocol () const
 
RestartMode restartMode () const
 
void setArguments (const QStringList &arguments)
 
void setClaimsValidated (bool validate)
 
void setCommand (const QString &command)
 
void setInitStrings (const QStringList &initStrings)
 
void setName (const QString &name)
 
void setOption (const QString &name, const QVariant &value)
 
void setOptions (const QList< EngineOption * > &options)
 
void setPondering (bool enabled)
 
void setProtocol (const QString &protocol)
 
void setRestartMode (RestartMode mode)
 
void setStderrFile (const QString &fileName)
 
void setSupportedVariants (const QStringList &variants)
 
void setWhiteEvalPov (bool whiteEvalPov)
 
void setWorkingDirectory (const QString &workingDir)
 
QString stderrFile () const
 
QStringList supportedVariants () const
 
bool supportsVariant (const QString &variant) const
 
QVariant toVariant () const
 
bool whiteEvalPov () const
 
QString workingDirectory () const
 
 ~EngineConfiguration ()
 

Detailed Description

The EngineConfiguration class defines a chess engine configuration.

See also
EngineConfigurationModel

Member Enumeration Documentation

The modes that determine whether the engine will be restarted between games.

Enumerator
RestartAuto 

The engine decides whether to restart.

RestartOn 

The engine is always restarted between games.

RestartOff 

The engine is never restarted between games.

Constructor & Destructor Documentation

EngineConfiguration::EngineConfiguration ( )

Creates an empty chess engine configuration.

EngineConfiguration::EngineConfiguration ( const QString name,
const QString command,
const QString protocol 
)

Creates a new chess engine configuration with specified name, command and protocol settings.

EngineConfiguration::EngineConfiguration ( const QVariant variant)

Creates a new chess engine configuration from a QVariant.

EngineConfiguration::EngineConfiguration ( const EngineConfiguration other)

Creates a new chess engine configuration from other.

EngineConfiguration::~EngineConfiguration ( )

Destroys the engine configuration.

Member Function Documentation

void EngineConfiguration::addArgument ( const QString argument)

Adds new command line argument.

void EngineConfiguration::addInitString ( const QString initString)

Adds new initialization string.

void EngineConfiguration::addOption ( EngineOption option)

Adds new option.

bool EngineConfiguration::areClaimsValidated ( ) const

Returns true if result claims from the engine are validated; otherwise returns false.

With validation on (the default) the engine will forfeit the game if it makes an incorrect result claim.

QStringList EngineConfiguration::arguments ( ) const

Returns the command line arguments sent to the engine.

QString EngineConfiguration::command ( ) const

Returns the command which is used to launch the engine.

See also
setCommand()
QStringList EngineConfiguration::initStrings ( ) const

Returns the initialization strings sent to the engine.

QString EngineConfiguration::name ( ) const

Returns the engine's name.

See also
setName()
EngineConfiguration & EngineConfiguration::operator= ( EngineConfiguration &&  other)

Move assignment operator.

EngineConfiguration & EngineConfiguration::operator= ( const EngineConfiguration other)

Assigns other to this engine configuration and returns a reference to this object.

QList< EngineOption * > EngineConfiguration::options ( ) const

Returns the options sent to the engine.

bool EngineConfiguration::pondering ( ) const

Returns true if pondering is enabled for the engine.

QString EngineConfiguration::protocol ( ) const

Returns the communication protocol the engine uses.

See also
setProtocol()
EngineConfiguration::RestartMode EngineConfiguration::restartMode ( ) const

Returns the restart mode. The default value is RestartAuto.

void EngineConfiguration::setArguments ( const QStringList arguments)

Sets the command line arguments sent to the engine.

void EngineConfiguration::setClaimsValidated ( bool  validate)

Sets result claim validation mode to validate.

void EngineConfiguration::setCommand ( const QString command)

Sets the command which is used to launch the engine.

See also
command()
void EngineConfiguration::setInitStrings ( const QStringList initStrings)

Sets the initialization strings sent to the engine.

void EngineConfiguration::setName ( const QString name)

Sets the engine's name.

See also
name()
void EngineConfiguration::setOption ( const QString name,
const QVariant value 
)

Sets option name's value to value.

If an option with the name name doesn't exist, a new EngineTextOption object is added to the configuration.

void EngineConfiguration::setOptions ( const QList< EngineOption * > &  options)

Sets the options sent to the engine.

void EngineConfiguration::setPondering ( bool  enabled)

Sets pondering mode to enabled.

void EngineConfiguration::setProtocol ( const QString protocol)

Sets the communication protocol the engine uses.

See also
protocol()
void EngineConfiguration::setRestartMode ( RestartMode  mode)

Sets the restart mode to mode.

void EngineConfiguration::setStderrFile ( const QString fileName)

Sets the filename where the engine's standard error output is written.

See also
stderrFile()
void EngineConfiguration::setSupportedVariants ( const QStringList variants)

Sets the list of supported variants to variants.

void EngineConfiguration::setWhiteEvalPov ( bool  whiteEvalPov)

Sets white evaluation point of view.

void EngineConfiguration::setWorkingDirectory ( const QString workingDir)

Sets the working directory the engine uses.

See also
workingDirectory()
QString EngineConfiguration::stderrFile ( ) const

Returns the filename where the engine's standard error output is written.

See also
setStderrFile()
QStringList EngineConfiguration::supportedVariants ( ) const

Returns a list of the chess variants the engine can play.

Returns a list containing variant "standard" by default.

bool EngineConfiguration::supportsVariant ( const QString variant) const

Returns true if the engine can play variant; otherwise returns false.

QVariant EngineConfiguration::toVariant ( ) const

Converts the object into a QVariant.

This makes it easy to serialize EngineConfiguration objects with QJson.

bool EngineConfiguration::whiteEvalPov ( ) const

Returns true if evaluation is from white's point of view.

QString EngineConfiguration::workingDirectory ( ) const

Returns the working directory the engine uses.

See also
setWorkingDirectory()

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