#include <bdlb_bitstringimputil.h>
|
static void | andEqBits (bsl::uint64_t *dstValue, int dstIndex, bsl::uint64_t srcValue, int numBits) |
|
static void | andEqWord (bsl::uint64_t *dstValue, bsl::uint64_t srcValue) |
|
static void | minusEqBits (bsl::uint64_t *dstValue, int dstIndex, bsl::uint64_t srcValue, int numBits) |
|
static void | minusEqWord (bsl::uint64_t *dstValue, bsl::uint64_t srcValue) |
|
static void | orEqBits (bsl::uint64_t *dstValue, int dstIndex, bsl::uint64_t srcValue, int numBits) |
|
static void | orEqWord (bsl::uint64_t *dstValue, bsl::uint64_t srcValue) |
|
static void | setEqBits (bsl::uint64_t *dstValue, int dstIndex, bsl::uint64_t srcValue, int numBits) |
|
static void | setEqWord (bsl::uint64_t *dstValue, bsl::uint64_t srcValue) |
|
static void | xorEqBits (bsl::uint64_t *dstValue, int dstIndex, bsl::uint64_t srcValue, int numBits) |
|
static void | xorEqWord (bsl::uint64_t *dstValue, bsl::uint64_t srcValue) |
|
static int | find1AtMaxIndexRaw (bsl::uint64_t value) |
|
static int | find1AtMinIndexRaw (bsl::uint64_t value) |
|
This struct
provides a namespace for static functions to be used solely in the implementation of BitStringUtil
. The "Manipulators" are intended to be provided as arguments to templates in bdlb_bitstringutil , whereas the "Accessors" are to be called directly within that component.
◆ anonymous enum
Enumerator |
---|
k_BITS_PER_UINT64 | |
◆ andEqBits()
void bdlb::BitStringImpUtil::andEqBits |
( |
bsl::uint64_t * |
dstValue, |
|
|
int |
dstIndex, |
|
|
bsl::uint64_t |
srcValue, |
|
|
int |
numBits |
|
) |
| |
|
inlinestatic |
Bitwise AND the specified least-significant numBits
in the specified srcValue
to those in the specified dstValue
starting at the specified dstIndex
. The behavior is undefined unless 0 <= dstIndex
, 0 <= numBits
, and dstIndex + numBits <= k_BITS_PER_UINT64
.
◆ andEqWord()
void bdlb::BitStringImpUtil::andEqWord |
( |
bsl::uint64_t * |
dstValue, |
|
|
bsl::uint64_t |
srcValue |
|
) |
| |
|
inlinestatic |
Assign to the specified *dstValue
the value of *dstValue
bitwise AND-ed with the specified srcValue
.
◆ find1AtMaxIndexRaw()
int bdlb::BitStringImpUtil::find1AtMaxIndexRaw |
( |
bsl::uint64_t |
value | ) |
|
|
inlinestatic |
Return the index of the highest-order set bit in the specified non-zero value
. The behavior is undefined unless 0 != value
. Note that this method is "raw" due to the requirement that at least one bit in value
must be set.
◆ find1AtMinIndexRaw()
int bdlb::BitStringImpUtil::find1AtMinIndexRaw |
( |
bsl::uint64_t |
value | ) |
|
|
inlinestatic |
Return the index of the lowest-order set bit in the specified non-zero value
. The behavior is undefined unless 0 != value
. Note that this method is "raw" due to the requirement that at least one bit in value
must be set.
◆ minusEqBits()
void bdlb::BitStringImpUtil::minusEqBits |
( |
bsl::uint64_t * |
dstValue, |
|
|
int |
dstIndex, |
|
|
bsl::uint64_t |
srcValue, |
|
|
int |
numBits |
|
) |
| |
|
inlinestatic |
Bitwise MINUS the specified least-significant numBits
in the specified srcValue
from those in the specified dstValue
starting at the specified dstIndex
. The behavior is undefined unless 0 <= dstIndex
, 0 <= numBits
, and dstIndex + numBits <= k_BITS_PER_UINT64
. Note that the bitwise difference, a - b
, is defined in C++ code as a & ~b
.
◆ minusEqWord()
void bdlb::BitStringImpUtil::minusEqWord |
( |
bsl::uint64_t * |
dstValue, |
|
|
bsl::uint64_t |
srcValue |
|
) |
| |
|
inlinestatic |
Assign to the specified *dstValue
the value of *dstValue
bitwise AND-ed with the complement of the specified srcValue
.
◆ orEqBits()
void bdlb::BitStringImpUtil::orEqBits |
( |
bsl::uint64_t * |
dstValue, |
|
|
int |
dstIndex, |
|
|
bsl::uint64_t |
srcValue, |
|
|
int |
numBits |
|
) |
| |
|
inlinestatic |
Bitwise OR the specified least-significant numBits
in the specified srcValue
to those in the specified dstValue
starting at the specified dstIndex
. The behavior is undefined unless 0 <= dstIndex
, 0 <= numBits
, and dstIndex + numBits <= k_BITS_PER_UINT64
.
◆ orEqWord()
void bdlb::BitStringImpUtil::orEqWord |
( |
bsl::uint64_t * |
dstValue, |
|
|
bsl::uint64_t |
srcValue |
|
) |
| |
|
inlinestatic |
Assign to the specified *dstValue
the value of *dstValue
bitwise OR-ed with the specified srcValue
.
◆ setEqBits()
void bdlb::BitStringImpUtil::setEqBits |
( |
bsl::uint64_t * |
dstValue, |
|
|
int |
dstIndex, |
|
|
bsl::uint64_t |
srcValue, |
|
|
int |
numBits |
|
) |
| |
|
inlinestatic |
Replace the specified numBits
in the specified dstValue
starting at the specified dstIndex
with the least-significant numBits
of the specified srcValue
. The behavior is undefined unless 0 <= dstIndex
, 0 <= numBits
, and dstIndex + numBits <= k_BITS_PER_UINT64
.
◆ setEqWord()
void bdlb::BitStringImpUtil::setEqWord |
( |
bsl::uint64_t * |
dstValue, |
|
|
bsl::uint64_t |
srcValue |
|
) |
| |
|
inlinestatic |
Assign to the specified *dstValue
the value of the specified srcValue
.
◆ xorEqBits()
void bdlb::BitStringImpUtil::xorEqBits |
( |
bsl::uint64_t * |
dstValue, |
|
|
int |
dstIndex, |
|
|
bsl::uint64_t |
srcValue, |
|
|
int |
numBits |
|
) |
| |
|
inlinestatic |
Bitwise XOR the specified least-significant numBits
in the specified srcValue
to those in the specified dstValue
starting at the specified dstIndex
. The behavior is undefined unless 0 <= dstIndex
, 0 <= numBits
, and dstIndex + numBits <= k_BITS_PER_UINT64
.
◆ xorEqWord()
void bdlb::BitStringImpUtil::xorEqWord |
( |
bsl::uint64_t * |
dstValue, |
|
|
bsl::uint64_t |
srcValue |
|
) |
| |
|
inlinestatic |
Assign to the specified *dstValue
the value of *dstValue
bitwise XOR-ed with the specified srcValue
.
The documentation for this struct was generated from the following file: