bookInMemory.h
Go to the documentation of this file.
/* bookInMemory.h
*/
#ifndef OSL_BOOKINMEMORY_H
#define OSL_BOOKINMEMORY_H
#include "osl/hashKey.h"
#include <unordered_map>
#include <string>
namespace osl
{
namespace book
{
class WeightedBook;
class BookInMemory
{
typedef CArray<Move,8> moves_t;
typedef std::unordered_map<HashKey,moves_t,std::hash<HashKey>> table_t;
table_t table;
public:
~BookInMemory();
void find(const HashKey& key, MoveVector& out) const;
size_t size() const { return table.size(); }
static const BookInMemory& instance(const std::string& filename="");
private:
explicit BookInMemory(const std::string& filename);
void readAll(const std::string& filename);
int readRecursive(const HashKey& key, int index, WeightedBook& book, int, int);
};
}
using book::BookInMemory;
}
#endif /* OSL_BOOKINMEMORY_H */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
osl::CArray
Definition container.h:20
osl::MoveVector
Definition container.h:293
osl::book::BookInMemory
Definition bookInMemory.h:15
osl::book::BookInMemory::~BookInMemory
~BookInMemory()
Definition bookInMemory.cc:17
osl::book::BookInMemory::moves_t
CArray< Move, 8 > moves_t
Definition bookInMemory.h:16
osl::book::BookInMemory::table
table_t table
Definition bookInMemory.h:18
osl::book::BookInMemory::readRecursive
int readRecursive(const HashKey &key, int index, WeightedBook &book, int, int)
Definition bookInMemory.cc:22
osl::book::BookInMemory::instance
static const BookInMemory & instance(const std::string &filename="")
Definition bookInMemory.cc:77
osl::book::BookInMemory::size
size_t size() const
Definition bookInMemory.h:23
osl::book::BookInMemory::table_t
std::unordered_map< HashKey, moves_t, std::hash< HashKey > > table_t
Definition bookInMemory.h:17
osl::book::BookInMemory::readAll
void readAll(const std::string &filename)
Definition bookInMemory.cc:56
osl::book::BookInMemory::find
void find(const HashKey &key, MoveVector &out) const
Definition bookInMemory.cc:65
osl::book::BookInMemory::BookInMemory
BookInMemory(const std::string &filename)
Definition bookInMemory.cc:11
osl::book::WeightedBook
StateとWMoveを保持する.
Definition openingBook.h:169
osl::hash::HashKey
Definition hashKey.h:153
hashKey.h
osl::book
Definition bookInMemory.h:12
osl
Definition additionalEffect.h:6