All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Public Types | Public Member Functions | Public Attributes | Private Types | Private Attributes
osl::ntesuki::NtesukiTable Class Reference

A table to hold ntesukiRecord. More...

#include <ntesukiTable.h>

List of all members.

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
NtesukiRecordallocateRoot (const HashKey &key, const PieceStand &white_stand, signed short distance, const NumEffectState *root_state=NULL)
 テーブルをひく.
NtesukiRecordallocateWithMove (NtesukiRecord *record, const NtesukiMove &move)
NtesukiRecordfind (const HashKey &key)
 テーブルの大きさを変化させずに find する.
const NtesukiRecordfind (const HashKey &key) const
void erase (const HashKey key)
 表に登録された要素を削除する.
void collectGarbage (unsigned int gc_size)
 表を整理する.
NtesukiRecordfindWithMove (NtesukiRecord *record, const NtesukiMove &move)
 与えられた
NtesukiRecordfindWithMoveConst (const NtesukiRecord *record, const NtesukiMove &move)
template<class F >
void forEachRecord (F &f)
 テーブルに登録された各 record を F で処理する.
template<class F >
void forEachRecordFromRoot (F &f)
 テーブルを root node から順番に調べる.
unsigned int size () const
 テーブルに登録された record の数.
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< Tabletable
bool verbose

Detailed Description

A table to hold ntesukiRecord.

Definition at line 52 of file ntesukiTable.h.


Member Typedef Documentation

Definition at line 55 of file ntesukiTable.h.

Definition at line 129 of file ntesukiTable.h.

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.

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.

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().

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(), osl::ntesuki::NtesukiTable::Table::erase(), and osl::ntesuki::NtesukiTable::Table::find().

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

Definition at line 209 of file ntesukiTable.h.

References table.

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.

Definition at line 626 of file ntesukiTable.cc.

References verbose.

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.

Definition at line 315 of file ntesukiTable.h.

References table.


Member Data Documentation

Definition at line 131 of file ntesukiTable.h.

boost::scoped_ptr<Table> osl::ntesuki::NtesukiTable::table [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:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines