1 typedef unsigned int uint32_t;
4 eMaskingOperatorDefault
= 0,
5 eMaskingOperatorAnd
= 1,
6 eMaskingOperatorOr
= 2,
7 eMaskingOperatorXor
= 3,
8 eMaskingOperatorNand
= 4,
9 eMaskingOperatorNor
= 5
19 MaskedData(uint32_t V
= 0, uint32_t M
= 0,
20 MaskingOperator P
= eMaskingOperatorDefault
)
21 : value(V
), mask(M
), oper(P
) {}
25 case eMaskingOperatorAnd
:
27 case eMaskingOperatorOr
:
29 case eMaskingOperatorXor
:
31 case eMaskingOperatorNand
:
32 return ~(value
& mask
);
33 case eMaskingOperatorNor
:
34 return ~(value
| mask
);
35 case eMaskingOperatorDefault
: // fall through
41 void setValue(uint32_t V
) { value
= V
; }
43 void setMask(uint32_t M
) { mask
= M
; }
45 void setOperator(MaskingOperator P
) { oper
= P
; }
49 MaskedData
data_1(0xFF0F, 0xA01F, eMaskingOperatorAnd
);
50 MaskedData
data_2(data_1
.apply(), 0x1AFC, eMaskingOperatorXor
);
51 MaskedData
data_3(data_2
.apply(), 0xFFCF, eMaskingOperatorOr
);
52 MaskedData
data_4(data_3
.apply(), 0xAABC, eMaskingOperatorAnd
);
53 MaskedData
data_5(data_4
.apply(), 0xFFAC, eMaskingOperatorNor
);
54 MaskedData
data_6(data_5
.apply(), 0x0000BEEF, eMaskingOperatorAnd
);
55 return data_6
.apply(); // <-- what comes out of here?