This utility struct provides a namespace for a set of bit‐level, stateless functions that take one or two int arguments and return masks of the built‐in 32‐ and 64‐bit integer types uint32_t and uint64_t, respectively.

Synopsis

Declared in <bdlb_bitmaskutil.h>

struct BitMaskUtil;

Enums

Name

Description

Unnamed enum

Number of bits in type uint32_t.

Static Member Functions

Name

Description

eq

Return the unsigned integral value having the bit at the specified index position set to 1, and all other bits set to 0. The behavior is undefined unless 0 <= index <= # of bits in result.

eq64

Return the unsigned integral value having the bit at the specified index position set to 1, and all other bits set to 0. The behavior is undefined unless 0 <= index <= # of bits in result.

ge

Return the unsigned integral value having all bits at positions greater than or equal to the specified index set to 1, and all other bits set to 0. The behavior is undefined unless 0 <= index <= # of bits in result.

ge64

Return the unsigned integral value having all bits at positions greater than or equal to the specified index set to 1, and all other bits set to 0. The behavior is undefined unless 0 <= index <= # of bits in result.

gt

Return the unsigned integral value having all bits at positions greater than the specified index set to 1, and all other bits set to 0. The behavior is undefined unless 0 <= index <= # of bits in result.

gt64

Return the unsigned integral value having all bits at positions greater than the specified index set to 1, and all other bits set to 0. The behavior is undefined unless 0 <= index <= # of bits in result.

le

Return the unsigned integral value having all bits at positions less than or equal to the specified index set to 1, and all other bits set to 0. The behavior is undefined unless 0 <= index <= # of bits in result.

le64

Return the unsigned integral value having all bits at positions less than or equal to the specified index set to 1, and all other bits set to 0. The behavior is undefined unless 0 <= index <= # of bits in result.

lt

Return the unsigned integral value having all bits at positions less than the specified index set to 1, and all other bits set to 0.

lt64

Return the unsigned integral value having all bits at positions less than the specified index set to 1, and all other bits set to 0. The behavior is undefined unless 0 <= index <= # of bits in result.

ne

Return a bitmask with the bit at index cleared.

ne64

Return the unsigned integral value having the bit at the specified index position set to 0, and all other bits set to 1. The behavior is undefined unless 0 <= index <= # of bits in result.

one

Return the unsigned integral value having the specified numBits starting at the specified index set to 1, and all other bits set to 0. The behavior is undefined unless 0 <= index, 0 <= numBits, and index + numBits <= # of bits in result.

one64

Return the unsigned integral value having the specified numBits starting at the specified index set to 1, and all other bits set to 0. The behavior is undefined unless 0 <= index, 0 <= numBits, and index + numBits <= # of bits in result.

zero

Return the unsigned integral value having the specified numBits starting at the specified index set to 0, and all other bits set to 1.

zero64

Return the unsigned integral value having the specified numBits starting at the specified index set to 0, and all other bits set to 1. The behavior is undefined unless 0 <= index, 0 <= numBits, and index + numBits <= # of bits in result.

Created with MrDocs