1+ #pragma once
12#ifndef __FLAGS_H__
23#define __FLAGS_H__
4+ #include " _types.h"
35
46template <class T >
57struct _flags
@@ -13,75 +15,75 @@ struct _flags
1315public:
1416 T flags;
1517
16- IC TYPE get () const { return flags; }
17- IC SelfRef zero ()
18+ TYPE get () const { return flags; }
19+ SelfRef zero ()
1820 {
1921 flags = T (0 );
2022 return *this ;
2123 }
22- IC SelfRef one ()
24+ SelfRef one ()
2325 {
2426 flags = T (-1 );
2527 return *this ;
2628 }
27- IC SelfRef invert ()
29+ SelfRef invert ()
2830 {
2931 flags = ~flags;
3032 return *this ;
3133 }
32- IC SelfRef invert (const Self& f)
34+ SelfRef invert (const Self& f)
3335 {
3436 flags = ~f.flags ;
3537 return *this ;
3638 }
37- IC SelfRef invert (const T mask)
39+ SelfRef invert (const T mask)
3840 {
3941 flags ^= mask;
4042 return *this ;
4143 }
42- IC SelfRef assign (const Self& f)
44+ SelfRef assign (const Self& f)
4345 {
4446 flags = f.flags ;
4547 return *this ;
4648 }
47- IC SelfRef assign (const T mask)
49+ SelfRef assign (const T mask)
4850 {
4951 flags = mask;
5052 return *this ;
5153 }
52- IC SelfRef set (const T mask, BOOL value)
54+ SelfRef set (const T mask, BOOL value)
5355 {
5456 if (value)
5557 flags |= mask;
5658 else
5759 flags &= ~mask;
5860 return *this ;
5961 }
60- IC BOOL is (const T mask) const { return mask == (flags & mask); }
61- IC BOOL is_any (const T mask) const { return BOOL (!!(flags & mask)); }
62- IC BOOL test (const T mask) const { return BOOL (!!(flags & mask)); }
63- IC SelfRef or (const T mask)
62+ BOOL is (const T mask) const { return mask == (flags & mask); }
63+ BOOL is_any (const T mask) const { return BOOL (!!(flags & mask)); }
64+ BOOL test (const T mask) const { return BOOL (!!(flags & mask)); }
65+ SelfRef or (const T mask)
6466 {
6567 flags |= mask;
6668 return *this ;
6769 }
68- IC SelfRef or (const Self& f, const T mask)
70+ SelfRef or (const Self& f, const T mask)
6971 {
7072 flags = f.flags | mask;
7173 return *this ;
7274 }
73- IC SelfRef and (const T mask)
75+ SelfRef and (const T mask)
7476 {
7577 flags &= mask;
7678 return *this ;
7779 }
78- IC SelfRef and (const Self& f, const T mask)
80+ SelfRef and (const Self& f, const T mask)
7981 {
8082 flags = f.flags & mask;
8183 return *this ;
8284 }
83- IC BOOL equal (const Self& f) const { return flags == f.flags ; }
84- IC BOOL equal (const Self& f, const T mask) const { return (flags & mask) == (f.flags & mask); }
85+ BOOL equal (const Self& f) const { return flags == f.flags ; }
86+ BOOL equal (const Self& f, const T mask) const { return (flags & mask) == (f.flags & mask); }
8587};
8688
8789typedef _flags<u8 > Flags8;
0 commit comments