Bitmask ...
More...
Go to the source code of this file.
|
function mod | createBitMask (size) |
| Create a Bitmask The mask is internally built from blocks of 64bit integers. More...
|
|
function mod | linkToArray (bitmasks) |
|
function mg_bitMask | setN (n) |
| sets the first n bits in a bitmask to 1 other bits remain unchanged More...
|
|
function mg_bitMask | clearAll () |
| sets all bits in a bitmask to 0
|
|
function mg_bitMask | setAll () |
| sets all bits in a bitmask to 1
|
|
function mg_bitMask | __index (x) |
| Index metamethod for mg_bitMask. More...
|
|
function mg_bitMask | __newindex (x, y) |
| Newindex metamethod for mg_bitMask. More...
|
|
function mod | band (mask1, mask2, result) |
| Bitwise and. More...
|
|
function mod | bor (mask1, mask2, result) |
| Bitwise or. More...
|
|
function mod | bxor (mask1, mask2, result) |
| Bitwise xor. More...
|
|
function mod | bnot (mask, result) |
| Bitwise not. More...
|
|
Bitmask ...
- Todo:
- TODO docu
Definition in file bitmask.lua.
function mg_bitMask __index |
( |
x |
| ) |
|
Index metamethod for mg_bitMask.
- Parameters
-
x | Bit index. Index starts at 1 according to the LUA standard (1 indexes the first bit in the bitmask) |
- Returns
- For numeric indices: true, when corresponding bit is 1, false otherwise.
function mg_bitMask __newindex |
( |
x |
, |
|
|
y |
|
|
) |
| |
Newindex metamethod for mg_bitMask.
- Parameters
-
x | Bit index. Index starts at 1 according to the LUA standard (1 indexes the first bit in the bitmask) |
function mod band |
( |
mask1 |
, |
|
|
mask2 |
, |
|
|
result |
|
|
) |
| |
Bitwise and.
- Parameters
-
mask1 | |
mask2 | |
result | result = mask1 band mask2 |
function mod bnot |
( |
mask |
, |
|
|
result |
|
|
) |
| |
Bitwise not.
- Parameters
-
mask | |
result | result = not mask |
function mod bor |
( |
mask1 |
, |
|
|
mask2 |
, |
|
|
result |
|
|
) |
| |
Bitwise or.
- Parameters
-
mask1 | |
mask2 | |
result | result = mask1 bor mask2 |
function mod bxor |
( |
mask1 |
, |
|
|
mask2 |
, |
|
|
result |
|
|
) |
| |
Bitwise xor.
- Parameters
-
mask1 | |
mask2 | |
result | result = bask1 bxor mask2 |
function mod createBitMask |
( |
size |
| ) |
|
Create a Bitmask The mask is internally built from blocks of 64bit integers.
Hence a Bitmask of a size <<64 yields significant overhead
- Parameters
-
size | Size of the bitmask in number of bits |
- Returns
- Wrapper table around the bitmask
function mod linkToArray |
( |
bitmasks |
| ) |
|
- Parameters
-
- Todo:
- TODO: think of a better solution - meh
function mg_bitMask setN |
( |
n |
| ) |
|
sets the first n bits in a bitmask to 1 other bits remain unchanged
- Parameters
-