effectedNumTable.h
Go to the documentation of this file.
1 #ifndef _EFFECTED_NUM_TABLE_H
2 #define _EFFECTED_NUM_TABLE_H
3 #include "osl/simpleState.h"
4 #include <iosfwd>
5 namespace osl
6 {
7  namespace effect
8  {
9  union Byte8 {
10  unsigned long long lv;
12  }
13 #ifdef __GNUC__
14  __attribute__((aligned(8)))
15 #endif
16  ;
24  {
25  private:
27  public:
28  EffectedNum() { clear(); }
29  void clear(){
30 #define E(n) ((static_cast<unsigned long long>(EMPTY_NUM)<<((n)*8)))
31  b8.lv= E(0)|E(1)|E(2)|E(3)|E(4)|E(5)|E(6)|E(7);
32 #undef E
33  }
34  int operator[](Direction d) const{
35  assert(0<=d && d<=7);
36  return b8.uc[d];
37  }
38  unsigned char& operator[](Direction d){
39  assert(0<=d && d<=7);
40  return b8.uc[d];
41  }
42  };
44  {
45  CArray<EffectedNum,40> contents
46 #ifdef __GNUC__
47  __attribute__((aligned(16)))
48 #endif
49  ;
50  public:
51  EffectedNumTable() { clear(); }
53  const EffectedNum& operator[](int i) const {
54  return contents[i];
55  }
56  void clear();
58  return contents[i];
59  }
60  };
61  bool operator==(const EffectedNumTable&,const EffectedNumTable&);
62  std::ostream& operator<<(std::ostream&,const EffectedNumTable&);
63  }
65 }
66 
67 #endif // _EFFECTED_NUM_TABLE_H
68 // ;;; Local Variables:
69 // ;;; mode:c++
70 // ;;; c-basic-offset:2
71 // ;;; End:
std::ostream & operator<<(std::ostream &, const EffectedNumTable &)
const EffectedNum & operator[](int i) const
const PtypeO PTYPEO_EDGE __attribute__((unused))
bool operator==(const EffectedNumTable &, const EffectedNumTable &)
unsigned char & operator[](Direction d)
#define E(n)
盤面上の駒が「黒から見た」方向に長い利きをつけられている時に, 利きをつけている駒の番号を得る たとえ...
unsigned long long lv
int operator[](Direction d) const
EffectedNum & operator[](int i)
Direction
Definition: basic_type.h:310
CArray< unsigned char, 8 > uc