Return true if the specified anchor is well‐formed for the specified hasher. Use the specified allocator for temporary memory, or the default allocator if none is specified. For a HashTableAnchor to be considered well‐formed for a particular key policy, KEY_CONFIG, and hash functor, hasher, all of the following must be true:
Synopsis
Declared in <bslalg_hashtableimputil.h>
template<
class KEY_CONFIG,
class HASHER>
static
bool
isWellFormed(
HashTableAnchor const& anchor,
HASHER const& hasher,
bslma::Allocator* allocator = 0);
Description
1. The anchor.listRootAddress() is the address of a well‐formed doubly linked list (see bslalg_bidirectionallinklistutil). 2. Links in the doubly linked list having the same adjusted hash value are contiguous, where the adjusted hash value is the value returned by computeBucketIndex, for extractKey<KEY_CONFIG>(link) and anchor.bucketArraySize(). 3. Links in the doubly linked list having the same hash value are contiguous. 4. The first and last links in each bucket (in the bucket array, anchor.bucketArrayAddress()') refer to a the first and last element in the well‐formed doubly linked list of all nodes in the list having an adjusted hash value equal to that bucket's array index. If no values in the doubly linked list have an adjusted hash value equal to a bucket's index, then the addresses of the first and last links for that bucket are 0.
Created with MrDocs