RigsofRods
Soft-body Physics Simulation
|
Bit operations. More...
#include <cstdint>
Go to the source code of this file.
Macros | |
#define | BITMASK(OFFSET) ( 1 << ((OFFSET) - 1) ) |
#define | BITMASK64(OFFSET) ( BitMask64_t(1) << BitMask64_t((OFFSET) - 1) ) |
#define | BITMASK_IS_0(VAR, FLAGS) ( ((VAR) & (FLAGS)) == 0 ) |
#define | BITMASK_IS_1(VAR, FLAGS) ( ((VAR) & (FLAGS)) == (FLAGS) ) |
#define | BITMASK_SET_0(VAR, FLAGS) ( (VAR) &= ~ (FLAGS) ) |
#define | BITMASK_SET_1(VAR, FLAGS) ( (VAR) |= (FLAGS) ) |
#define | BITMASK_PROPERTY_GET(VAR, BIT_INDEX, FLAG_NAME, GETTER_NAME) |
Defines a bitmask constant with given bit index (1-indexed) and a getter function. More... | |
Typedefs | |
typedef uint32_t | BitMask_t |
typedef uint64_t | BitMask64_t |
Functions | |
void | BITMASK_SET (BitMask_t &mask, BitMask_t flag, bool val) |
Bit operations.
Definition in file BitFlags.h.
#define BITMASK | ( | OFFSET | ) | ( 1 << ((OFFSET) - 1) ) |
Definition at line 10 of file BitFlags.h.
#define BITMASK64 | ( | OFFSET | ) | ( BitMask64_t(1) << BitMask64_t((OFFSET) - 1) ) |
Definition at line 11 of file BitFlags.h.
#define BITMASK_IS_0 | ( | VAR, | |
FLAGS | |||
) | ( ((VAR) & (FLAGS)) == 0 ) |
Definition at line 13 of file BitFlags.h.
#define BITMASK_IS_1 | ( | VAR, | |
FLAGS | |||
) | ( ((VAR) & (FLAGS)) == (FLAGS) ) |
Definition at line 14 of file BitFlags.h.
#define BITMASK_PROPERTY_GET | ( | VAR, | |
BIT_INDEX, | |||
FLAG_NAME, | |||
GETTER_NAME | |||
) |
Defines a bitmask constant with given bit index (1-indexed) and a getter function.
Definition at line 28 of file BitFlags.h.
#define BITMASK_SET_0 | ( | VAR, | |
FLAGS | |||
) | ( (VAR) &= ~ (FLAGS) ) |
Definition at line 16 of file BitFlags.h.
#define BITMASK_SET_1 | ( | VAR, | |
FLAGS | |||
) | ( (VAR) |= (FLAGS) ) |
Definition at line 17 of file BitFlags.h.
typedef uint64_t BitMask64_t |
Definition at line 8 of file BitFlags.h.
typedef uint32_t BitMask_t |
Definition at line 7 of file BitFlags.h.