osl::hash::GeneralBoardKey< Integer, SIZE > Class Template 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
Public Types | Public Member Functions | Private Attributes | List of all members
osl::hash::GeneralBoardKey< Integer, SIZE > Class Template Reference

手番を含んだ盤面の状態のハッシュ値を保持するためのクラス. More...

`#include <boardKey.h>`

Collaboration diagram for osl::hash::GeneralBoardKey< Integer, SIZE >:
[legend]

## Public Types
typedef Integer | int_t

## Public Member Functions
| GeneralBoardKey ()
| GeneralBoardKey (const GeneralBoardKey &src)
size_t | size () const
int_t | operator[] (size_t i) const
int_t & | operator[] (size_t i)
unsigned int | signature () const
GeneralBoardKey & | operator+= (const GeneralBoardKey &r)
| メモリ破壊を検出するためにrのplayer bitが0であることを確認 More...
GeneralBoardKey & | operator-= (const GeneralBoardKey &r)
| メモリ破壊を検出するためにrのplayer bitが0であることを確認 More...
void | changeTurn ()
void | setPlayer (Player p)
| 元々 whiteの時もblackにsetできるようにする More...
bool | playerBit () const
bool | isPlayerOfTurn (Player p) const
Player | turn () const
void | setRandom ()
| elements[0]の最下位ビットは0にする More...

## Private Attributes
CArray< Integer, SIZE > | elements

## Detailed Description

### template<typename Integer, size_t SIZE>
class osl::hash::GeneralBoardKey< Integer, SIZE >

手番を含んだ盤面の状態のハッシュ値を保持するためのクラス.

- 64bit プロセッサでは unsigned long long, 2 (衝突がなければ1も)
- 32bit プロセッサでは unsigned int, 4 を想定.

elements[0] の最下位bit をplayer bit とする．

Definition at line 23 of file boardKey.h.

## Member Typedef Documentation

template<typename Integer, size_t SIZE>

typedef Integer osl::hash::GeneralBoardKey< Integer, SIZE >::int_t

Definition at line 33 of file boardKey.h.

## Constructor & Destructor Documentation

template<typename T , size_t SIZE>

osl::hash::GeneralBoardKey< T, SIZE >::GeneralBoardKey | ( | ) |  |

Definition at line 10 of file boardKey.tcc.

template<typename Integer, size_t SIZE>

osl::hash::GeneralBoardKey< Integer, SIZE >::GeneralBoardKey | ( | const GeneralBoardKey< Integer, SIZE > & | src) |  |
| inline

Definition at line 28 of file boardKey.h.

References osl::hash::GeneralBoardKey< Integer, SIZE >::elements.

## Member Function Documentation

template<typename Integer, size_t SIZE>

void osl::hash::GeneralBoardKey< Integer, SIZE >::changeTurn | ( | ) |  |
| inline

Definition at line 62 of file boardKey.h.

References osl::hash::GeneralBoardKey< Integer, SIZE >::elements.

template<typename Integer, size_t SIZE>

bool osl::hash::GeneralBoardKey< Integer, SIZE >::isPlayerOfTurn | ( | Player | p) |  | const
| inline

Definition at line 77 of file boardKey.h.

References osl::hash::GeneralBoardKey< Integer, SIZE >::playerBit(), and osl::playerToIndex().

Referenced by osl::hash::GeneralBoardKey< Integer, SIZE >::turn().

template<typename Integer, size_t SIZE>

GeneralBoardKey& osl::hash::GeneralBoardKey< Integer, SIZE >::operator+= | ( | const GeneralBoardKey< Integer, SIZE > & | r) |  |
| inline

メモリ破壊を検出するためにrのplayer bitが0であることを確認

Definition at line 45 of file boardKey.h.

References osl::hash::GeneralBoardKey< Integer, SIZE >::elements, and osl::hash::GeneralBoardKey< Integer, SIZE >::playerBit().

template<typename Integer, size_t SIZE>

GeneralBoardKey& osl::hash::GeneralBoardKey< Integer, SIZE >::operator-= | ( | const GeneralBoardKey< Integer, SIZE > & | r) |  |
| inline

メモリ破壊を検出するためにrのplayer bitが0であることを確認

Definition at line 55 of file boardKey.h.

References osl::hash::GeneralBoardKey< Integer, SIZE >::elements, and osl::hash::GeneralBoardKey< Integer, SIZE >::playerBit().

template<typename Integer, size_t SIZE>

int_t osl::hash::GeneralBoardKey< Integer, SIZE >::operator[] | ( | size_t | i) |  | const
| inline

Definition at line 35 of file boardKey.h.

References osl::hash::GeneralBoardKey< Integer, SIZE >::elements.

template<typename Integer, size_t SIZE>

int_t& osl::hash::GeneralBoardKey< Integer, SIZE >::operator[] | ( | size_t | i) |  |
| inline

Definition at line 38 of file boardKey.h.

References osl::hash::GeneralBoardKey< Integer, SIZE >::elements.

template<typename Integer, size_t SIZE>

bool osl::hash::GeneralBoardKey< Integer, SIZE >::playerBit | ( | ) |  | const
| inline

Definition at line 73 of file boardKey.h.

References osl::hash::GeneralBoardKey< Integer, SIZE >::elements.

Referenced by osl::hash::GeneralBoardKey< Integer, SIZE >::isPlayerOfTurn(), osl::hash::GeneralBoardKey< Integer, SIZE >::operator+=(), and osl::hash::GeneralBoardKey< Integer, SIZE >::operator-=().

template<typename Integer, size_t SIZE>

void osl::hash::GeneralBoardKey< Integer, SIZE >::setPlayer | ( | Player | p) |  |
| inline

元々 whiteの時もblackにsetできるようにする

Definition at line 69 of file boardKey.h.

References osl::hash::GeneralBoardKey< Integer, SIZE >::elements, and osl::playerToIndex().

template<typename T , size_t SIZE>

void osl::hash::GeneralBoardKey< T, SIZE >::setRandom | ( | ) |  |

elements[0]の最下位ビットは0にする

Definition at line 16 of file boardKey.tcc.

template<typename Integer, size_t SIZE>

unsigned int osl::hash::GeneralBoardKey< Integer, SIZE >::signature | ( | ) |  | const
| inline

Definition at line 41 of file boardKey.h.

References osl::hash::GeneralBoardKey< Integer, SIZE >::elements.

template<typename Integer, size_t SIZE>

size_t osl::hash::GeneralBoardKey< Integer, SIZE >::size | ( | ) |  | const
| inline

Definition at line 34 of file boardKey.h.

template<typename Integer, size_t SIZE>

Player osl::hash::GeneralBoardKey< Integer, SIZE >::turn | ( | ) |  | const
| inline

Definition at line 81 of file boardKey.h.

References osl::BLACK, osl::hash::GeneralBoardKey< Integer, SIZE >::isPlayerOfTurn(), and osl::WHITE.

## Member Data Documentation

template<typename Integer, size_t SIZE>

CArray<Integer,SIZE> osl::hash::GeneralBoardKey< Integer, SIZE >::elements
| private

Definition at line 25 of file boardKey.h.

Referenced by osl::hash::GeneralBoardKey< Integer, SIZE >::changeTurn(), osl::hash::GeneralBoardKey< Integer, SIZE >::GeneralBoardKey(), osl::hash::GeneralBoardKey< Integer, SIZE >::operator+=(), osl::hash::GeneralBoardKey< Integer, SIZE >::operator-=(), osl::hash::GeneralBoardKey< Integer, SIZE >::operator[](), osl::hash::GeneralBoardKey< Integer, SIZE >::playerBit(), osl::hash::GeneralBoardKey< Integer, SIZE >::setPlayer(), and osl::hash::GeneralBoardKey< Integer, SIZE >::signature().

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

- boardKey.h
- boardKey.tcc