Quick Links:

bal | bbl | bdl | bsl

Public Types | Static Public Member Functions

bdlb::BitMaskUtil Struct Reference

#include <bdlb_bitmaskutil.h>

List of all members.

Public Types

enum  { k_BITS_PER_UINT32 = 32, k_BITS_PER_UINT64 = 64 }

Static Public Member Functions

static bsl::uint32_t eq (int index)
static bsl::uint64_t eq64 (int index)
static bsl::uint32_t ge (int index)
static bsl::uint64_t ge64 (int index)
static bsl::uint32_t gt (int index)
static bsl::uint64_t gt64 (int index)
static bsl::uint32_t le (int index)
static bsl::uint64_t le64 (int index)
static bsl::uint32_t lt (int index)
static bsl::uint64_t lt64 (int index)
static bsl::uint32_t ne (int index)
static bsl::uint64_t ne64 (int index)
static bsl::uint32_t one (int index, int numBits)
static bsl::uint64_t one64 (int index, int numBits)
static bsl::uint32_t zero (int index, int numBits)
static bsl::uint64_t zero64 (int index, int numBits)

Detailed Description

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.

See Component bdlb_bitmaskutil


Member Enumeration Documentation

anonymous enum
Enumerator:
k_BITS_PER_UINT32 

number of bits in type uint32_t

k_BITS_PER_UINT64 

number of bits in type uint64_t


Member Function Documentation

static bsl::uint32_t bdlb::BitMaskUtil::eq ( int  index  )  [static]
static bsl::uint64_t bdlb::BitMaskUtil::eq64 ( int  index  )  [static]

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.

static bsl::uint32_t bdlb::BitMaskUtil::ge ( int  index  )  [static]
static bsl::uint64_t bdlb::BitMaskUtil::ge64 ( int  index  )  [static]

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.

static bsl::uint32_t bdlb::BitMaskUtil::gt ( int  index  )  [static]
static bsl::uint64_t bdlb::BitMaskUtil::gt64 ( int  index  )  [static]

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.

static bsl::uint32_t bdlb::BitMaskUtil::le ( int  index  )  [static]
static bsl::uint64_t bdlb::BitMaskUtil::le64 ( int  index  )  [static]

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.

static bsl::uint32_t bdlb::BitMaskUtil::lt ( int  index  )  [static]
static bsl::uint64_t bdlb::BitMaskUtil::lt64 ( int  index  )  [static]

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.

static bsl::uint32_t bdlb::BitMaskUtil::ne ( int  index  )  [static]
static bsl::uint64_t bdlb::BitMaskUtil::ne64 ( int  index  )  [static]

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.

static bsl::uint32_t bdlb::BitMaskUtil::one ( int  index,
int  numBits 
) [static]
static bsl::uint64_t bdlb::BitMaskUtil::one64 ( int  index,
int  numBits 
) [static]

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.

static bsl::uint32_t bdlb::BitMaskUtil::zero ( int  index,
int  numBits 
) [static]
static bsl::uint64_t bdlb::BitMaskUtil::zero64 ( int  index,
int  numBits 
) [static]

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.


The documentation for this struct was generated from the following file: