BloombergLP::bdlb::NullableAllocatedValue_PointerBitsPair

This is a component-private class. Do not use.

Synopsis

Declared in <bdlb_nullableallocatedvalue_pointerbitspair.h>

template<
    class t_TYPE,
    unsigned int t_NUM_BITS>
class NullableAllocatedValue_PointerBitsPair;

Description

This regular, value-semantic class provides a mechanism for storing a number of bit flags in the otherwise unused bits of a pointer to the template parameter class t_TYPE. The number of bits that can be stored is dependent upon the required alignment of the class t_TYPE.

Member Functions

NameDescription
NullableAllocatedValue_PointerBitsPair [constructor]Constructors
clearFlag Clear the flag specified by idx. The behavior is undefined unless idx < t_NUM_BITS.
equal Return true if this object and the specified other have the same value, and false otherwise. Two NullableAllocatedValue_PointerBitsPair objects have the same value when their pointer and flags are the same.
getPointer Return the held pointer.
readFlag Return the value of the flag specified by idx. The behavior is undefined unless idx < t_NUM_BITS.
setFlag Set the flag specified by idx. The behavior is undefined unless idx < t_NUM_BITS.
setPointer Set the held pointer to the value of the specified new_ptr.
swap Efficiently exchange the value of this object with the value of the specified other object. This method provides the no-throw exception-safety guarantee.

Non-Member Functions

NameDescription
operator!=Return false if the specified lhs and rhs objects have the same value, and true otherwise. Two NullableAllocatedValue_PointerBitsPair objects have the same value when their pointer and flags are the same.
operator==Return true if the specified lhs and rhs objects have the same value, and false otherwise. Two NullableAllocatedValue_PointerBitsPair objects have the same value when their pointer and flags are the same.
swapExchange the values of the specified a and b objects. This function provides the no-throw exception-safety guarantee.