Cute Chess  0.1
Public Member Functions | Protected Member Functions | List of all members
PolyglotBook Class Reference

Opening book which uses the Polyglot book format. More...

#include <polyglotbook.h>

Inheritance diagram for PolyglotBook:
OpeningBook

Public Member Functions

 PolyglotBook (AccessMode mode=Ram)
 
- Public Member Functions inherited from OpeningBook
QList< Entryentries (quint64 key) const
 
int import (const PgnGame &pgn, int maxMoves)
 
int import (PgnStream &in, int maxMoves)
 
Chess::GenericMove move (quint64 key) const
 
 OpeningBook (AccessMode mode=Ram)
 
bool read (const QString &filename)
 
bool write (const QString &filename) const
 
virtual ~OpeningBook ()
 

Protected Member Functions

virtual int entrySize () const
 
virtual Entry readEntry (QDataStream &in, quint64 *key) const
 
virtual void writeEntry (const Map::const_iterator &it, QDataStream &out) const
 
- Protected Member Functions inherited from OpeningBook
void addEntry (const Entry &entry, quint64 key)
 

Additional Inherited Members

- Public Types inherited from OpeningBook
enum  AccessMode { Ram, Disk }
 
- Protected Types inherited from OpeningBook
typedef QMultiMap< quint64, EntryMap
 

Detailed Description

Opening book which uses the Polyglot book format.

The Polyglot opening book format is used by chess engines like Fruit, Toga, and Glaurung, and of course the UCI to Xboard adapter Polyglot.

Specs: http://alpha.uhasselt.be/Research/Algebra/Toga/book_format.html

Constructor & Destructor Documentation

PolyglotBook::PolyglotBook ( AccessMode  mode = Ram)

Creates a new PolyglotBook with access mode mode.

Member Function Documentation

int PolyglotBook::entrySize ( ) const
protectedvirtual

Returns the book format's internal entry size in bytes.

Implements OpeningBook.

OpeningBook::Entry PolyglotBook::readEntry ( QDataStream in,
quint64 *  key 
) const
protectedvirtual

Reads a new book entry from in and returns it.

The implementation must set key to the hash that belongs to the entry.

Implements OpeningBook.

void PolyglotBook::writeEntry ( const Map::const_iterator &  it,
QDataStream out 
) const
protectedvirtual

Writes the key and entry pointed to by it, to out.

Implements OpeningBook.


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