BloombergLP::bslstl::BoyerMooreHorspoolSearcher::BoyerMooreHorspoolSearcher

Create a searcher for the needle [needleFirst, needleLast)].

Synopsis

Declared in <bslstl_boyermoorehorspoolsearcher.h>

BoyerMooreHorspoolSearcher(
    RNDACC_ITR_NEEDLE needleFirst,
    RNDACC_ITR_NEEDLE needleLast,
    HASH hash = HASH(),
    EQUAL equal = EQUAL(),
    BloombergLP::bslma::Allocator* basicAllocator = 0);

Description

Generate meta-data and save for use by operator(). The complexity of this process is O(M) where M is the length of the "needle". Optionally specify a hash functor mapping mis-matched values to the size of the next step in the search -- as large as, needleLast - needleFirst. Optionally specify an equal functor for use with hash and for use by operator(). See {Requirements for HASH and EQUAL}. Optionally specify basicAllocator to supply memory. If basicAllocator is 0 or not supplied, the currently installed default allocator is used. The behavior is undefined unless needleFirst can be advanced to needleLast.

Parameters

NameDescription
needleFirstbeginning of the needle sequence
needleLastend of the needle sequence
hashhash functor used to compute mismatch skip distances
equalequality comparison functor for hash and search
basicAllocatormemory allocator; null uses the default