Quick Links:

bal | bbl | bdl | bsl

Public Member Functions

bsl::boyer_moore_horspool_searcher< RandomAccessIterator1, Hash, BinaryPredicate > Class Template Reference

#include <bslstl_boyermoorehorspoolsearcher.h>

List of all members.

Public Member Functions

 boyer_moore_horspool_searcher (RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last, Hash hf=Hash(), BinaryPredicate pred=BinaryPredicate())
 boyer_moore_horspool_searcher (const boyer_moore_horspool_searcher &original)
 boyer_moore_horspool_searcher (BloombergLP::bslmf::MovableRef< boyer_moore_horspool_searcher > original)
 ~boyer_moore_horspool_searcher ()
boyer_moore_horspool_searcheroperator= (const boyer_moore_horspool_searcher &rhs)
boyer_moore_horspool_searcheroperator= (BloombergLP::bslmf::MovableRef< boyer_moore_horspool_searcher > rhs)
template<class RandomAccessIterator2 >
pair< RandomAccessIterator2,
RandomAccessIterator2 > 
operator() (RandomAccessIterator2 first, RandomAccessIterator2 last) const

Detailed Description

template<class RandomAccessIterator1, class Hash = hash< typename iterator_traits<RandomAccessIterator1>::value_type>, class BinaryPredicate = equal_to< typename iterator_traits<RandomAccessIterator1>::value_type>>
class bsl::boyer_moore_horspool_searcher< RandomAccessIterator1, Hash, BinaryPredicate >

This class template implements an STL-compliant searcher object that uses the Boyer, Moore, Horspool Algorithm.

See Component bslstl_boyermoorehorspoolsearcher


Constructor & Destructor Documentation

template<class RandomAccessIterator1, class Hash = hash< typename iterator_traits<RandomAccessIterator1>::value_type>, class BinaryPredicate = equal_to< typename iterator_traits<RandomAccessIterator1>::value_type>>
bsl::boyer_moore_horspool_searcher< RandomAccessIterator1, Hash, BinaryPredicate >::boyer_moore_horspool_searcher ( RandomAccessIterator1  pat_first,
RandomAccessIterator1  pat_last,
Hash  hf = Hash(),
BinaryPredicate  pred = BinaryPredicate() 
)

Create a boyer_moore_horspool_searcher object that can search for the sequence of value_type values found in the specified range [pat_first, pat_last). Generate meta-data and save for use by operator(). The complexity of this process is O(M) where M is pat_last - pat_first. Optionally specify hf, a hash functor, that maps mis-matched values to the size of the next step in the search -- as large as, pat_Last - pat_First. Optionally specify pred, an equality comparison functor for use with hash and for use by operator(). See Requirements for HASH and EQUAL. The behavior is undefined unless pat_First can be advanced to pat_Last.

template<class RandomAccessIterator1, class Hash = hash< typename iterator_traits<RandomAccessIterator1>::value_type>, class BinaryPredicate = equal_to< typename iterator_traits<RandomAccessIterator1>::value_type>>
bsl::boyer_moore_horspool_searcher< RandomAccessIterator1, Hash, BinaryPredicate >::boyer_moore_horspool_searcher ( const boyer_moore_horspool_searcher< RandomAccessIterator1, Hash, BinaryPredicate > &  original  ) 

Create a boyer_moore_horspool_searcher object having same state as the specified original object.

template<class RandomAccessIterator1, class Hash = hash< typename iterator_traits<RandomAccessIterator1>::value_type>, class BinaryPredicate = equal_to< typename iterator_traits<RandomAccessIterator1>::value_type>>
bsl::boyer_moore_horspool_searcher< RandomAccessIterator1, Hash, BinaryPredicate >::boyer_moore_horspool_searcher ( BloombergLP::bslmf::MovableRef< boyer_moore_horspool_searcher< RandomAccessIterator1, Hash, BinaryPredicate > >  original  ) 

Create a boyer_moore_horspool_searcher object having same state as the specified original object by moving (in constant time) the state of original to the new searcher. The original object is left in an unspecified (valid) state.

template<class RandomAccessIterator1, class Hash = hash< typename iterator_traits<RandomAccessIterator1>::value_type>, class BinaryPredicate = equal_to< typename iterator_traits<RandomAccessIterator1>::value_type>>
bsl::boyer_moore_horspool_searcher< RandomAccessIterator1, Hash, BinaryPredicate >::~boyer_moore_horspool_searcher (  ) 

Destroy this boyer_moore_horspool_searcher object.


Member Function Documentation

template<class RandomAccessIterator1, class Hash = hash< typename iterator_traits<RandomAccessIterator1>::value_type>, class BinaryPredicate = equal_to< typename iterator_traits<RandomAccessIterator1>::value_type>>
boyer_moore_horspool_searcher& bsl::boyer_moore_horspool_searcher< RandomAccessIterator1, Hash, BinaryPredicate >::operator= ( const boyer_moore_horspool_searcher< RandomAccessIterator1, Hash, BinaryPredicate > &  rhs  ) 

Assign to this object the state of the specified rhs object, and return a non-'const' reference to this searcher.

template<class RandomAccessIterator1, class Hash = hash< typename iterator_traits<RandomAccessIterator1>::value_type>, class BinaryPredicate = equal_to< typename iterator_traits<RandomAccessIterator1>::value_type>>
boyer_moore_horspool_searcher& bsl::boyer_moore_horspool_searcher< RandomAccessIterator1, Hash, BinaryPredicate >::operator= ( BloombergLP::bslmf::MovableRef< boyer_moore_horspool_searcher< RandomAccessIterator1, Hash, BinaryPredicate > >  rhs  ) 

Assign to this object the state of the specified rhs object and return a non-'const' reference to this searcher. The rhs is left in an unspecified (valid) state.

template<class RandomAccessIterator1, class Hash = hash< typename iterator_traits<RandomAccessIterator1>::value_type>, class BinaryPredicate = equal_to< typename iterator_traits<RandomAccessIterator1>::value_type>>
template<class RandomAccessIterator2 >
pair<RandomAccessIterator2, RandomAccessIterator2> bsl::boyer_moore_horspool_searcher< RandomAccessIterator1, Hash, BinaryPredicate >::operator() ( RandomAccessIterator2  first,
RandomAccessIterator2  last 
) const

Search the specified range [first, last) for the first sequence of the value_type values specified on construction. Return the range where those values are found, or the range [last, last) if that sequence is not found. The search is performed using an implementation of the Boyer Moore Horspool algorithm and has a complexity of O(N) for random text. The behavior is undefined unless first can be advanced to last and the iterators used to construct this object are still valid. Note that if the sought sequence is empty, the range [first, first) is returned. Also note that if the sought sequence is longer than the searched sequence -- thus, the sought sequence cannot be found -- the range [last, last) is returned.


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