osl::ntesuki::NtesukiTable Class Reference

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Public Types | Public Member Functions | Public Attributes | Private Types | Private Attributes | List of all members
osl::ntesuki::NtesukiTable Class Reference

A table to hold ntesukiRecord. More...

`#include <ntesukiTable.h>`

## Classes
struct | HashPathEncoding
class | Table

## Public Types
typedef NtesukiRecord | record_t
typedef hash_set< PathEncoding, HashPathEncoding > | PathSet

## Public Member Functions
| NtesukiTable (unsigned int capacity, unsigned int default_gc_size=0, bool verbose=false)
| ~NtesukiTable ()
void | clear ()
Table::const_iterator | begin () const
Table::const_iterator | end () const
NtesukiRecord * | allocateRoot (const HashKey &key, const PieceStand &white_stand, signed short distance, const NumEffectState *root_state=NULL)
| テーブルをひく. More...
NtesukiRecord * | allocateWithMove (NtesukiRecord *record, const NtesukiMove &move)
NtesukiRecord * | find (const HashKey &key)
| テーブルの大きさを変化させずに find する. More...
const NtesukiRecord * | find (const HashKey &key) const
void | erase (const HashKey key)
| 表に登録された要素を削除する. More...
void | collectGarbage (unsigned int gc_size)
| 表を整理する. More...
NtesukiRecord * | findWithMove (NtesukiRecord *record, const NtesukiMove &move)
| 与えられた More...
NtesukiRecord * | findWithMoveConst (const NtesukiRecord *record, const NtesukiMove &move)
template<class F >
void | forEachRecord (F &f)
| テーブルに登録された各 record を F で処理する. More...
template<class F >
void | forEachRecordFromRoot (F &f)
| テーブルを root node から順番に調べる. More...
unsigned int | size () const
| テーブルに登録された record の数. More...
unsigned int | capacity () const
void | lockGC ()
void | unlockGC ()
bool | isVerbose () const

## Public Attributes
std::vector< int > | depths

## Private Types
typedef hash_map< SignatureKey, NtesukiRecord::RecordList > | ntesuki_hash_map

## Private Attributes
boost::scoped_ptr< Table > | table
bool | verbose

## Detailed Description

A table to hold ntesukiRecord.

Definition at line 52 of file ntesukiTable.h.

## Member Typedef Documentation

typedef hash_map<SignatureKey, NtesukiRecord::RecordList> osl::ntesuki::NtesukiTable::ntesuki_hash_map
| private

Definition at line 55 of file ntesukiTable.h.

typedef hash_set<PathEncoding, HashPathEncoding> osl::ntesuki::NtesukiTable::PathSet

Definition at line 129 of file ntesukiTable.h.

typedef NtesukiRecord osl::ntesuki::NtesukiTable::record_t

Definition at line 120 of file ntesukiTable.h.

## Constructor & Destructor Documentation

osl::ntesuki::NtesukiTable::NtesukiTable | ( | unsigned int | capacity,
|  | unsigned int | default_gc_size = `0`,
|  | bool | verbose = `false`
| ) |  |

Parameters

  capacity | 表に保持する最大局面

Definition at line 578 of file ntesukiTable.cc.

osl::ntesuki::NtesukiTable::~NtesukiTable | ( | ) |  |

Definition at line 587 of file ntesukiTable.cc.

References depth, osl::ntesuki::NtesukiRecord::distance, and verbose.

## Member Function Documentation

NtesukiRecord* osl::ntesuki::NtesukiTable::allocateRoot | ( | const HashKey & | key,
|  | const PieceStand & | white_stand,
|  | signed short | distance,
|  | const NumEffectState * | root_state = `NULL`
| ) |  |
| inline

テーブルをひく.

もし要素が見つからなかった場合， テーブルの大きさを増やして良いのなら， 新しい要素を allocate する.

Definition at line 160 of file ntesukiTable.h.

References table.

NtesukiRecord* osl::ntesuki::NtesukiTable::allocateWithMove | ( | NtesukiRecord * | record,
|  | const NtesukiMove & | move
| ) |  |
| inline

Definition at line 173 of file ntesukiTable.h.

References osl::PieceStand::add(), osl::Move::capturePtype(), osl::ntesuki::NtesukiRecord::checkNewParent(), osl::ntesuki::NtesukiRecord::distance, osl::ntesuki::NtesukiMove::getMove(), osl::Move::isDrop(), osl::ntesuki::NtesukiMove::isPass(), osl::ntesuki::NtesukiRecord::key, osl::eval::min(), osl::Move::player(), osl::Move::ptype(), osl::PTYPE_EMPTY, osl::PieceStand::sub(), table, osl::unpromote(), and osl::ntesuki::NtesukiRecord::white_stand.

Table::const_iterator osl::ntesuki::NtesukiTable::begin | ( | ) |  | const
| inline

Definition at line 146 of file ntesukiTable.h.

References table.

Referenced by osl::ntesuki::NtesukiTable::Table::collectGarbage().

unsigned int osl::ntesuki::NtesukiTable::capacity | ( | ) |  | const
| inline

