Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

StateDB< T > Class Template Reference

Database of hex positions handling rotations. More...

#include <StateDB.hpp>

List of all members.

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

Detailed Description

template<class T>
class StateDB< T >

Database of hex positions handling rotations.

Definition at line 65 of file StateDB.hpp.


Constructor & Destructor Documentation

template<class T >
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.

template<class T >
StateDB< T >::~StateDB (  )  [inline]

Closes database.

Definition at line 121 of file StateDB.hpp.


Member Function Documentation

template<class T >
std::string StateDB< T >::BDBStatistics (  )  [inline]

Definition at line 196 of file StateDB.hpp.

References StateDB< T >::m_db.

template<class T>
StateDB< T >::BOOST_CLASS_REQUIRE ( ,
benzene  ,
StateDBStateConcept   
) [private]
template<class T >
bool StateDB< T >::Exists ( const HexState pos  )  const [inline]

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.

template<class T >
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().

template<class T>
bool StateDB< T >::Get ( const HexState pos,
T &  data 
) const [inline]
template<class T >
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().

template<class T>
bool StateDB< T >::Put ( const HexState brd,
const T &  data 
) [inline]

Member Data Documentation

template<class T>
HashDB<T> StateDB< T >::m_db [private]
template<class T>
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().


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


6 Jan 2011 Doxygen 1.6.3