Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
include
osl
effect
effectedNumTable.h
Go to the documentation of this file.
1
#ifndef _EFFECTED_NUM_TABLE_H
2
#define _EFFECTED_NUM_TABLE_H
3
#include "
osl/state/simpleState.h
"
4
#include <iosfwd>
5
namespace
osl
6
{
7
namespace
effect
8
{
9
union
Byte8
{
10
unsigned
long
long
lv
;
11
CArray<unsigned char,8>
uc
;
12
}
13
#ifdef __GNUC__
14
__attribute__
((aligned(8)))
15
#endif
16
;
23
class
EffectedNum
24
{
25
private
:
26
Byte8
b8
;
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
};
43
class
EffectedNumTable
44
{
45
CArray<EffectedNum,40>
contents
46
#ifdef __GNUC__
47
__attribute__
((aligned(16)))
48
#endif
49
;
50
public
:
51
EffectedNumTable
() {
clear
(); }
52
EffectedNumTable
(SimpleState
const
&);
53
const
EffectedNum
&
operator[]
(
int
i)
const
{
54
return
contents
[i];
55
}
56
void
clear
();
57
EffectedNum
&
operator[]
(
int
i){
58
return
contents
[i];
59
}
60
};
61
bool
operator==
(
const
EffectedNumTable&,
const
EffectedNumTable&);
62
std::ostream&
operator<<
(std::ostream&,
const
EffectedNumTable&);
63
}
64
using
effect::EffectedNumTable;
65
}
66
67
#endif // _EFFECTED_NUM_TABLE_H
68
// ;;; Local Variables:
69
// ;;; mode:c++
70
// ;;; c-basic-offset:2
71
// ;;; End:
Generated on Sun Jul 21 2013 13:37:24 by
1.8.4