Quick Links:

bal | bbl | bdl | bsl

Classes | Static Public Member Functions

bdlc::FlatHashTable_ImplUtil Struct Reference

#include <bdlc_flathashtable.h>

List of all members.

Classes

class  DestroyEntryArrayProctor

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.

See Component bdlc_flathashtable


Member Function Documentation

template<class ENTRY_TYPE >
static 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 
) [static]

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).

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

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.


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