Quick Links: |
#include <bdlb_bitstringimputil.h>
Public Types | |
enum | { k_BITS_PER_UINT64 = 64 } |
Static Public Member Functions | |
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.
See Component bdlb_bitstringimputil
static void bdlb::BitStringImpUtil::andEqBits | ( | bsl::uint64_t * | dstValue, | |
int | dstIndex, | |||
bsl::uint64_t | srcValue, | |||
int | numBits | |||
) | [static] |
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
.
static void bdlb::BitStringImpUtil::andEqWord | ( | bsl::uint64_t * | dstValue, | |
bsl::uint64_t | srcValue | |||
) | [static] |
Assign to the specified *dstValue
the value of *dstValue
bitwise AND-ed with the specified srcValue
.
static void bdlb::BitStringImpUtil::minusEqBits | ( | bsl::uint64_t * | dstValue, | |
int | dstIndex, | |||
bsl::uint64_t | srcValue, | |||
int | numBits | |||
) | [static] |
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
.
static void bdlb::BitStringImpUtil::minusEqWord | ( | bsl::uint64_t * | dstValue, | |
bsl::uint64_t | srcValue | |||
) | [static] |
Assign to the specified *dstValue
the value of *dstValue
bitwise AND-ed with the complement of the specified srcValue
.
static void bdlb::BitStringImpUtil::orEqBits | ( | bsl::uint64_t * | dstValue, | |
int | dstIndex, | |||
bsl::uint64_t | srcValue, | |||
int | numBits | |||
) | [static] |
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
.
static void bdlb::BitStringImpUtil::orEqWord | ( | bsl::uint64_t * | dstValue, | |
bsl::uint64_t | srcValue | |||
) | [static] |
Assign to the specified *dstValue
the value of *dstValue
bitwise OR-ed with the specified srcValue
.
static void bdlb::BitStringImpUtil::setEqBits | ( | bsl::uint64_t * | dstValue, | |
int | dstIndex, | |||
bsl::uint64_t | srcValue, | |||
int | numBits | |||
) | [static] |
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
.
static void bdlb::BitStringImpUtil::setEqWord | ( | bsl::uint64_t * | dstValue, | |
bsl::uint64_t | srcValue | |||
) | [static] |
Assign to the specified *dstValue
the value of the specified srcValue
.
static void bdlb::BitStringImpUtil::xorEqBits | ( | bsl::uint64_t * | dstValue, | |
int | dstIndex, | |||
bsl::uint64_t | srcValue, | |||
int | numBits | |||
) | [static] |
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
.
static void bdlb::BitStringImpUtil::xorEqWord | ( | bsl::uint64_t * | dstValue, | |
bsl::uint64_t | srcValue | |||
) | [static] |
Assign to the specified *dstValue
the value of *dstValue
bitwise XOR-ed with the specified srcValue
.
static int bdlb::BitStringImpUtil::find1AtMaxIndexRaw | ( | bsl::uint64_t | value | ) | [static] |
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.
static int bdlb::BitStringImpUtil::find1AtMinIndexRaw | ( | bsl::uint64_t | value | ) | [static] |
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.