BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlc::FlatHashTable_ImplUtil Struct Reference

#include <bdlc_flathashtable.h>

Static Public Member Functions

template<class ENTRY_TYPE >
static void copyEntryAndControlArrays (ENTRY_TYPE *firstDestinationEntry, bsl::uint8_t *firstDestinationControl, const ENTRY_TYPE *firstSourceEntry, const ENTRY_TYPE *lastSourceEntry, const bsl::uint8_t *firstSourceControl, const bsl::uint8_t *lastSourceControl, bslma::Allocator *entryAllocator)
 
template<class ENTRY_TYPE >
static void destroyEntryArray (ENTRY_TYPE *firstEntry, ENTRY_TYPE *lastEntry, const bsl::uint8_t *firstControl, const bsl::uint8_t *lastControl)
 

Detailed Description

This component-private, utility struct provides a namespace for a suite of operations used in the implementation of the FlatHashTable class template.

Member Function Documentation

◆ copyEntryAndControlArrays()

template<class ENTRY_TYPE >
void bdlc::FlatHashTable_ImplUtil::copyEntryAndControlArrays ( ENTRY_TYPE *  firstDestinationEntry,
bsl::uint8_t *  firstDestinationControl,
const ENTRY_TYPE *  firstSourceEntry,
const ENTRY_TYPE *  lastSourceEntry,
const bsl::uint8_t *  firstSourceControl,
const bsl::uint8_t *  lastSourceControl,
bslma::Allocator entryAllocator 
)
inlinestatic

Copy the specified range [firstSourceControl, lastSourceControl) to the array specified by firstDestinationControl, and copy each element in the specified range [firstSourceEntry, lastSourceEntry) at the same index as each byte in the range '[firstSourceControl, lastSourceControl)' that has its most-significant bit unset, to the corresponding location in the contiguous storage for ENTRY_TYPE objects specified by firstDestinationEntry. Use the specified entryAllocator as the object allocator for each newly-constructed ENTRY_TYPE object if ENTRY_TYPE is allocator-aware. If entryAllocator is 0, the currently-installed default allocator is used. No exception is thrown if the specified ENTRY_TYPE is nothrow-copyable, otherwise an exception may be thrown. The behavior is undefined unless firstDestinationEntry is a pointer to the first byte of uninitialized and correctly aligned storage for at least bsl::distance(firstSourceEntry, lastSourceEntry) ENTRY_TYPE objects, firstDestinationControl is a pointer to the first byte of bsl::distance(firstSourceEntry, lastSourceEntry) bytes of uninitialized storage, the range '[firstSourceEntry, lastSourceEntry)' denotes a contiguous array of storage for optionally-constructed ENTRY_TYPE objects, the range [firstSourceControl, lastSourceControl) denotes a contiguous array of bsl::uint8_t objects, an ENTRY_TYPE object exists at the same index in the [firstSourceEntry, lastSourceEntry) storage range as each byte in the range [firstControlEntry, lastControlEntry) that has its most significant bit unset, and bsl::distance(firstSourceEntry, lastSourceEntry) is equal to bsl::distance(firstSourceControl, lastSourceControl).

◆ destroyEntryArray()

template<class ENTRY_TYPE >
void bdlc::FlatHashTable_ImplUtil::destroyEntryArray ( ENTRY_TYPE *  firstEntry,
ENTRY_TYPE *  lastEntry,
const bsl::uint8_t *  firstControl,
const bsl::uint8_t *  lastControl 
)
inlinestatic

Destroy each entry object in the storage specified by the range [firstEntry, lastEntry) if the most-significant bit is unset in the corresponding element in the specified range '[firstControl, lastControl)' (i.e., the most-significant bit of the element in the "control" array that has the same index as the element in the "entry" array is unset). No exception is thrown. The behavior is undefined unless the range [firstEntry, lastEntry) denotes a contiguous array of storage for optionally-constructed ENTRY_TYPE objects, the range [firstControl, lastControl) denotes a contiguous array of bsl::uint8_t objects, the two arrays have the same number of elements, and an ENTRY_TYPE object exists at the same index in the [firstEntry, lastEntry) storage range for each element in the [firstControl, lastControl) range that has its first bit unset.

Implementation Note


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