Definition at line 305 of file ntesukiTable.h.

References table.

Referenced by osl::ntesuki::NtesukiTable::Table::allocate().

void osl::ntesuki::NtesukiTable::clear | ( | ) |  |
| inline

Definition at line 141 of file ntesukiTable.h.

References table.

void osl::ntesuki::NtesukiTable::collectGarbage | ( | unsigned int | gc_size) |  |
| inline

表を整理する.

Definition at line 225 of file ntesukiTable.h.

References table.

Referenced by osl::ntesuki::NtesukiTable::Table::allocate().

Table::const_iterator osl::ntesuki::NtesukiTable::end | ( | ) |  | const
| inline

Definition at line 150 of file ntesukiTable.h.

References table.

Referenced by osl::ntesuki::NtesukiTable::Table::collectGarbage().

void osl::ntesuki::NtesukiTable::erase | ( | const HashKey | key) |  |
| inline

表に登録された要素を削除する.

Definition at line 217 of file ntesukiTable.h.

References table.

Referenced by osl::ntesuki::NtesukiTable::Table::collectGarbage().

NtesukiRecord* osl::ntesuki::NtesukiTable::find | ( | const HashKey & | key) |  |
| inline

テーブルの大きさを変化させずに find する.

Definition at line 204 of file ntesukiTable.h.

References table.

Referenced by osl::ntesuki::NtesukiTable::Table::allocate().

const NtesukiRecord* osl::ntesuki::NtesukiTable::find | ( | const HashKey & | key) |  | const
| inline

Definition at line 209 of file ntesukiTable.h.

References table.

NtesukiRecord* osl::ntesuki::NtesukiTable::findWithMove | ( | NtesukiRecord * | record,
|  | const NtesukiMove & | move
| ) |  |
| inline

与えられた

Parameters

  move | に格納されている手を返そうとする. なかったらテーブルから引く.

Definition at line 234 of file ntesukiTable.h.

References osl::ntesuki::NtesukiRecord::checkNewParent(), osl::ntesuki::NtesukiMove::getMove(), osl::ntesuki::NtesukiRecord::getPieceStandSlow(), osl::ntesuki::NtesukiMove::isDrop(), osl::ntesuki::NtesukiMove::isNormal(), osl::ntesuki::NtesukiRecord::key, osl::Move::player(), osl::Move::ptype(), table, and osl::unpromote().

NtesukiRecord* osl::ntesuki::NtesukiTable::findWithMoveConst | ( | const NtesukiRecord * | record,
|  | const NtesukiMove & | move
| ) |  |
| inline

Definition at line 260 of file ntesukiTable.h.

References osl::ntesuki::NtesukiMove::getMove(), osl::ntesuki::NtesukiRecord::getPieceStandSlow(), osl::ntesuki::NtesukiMove::isDrop(), osl::ntesuki::NtesukiMove::isNormal(), osl::ntesuki::NtesukiRecord::key, osl::Move::player(), osl::Move::ptype(), table, and osl::unpromote().

template<class F >

void osl::ntesuki::NtesukiTable::forEachRecord | ( | F & | f) |  |
| inline

テーブルに登録された各 record を F で処理する.

Definition at line 284 of file ntesukiTable.h.

References table.

template<class F >

void osl::ntesuki::NtesukiTable::forEachRecordFromRoot | ( | F & | f) |  |
| inline

テーブルを root node から順番に調べる.

Definition at line 292 of file ntesukiTable.h.

References table.

bool osl::ntesuki::NtesukiTable::isVerbose | ( | ) |  | const

Definition at line 626 of file ntesukiTable.cc.

References verbose.

void osl::ntesuki::NtesukiTable::lockGC | ( | ) |  |
| inline

Definition at line 310 of file ntesukiTable.h.

References table.

unsigned int osl::ntesuki::NtesukiTable::size | ( | ) |  | const
| inline

テーブルに登録された record の数.

Definition at line 300 of file ntesukiTable.h.

References table.

void osl::ntesuki::NtesukiTable::unlockGC | ( | ) |  |
| inline

Definition at line 315 of file ntesukiTable.h.

References table.

## Member Data Documentation

std::vector<int> osl::ntesuki::NtesukiTable::depths

Definition at line 131 of file ntesukiTable.h.

boost::scoped_ptr<Table> osl::ntesuki::NtesukiTable::table
| private

Definition at line 116 of file ntesukiTable.h.

Referenced by allocateRoot(), allocateWithMove(), begin(), capacity(), clear(), collectGarbage(), end(), erase(), find(), findWithMove(), findWithMoveConst(), forEachRecord(), forEachRecordFromRoot(), lockGC(), RecordPrinter::operator()(), RecordPrinter2::operator()(), size(), and unlockGC().

bool osl::ntesuki::NtesukiTable::verbose
| private

Definition at line 117 of file ntesukiTable.h.

Referenced by osl::ntesuki::NtesukiTable::Table::collectGarbage().

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

- ntesukiTable.h
- ntesukiTable.cc