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
 
NtesukiRecordallocateRoot (const HashKey &key, const PieceStand &white_stand, signed short distance, const NumEffectState *root_state=NULL)
 テーブルをひく. More...
 
NtesukiRecordallocateWithMove (NtesukiRecord *record, const NtesukiMove &move)
 
NtesukiRecordfind (const HashKey &key)
 テーブルの大きさを変化させずに find する. More...
 
const NtesukiRecordfind (const HashKey &key) const
 
void erase (const HashKey key)
 表に登録された要素を削除する. More...
 
void collectGarbage (unsigned int gc_size)
 表を整理する. More...
 
NtesukiRecordfindWithMove (NtesukiRecord *record, const NtesukiMove &move)
 与えられた More...
 
NtesukiRecordfindWithMoveConst (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< 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.

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
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
NtesukiRecord* osl::ntesuki::NtesukiTable::findWithMoveConst ( const NtesukiRecord record,
const NtesukiMove move 
)
inline
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
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: