駒番号のビットセット. More...
#include <pieceMask.h>
Public Member Functions | |
PieceMask () | |
PieceMask (const PieceMaskBase &base) | |
void | setMask (int index, mask_t val) |
void | xorMask (int index, mask_t val) |
void | orMask (int index, mask_t val) |
bool | test (int num) const |
void | set (int num) |
void | flip (int num) |
void | reset (int num) |
bool | any () const |
const mask_t | getMask (int num) const |
template<Ptype PTYPE> | |
const mask_t | getMask () const |
unpromote(PTYPE) の駒のbit を*含む*mask_tを取り出す | |
template<Ptype PTYPE> | |
const mask_t | selectBit () const |
unpromote(PTYPE) の駒のbit だけ取り出す | |
template<Ptype PTYPE> | |
void | clearBit () |
unpromote(PTYPE) の駒のbit を消す | |
template<Ptype PTYPE> | |
void | setBit () |
unpromote(PTYPE) の駒のbit を立てる | |
Static Public Member Functions | |
static const mask_t | numToMask (int num) |
Private Member Functions | |
mask_t & | mutableMaskNum (int num) |
const mask_t | getMaskNum (int num) const |
駒番号のビットセット.
64bitのMask64を一つもしくは,32bitのMask32を2枚で表現する. 各メソッドの変数名は num は駒番号に, index はマスクのID(0-1)に用いられている.
Definition at line 31 of file pieceMask.h.
osl::container::PieceMask::PieceMask | ( | ) | [inline] |
Definition at line 34 of file pieceMask.h.
osl::container::PieceMask::PieceMask | ( | const PieceMaskBase & | base | ) | [inline] |
Definition at line 35 of file pieceMask.h.
bool osl::container::PieceMask::any | ( | ) | const [inline] |
Definition at line 68 of file pieceMask.h.
void osl::container::PieceMask::clearBit | ( | ) | [inline] |
unpromote(PTYPE) の駒のbit を消す
Definition at line 85 of file pieceMask.h.
void osl::container::PieceMask::flip | ( | int | num | ) | [inline] |
Definition at line 62 of file pieceMask.h.
References mutableMaskNum(), and numToMask().
const mask_t osl::container::PieceMask::getMask | ( | int | num | ) | const [inline] |
Definition at line 70 of file pieceMask.h.
References getMask().
Referenced by osl::container::operator&(), osl::container::operator<<(), osl::container::operator==(), osl::container::operator|(), and osl::container::operator~().
const mask_t osl::container::PieceMask::getMask | ( | ) | const [inline] |
unpromote(PTYPE) の駒のbit を*含む*mask_tを取り出す
Definition at line 73 of file pieceMask.h.
References getMask().
Referenced by getMask(), and getMaskNum().
const mask_t osl::container::PieceMask::getMaskNum | ( | int | num | ) | const [inline, private] |
mask_t& osl::container::PieceMask::mutableMaskNum | ( | int | num | ) | [inline, private] |
Definition at line 43 of file pieceMask.h.
static const mask_t osl::container::PieceMask::numToMask | ( | int | num | ) | [inline, static] |
void osl::container::PieceMask::orMask | ( | int | index, |
mask_t | val | ||
) | [inline] |
Definition at line 53 of file pieceMask.h.
void osl::container::PieceMask::reset | ( | int | num | ) | [inline] |
Definition at line 65 of file pieceMask.h.
References mutableMaskNum(), and numToMask().
const mask_t osl::container::PieceMask::selectBit | ( | ) | const [inline] |
unpromote(PTYPE) の駒のbit だけ取り出す
Definition at line 77 of file pieceMask.h.
void osl::container::PieceMask::set | ( | int | num | ) | [inline] |
Definition at line 59 of file pieceMask.h.
References mutableMaskNum(), and numToMask().
void osl::container::PieceMask::setBit | ( | ) | [inline] |
unpromote(PTYPE) の駒のbit を立てる
Definition at line 92 of file pieceMask.h.
void osl::container::PieceMask::setMask | ( | int | index, |
mask_t | val | ||
) | [inline] |
Definition at line 39 of file pieceMask.h.
bool osl::container::PieceMask::test | ( | int | num | ) | const [inline] |
Definition at line 56 of file pieceMask.h.
References getMaskNum(), and numToMask().
void osl::container::PieceMask::xorMask | ( | int | index, |
mask_t | val | ||
) | [inline] |
Definition at line 50 of file pieceMask.h.