All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Public Types | Public Member Functions | Protected Attributes
osl::container::GeneralSimpleHashTable< Record > Class Template Reference

基本的な hash table とりあえず g++ (SGI STL) の hash_map を使って実装 More...

#include <generalSimpleHashTable.h>

Inheritance diagram for osl::container::GeneralSimpleHashTable< Record >:
Inheritance graph
[legend]

List of all members.

Classes

struct  Table

Public Types

typedef hash::HashKey HashKey

Public Member Functions

 GeneralSimpleHashTable (size_t capacity=100000)
 ~GeneralSimpleHashTable ()
void clear ()
Record * allocate (const HashKey &key)
 表を探し,登録されてなければ新規エントリを登録する
Record * find (const HashKey &key)
 表を探す.新たに登録する事はない
const Record * find (const HashKey &key) const
size_t size () const
size_t capacity () const
int numCacheHit () const
int numRecordAfterFull () const
bool isVerbose () const
int divSize () const
 lock contention を下げるために分割した大きさ

Protected Attributes

boost::scoped_ptr< Tabletable

Detailed Description

template<typename Record>
class osl::container::GeneralSimpleHashTable< Record >

基本的な hash table とりあえず g++ (SGI STL) の hash_map を使って実装

機能:

ある程度基本的な機能を実装したら,自分で実装しなおすほうがbetter。 この hash_map では GCを実装することは困難と思われるため

find, allocate で ポインタを返すため,要素を追加しても,既存の要素の アドレスが変化しないデータ構造を用いる必要がある.

Definition at line 39 of file generalSimpleHashTable.h.


Member Typedef Documentation

template<typename Record>
typedef hash::HashKey osl::container::GeneralSimpleHashTable< Record >::HashKey

Definition at line 45 of file generalSimpleHashTable.h.


Constructor & Destructor Documentation

template<typename Record >
osl::container::GeneralSimpleHashTable< Record >::GeneralSimpleHashTable ( size_t  capacity = 100000) [explicit]
Parameters:
capacity表に保持する最大局面

Definition at line 164 of file generalSimpleHashTable.tcc.

template<typename Record >
osl::container::GeneralSimpleHashTable< Record >::~GeneralSimpleHashTable ( )

Definition at line 171 of file generalSimpleHashTable.tcc.


Member Function Documentation

template<typename Record >
Record * osl::container::GeneralSimpleHashTable< Record >::allocate ( const HashKey key)

表を探し,登録されてなければ新規エントリを登録する

Returns:
テーブルがいっぱい。 そうでなければ内部で確保した場所へのポインタ (間違っても delete しないこと)
Exceptions:
TableFull

Definition at line 184 of file generalSimpleHashTable.tcc.

References osl::container::GeneralSimpleHashTable< Record >::allocate().

Referenced by osl::container::GeneralSimpleHashTable< Record >::allocate().

template<typename Record >
size_t osl::container::GeneralSimpleHashTable< Record >::capacity ( ) const
template<typename Record >
void osl::container::GeneralSimpleHashTable< Record >::clear ( )
template<typename Record >
int osl::container::GeneralSimpleHashTable< Record >::divSize ( ) const

lock contention を下げるために分割した大きさ

Reimplemented in osl::search::SimpleHashTable.

Definition at line 235 of file generalSimpleHashTable.tcc.

template<typename Record >
Record * osl::container::GeneralSimpleHashTable< Record >::find ( const HashKey key)

表を探す.新たに登録する事はない

Returns:
存在しなければ0 そうでなければ内部で確保した場所へのポインタ (間違っても delete しないこと)

Definition at line 192 of file generalSimpleHashTable.tcc.

Referenced by osl::search::AlphaBeta2< EvalT >::alphaBetaSearchRoot(), osl::search::AlphaBeta2< EvalT >::computeBestMoveIteratively(), osl::container::GeneralSimpleHashTable< Record >::Table::findInLock(), qsearch(), search(), and osl::search::AlphaBeta2Tree< EvalT >::showPV().

template<typename Record >
const Record * osl::container::GeneralSimpleHashTable< Record >::find ( const HashKey key) const

Definition at line 200 of file generalSimpleHashTable.tcc.

template<typename Record>
bool osl::container::GeneralSimpleHashTable< Record >::isVerbose ( ) const

Reimplemented in osl::search::SimpleHashTable.

template<typename Record >
int osl::container::GeneralSimpleHashTable< Record >::numCacheHit ( ) const

Definition at line 221 of file generalSimpleHashTable.tcc.

template<typename Record >
int osl::container::GeneralSimpleHashTable< Record >::numRecordAfterFull ( ) const

Definition at line 228 of file generalSimpleHashTable.tcc.

template<typename Record >
size_t osl::container::GeneralSimpleHashTable< Record >::size ( ) const

Member Data Documentation

template<typename Record>
boost::scoped_ptr<Table> osl::container::GeneralSimpleHashTable< Record >::table [protected]

Definition at line 42 of file generalSimpleHashTable.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines