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 
9 namespace 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:
20  ~BookInMemory();
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:
osl::book::BookInMemory::~BookInMemory
~BookInMemory()
Definition: bookInMemory.cc:17
osl::book::BookInMemory
Definition: bookInMemory.h:15
osl::book::BookInMemory::instance
static const BookInMemory & instance(const std::string &filename="")
Definition: bookInMemory.cc:77
osl::hash::HashKey
Definition: hashKey.h:153
osl::book::BookInMemory::table
table_t table
Definition: bookInMemory.h:18
osl::book::BookInMemory::table_t
std::unordered_map< HashKey, moves_t, std::hash< HashKey > > table_t
Definition: bookInMemory.h:17
osl::book::BookInMemory::readRecursive
int readRecursive(const HashKey &key, int index, WeightedBook &book, int, int)
Definition: bookInMemory.cc:22
osl::book::BookInMemory::BookInMemory
BookInMemory(const std::string &filename)
Definition: bookInMemory.cc:11
osl::book::BookInMemory::find
void find(const HashKey &key, MoveVector &out) const
Definition: bookInMemory.cc:65
osl::book::BookInMemory::readAll
void readAll(const std::string &filename)
Definition: bookInMemory.cc:56
hashKey.h
osl::book::BookInMemory::size
size_t size() const
Definition: bookInMemory.h:23
osl::book::WeightedBook
StateとWMoveを保持する.
Definition: openingBook.h:169
osl::book::BookInMemory::moves_t
CArray< Move, 8 > moves_t
Definition: bookInMemory.h:16
osl::MoveVector
Definition: container.h:293
osl::CArray
Definition: container.h:20
osl
Definition: additionalEffect.h:6