Belofte version 2.1.8
A promising chess program using the UCI or Winboard interface
appInstance Class Referencefinal

Singleton implementation of application. More...

#include <belofte.h>

+ Collaboration diagram for appInstance:

Public Member Functions

 appInstance ()
 
 ~appInstance ()
 
 appInstance (appInstance const &)=delete
 
 appInstance (appInstance &&)=delete
 
appInstanceoperator= (appInstance const &)=delete
 
appInstanceoperator= (appInstance &&)=delete
 
std::string const setMode (std::string const &iName)
 
std::string const & getMode () const
 
void setConfig (std::string const &s, int64_t v)
 
int64_t getConfig (std::string const &s, int64_t v)
 
void setConfig (std::string const &s, std::string const &v)
 
std::string getConfig (std::string const &s, std::string const &v)
 
void setName (char *sName)
 set name of executable based on argv[0] Remove leading / and \ characters Remove trailing .exe if present
 
std::string getName () const
 

Public Attributes

outputWriter bout
 
outputWriter sout
 normal output
 
commandReader m_reader
 searching output
 
bel_hash m_hashEngine
 read input
 
bel_debug m_debuginterface
 
engineInterfacem_ui
 
bGamem_game
 

Detailed Description

Singleton implementation of application.

Definition at line 305 of file belofte.h.

Constructor & Destructor Documentation

◆ appInstance() [1/3]

appInstance::appInstance ( )

Definition at line 395 of file belofte.cpp.

◆ ~appInstance()

appInstance::~appInstance ( )

Definition at line 415 of file belofte.cpp.

◆ appInstance() [2/3]

appInstance::appInstance ( appInstance const &  )
delete

◆ appInstance() [3/3]

appInstance::appInstance ( appInstance &&  )
delete

Member Function Documentation

◆ operator=() [1/2]

appInstance & appInstance::operator= ( appInstance const &  )
delete

◆ operator=() [2/2]

appInstance & appInstance::operator= ( appInstance &&  )
delete

◆ setMode()

std::string const appInstance::setMode ( std::string const &  iName)

Definition at line 425 of file belofte.cpp.

Referenced by cmd_belofte::execute(), cmd_uci::execute(), cmd_xboard::execute(), and main().

+ Here is the caller graph for this function:

◆ getMode()

std::string const & appInstance::getMode ( ) const
inline

Definition at line 318 of file belofte.h.

◆ setConfig() [1/2]

void appInstance::setConfig ( std::string const &  s,
int64_t  v 
)
Remarks
C++17 would allow std::any to combine both we could use a template as well

Definition at line 433 of file belofte.cpp.

Referenced by cmd_random::execute(), cmd_computer::execute(), cmd_UCI_Opponent::execute(), cmd_name::execute(), main(), and setName().

+ Here is the caller graph for this function:

◆ getConfig() [1/2]

int64_t appInstance::getConfig ( std::string const &  s,
int64_t  v 
)

Definition at line 438 of file belofte.cpp.

Referenced by bGame::DoSearch(), cmd_about::execute(), getName(), and bel_debug::info().

+ Here is the caller graph for this function:

◆ setConfig() [2/2]

void appInstance::setConfig ( std::string const &  s,
std::string const &  v 
)

Definition at line 444 of file belofte.cpp.

◆ getConfig() [2/2]

std::string appInstance::getConfig ( std::string const &  s,
std::string const &  v 
)

Definition at line 449 of file belofte.cpp.

◆ setName()

void appInstance::setName ( char *  sName)

set name of executable based on argv[0] Remove leading / and \ characters Remove trailing .exe if present

Definition at line 459 of file belofte.cpp.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getName()

std::string appInstance::getName ( ) const

Definition at line 473 of file belofte.cpp.

Referenced by bel_debug::info().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ bout

◆ sout

◆ m_reader

commandReader appInstance::m_reader

searching output

Definition at line 332 of file belofte.h.

Referenced by cmd_execat::execute(), cmd_exec::execute(), main(), and commandReader::runner().

◆ m_hashEngine

bel_hash appInstance::m_hashEngine

read input

Definition at line 333 of file belofte.h.

Referenced by main().

◆ m_debuginterface

bel_debug appInstance::m_debuginterface

Definition at line 334 of file belofte.h.

Referenced by cmd_debug::execute(), and cmd_info::execute().

◆ m_ui

engineInterface* appInstance::m_ui

Definition at line 335 of file belofte.h.

Referenced by AppEI(), and setMode().

◆ m_game

bGame* appInstance::m_game

Definition at line 336 of file belofte.h.

Referenced by Game().