My Project
bookInMemory.h
Go to the documentation of this file.
1/* bookInMemory.h
2 */
3#ifndef OSL_BOOKINMEMORY_H
4#define OSL_BOOKINMEMORY_H
5#include "osl/hashKey.h"
6#include <unordered_map>
7#include <string>
8
9namespace osl
10{
11 namespace book
12 {
13 class WeightedBook;
15 {
17 typedef std::unordered_map<HashKey,moves_t,std::hash<HashKey>> table_t;
19 public:
21
22 void find(const HashKey& key, MoveVector& out) const;
23 size_t size() const { return table.size(); }
24 static const BookInMemory& instance(const std::string& filename="");
25 private:
26 explicit BookInMemory(const std::string& filename);
27 void readAll(const std::string& filename);
28 int readRecursive(const HashKey& key, int index, WeightedBook& book, int, int);
29 };
30 }
31 using book::BookInMemory;
32}
33
34#endif /* OSL_BOOKINMEMORY_H */
35// ;;; Local Variables:
36// ;;; mode:c++
37// ;;; c-basic-offset:2
38// ;;; End:
CArray< Move, 8 > moves_t
int readRecursive(const HashKey &key, int index, WeightedBook &book, int, int)
static const BookInMemory & instance(const std::string &filename="")
std::unordered_map< HashKey, moves_t, std::hash< HashKey > > table_t
void readAll(const std::string &filename)
void find(const HashKey &key, MoveVector &out) const
StateとWMoveを保持する.