Database of hex positions handling rotations. More...
#include <StateDB.hpp>
Classes | |
struct | Statistics |
Public Member Functions | |
StateDB (const std::string &filename, const std::string &type) | |
Opens database, creates it if it does not exist. | |
~StateDB () | |
Closes database. | |
bool | Exists (const HexState &pos) const |
Returns true if position exists in database. | |
bool | Get (const HexState &pos, T &data) const |
Returns true if get is successful. | |
bool | Put (const HexState &brd, const T &data) |
Returns true if put is successful. | |
void | Flush () |
Statistics | GetStatistics () const |
std::string | BDBStatistics () |
Private Member Functions | |
BOOST_CLASS_REQUIRE (T, benzene, StateDBStateConcept) | |
Private Attributes | |
HashDB< T > | m_db |
Statistics | m_stats |
Database of hex positions handling rotations.
Definition at line 65 of file StateDB.hpp.
StateDB< T >::StateDB | ( | const std::string & | filename, | |
const std::string & | type | |||
) | [inline] |
Opens database, creates it if it does not exist.
Definition at line 114 of file StateDB.hpp.
Closes database.
Definition at line 121 of file StateDB.hpp.
std::string StateDB< T >::BDBStatistics | ( | ) | [inline] |
Definition at line 196 of file StateDB.hpp.
References StateDB< T >::m_db.
StateDB< T >::BOOST_CLASS_REQUIRE | ( | T | , | |
benzene | , | |||
StateDBStateConcept | ||||
) | [private] |
Returns true if position exists in database.
Definition at line 126 of file StateDB.hpp.
References _BEGIN_BENZENE_NAMESPACE_::GetHash(), and StateDB< T >::m_db.
void StateDB< T >::Flush | ( | ) | [inline] |
Definition at line 162 of file StateDB.hpp.
References StateDB< T >::m_db.
Referenced by BookBuilder< PLAYER >::FlushBook(), and BookUtil::ImportSolvedStates().
Returns true if get is successful.
Definition at line 132 of file StateDB.hpp.
References StoneBoard::Const(), _BEGIN_BENZENE_NAMESPACE_::GetHash(), hash_t, StateDB< T >::m_db, StateDB< T >::Statistics::m_gets, StateDB< T >::Statistics::m_hits, StateDB< T >::Statistics::m_rotations, StateDB< T >::m_stats, _BEGIN_BENZENE_NAMESPACE_::NeedToRotate(), and HexState::Position().
Referenced by BookUtil::BestMove(), BookUtil::DumpVisualizationData(), BookUtil::GetMainLineDepth(), BookBuilder< PLAYER >::GetNode(), and BookUtil::ImportSolvedStates().
StateDB< T >::Statistics StateDB< T >::GetStatistics | ( | ) | const [inline] |
Definition at line 169 of file StateDB.hpp.
References StateDB< T >::m_stats.
Referenced by DfsSolver::DumpStats(), and DfpnSolver::PrintStatistics().
Returns true if put is successful.
Definition at line 148 of file StateDB.hpp.
References StoneBoard::Const(), _BEGIN_BENZENE_NAMESPACE_::GetHash(), hash_t, StateDB< T >::m_db, StateDB< T >::Statistics::m_puts, StateDB< T >::Statistics::m_rotations, StateDB< T >::m_stats, _BEGIN_BENZENE_NAMESPACE_::NeedToRotate(), and HexState::Position().
Referenced by BookUtil::ImportSolvedStates(), and BookBuilder< PLAYER >::WriteNode().
Definition at line 108 of file StateDB.hpp.
Referenced by StateDB< T >::BDBStatistics(), StateDB< T >::Exists(), StateDB< T >::Flush(), StateDB< T >::Get(), and StateDB< T >::Put().
Statistics StateDB< T >::m_stats [mutable, private] |
Definition at line 110 of file StateDB.hpp.
Referenced by StateDB< T >::Get(), StateDB< T >::GetStatistics(), and StateDB< T >::Put().