Quick Links:

bal | bbl | bdl | bsl

Public Types | Public Member Functions

bslstl::BoyerMooreHorspoolSearcher_CharImp< RNDACC_ITR_NEEDLE, HASH, EQUAL > Class Template Reference

#include <bslstl_boyermoorehorspoolsearcher.h>

List of all members.

Public Types

typedef bsl::iterator_traits
< RNDACC_ITR_NEEDLE >
::value_type 
value_type
typedef bsl::iterator_traits
< RNDACC_ITR_NEEDLE >
::difference_type 
difference_type

Public Member Functions

 BoyerMooreHorspoolSearcher_CharImp (RNDACC_ITR_NEEDLE needleFirst, RNDACC_ITR_NEEDLE needleLast, HASH hash, EQUAL equal, BloombergLP::bslma::Allocator *basicAllocator)
 BoyerMooreHorspoolSearcher_CharImp (const BoyerMooreHorspoolSearcher_CharImp &original)
 BoyerMooreHorspoolSearcher_CharImp (BloombergLP::bslmf::MovableRef< BoyerMooreHorspoolSearcher_CharImp > original) BSLS_KEYWORD_NOEXCEPT
 BoyerMooreHorspoolSearcher_CharImp (const BoyerMooreHorspoolSearcher_CharImp &original, BloombergLP::bslma::Allocator *basicAllocator)
 BoyerMooreHorspoolSearcher_CharImp (BloombergLP::bslmf::MovableRef< BoyerMooreHorspoolSearcher_CharImp > original, BloombergLP::bslma::Allocator *basicAllocator)
 ~BoyerMooreHorspoolSearcher_CharImp ()
BoyerMooreHorspoolSearcher_CharImpoperator= (const BoyerMooreHorspoolSearcher_CharImp &rhs)
BoyerMooreHorspoolSearcher_CharImpoperator= (BloombergLP::bslmf::MovableRef< BoyerMooreHorspoolSearcher_CharImp > rhs)
difference_type badCharacterSkip (const value_type &value) const
HASH hash () const
EQUAL equal () const
BloombergLP::bslma::Allocator * allocator () const

Detailed Description

template<class RNDACC_ITR_NEEDLE, class HASH, class EQUAL>
class bslstl::BoyerMooreHorspoolSearcher_CharImp< RNDACC_ITR_NEEDLE, HASH, EQUAL >

This class template implements the same interfaces as the BoyerMooreHorspoolSearcher_GeneralImp; however, the implementation is specialized for a value_type of char. Notably, needle metadata is stored/accessed from a fixed size array, not a dynamically-sized container.

See Component bslstl_boyermoorehorspoolsearcher


Member Typedef Documentation

template<class RNDACC_ITR_NEEDLE , class HASH , class EQUAL >
typedef bsl::iterator_traits<RNDACC_ITR_NEEDLE>::value_type bslstl::BoyerMooreHorspoolSearcher_CharImp< RNDACC_ITR_NEEDLE, HASH, EQUAL >::value_type
template<class RNDACC_ITR_NEEDLE , class HASH , class EQUAL >
typedef bsl::iterator_traits<RNDACC_ITR_NEEDLE>::difference_type bslstl::BoyerMooreHorspoolSearcher_CharImp< RNDACC_ITR_NEEDLE, HASH, EQUAL >::difference_type

Constructor & Destructor Documentation

template<class RNDACC_ITR_NEEDLE , class HASH , class EQUAL >
bslstl::BoyerMooreHorspoolSearcher_CharImp< RNDACC_ITR_NEEDLE, HASH, EQUAL >::BoyerMooreHorspoolSearcher_CharImp ( RNDACC_ITR_NEEDLE  needleFirst,
RNDACC_ITR_NEEDLE  needleLast,
HASH  hash,
EQUAL  equal,
BloombergLP::bslma::Allocator *  basicAllocator 
)

Create a BoyerMooreHorspoolSearcher_CharImp object for the sequence of char values in the specified range [needleFirst, needlelast). This implementation is invoked when the specified hash is bsl::hash<char> and the specified equal is bsl::equal_to<char>. Neither functor is used because for the special case of char the needle metadata is maintained in a fixed size array (256 elements). As always, the specified basicAllocator is used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. The behavior is undefined unless needleFirst can be advanced to needleLast.

template<class RNDACC_ITR_NEEDLE , class HASH , class EQUAL >
bslstl::BoyerMooreHorspoolSearcher_CharImp< RNDACC_ITR_NEEDLE, HASH, EQUAL >::BoyerMooreHorspoolSearcher_CharImp ( const BoyerMooreHorspoolSearcher_CharImp< RNDACC_ITR_NEEDLE, HASH, EQUAL > &  original  ) 

Create a BoyerMooreHorspoolSearcher_CharImp object having same state as the specified original object. The allocator of original is propagated to the new object.

template<class RNDACC_ITR_NEEDLE , class HASH , class EQUAL >
bslstl::BoyerMooreHorspoolSearcher_CharImp< RNDACC_ITR_NEEDLE, HASH, EQUAL >::BoyerMooreHorspoolSearcher_CharImp ( BloombergLP::bslmf::MovableRef< BoyerMooreHorspoolSearcher_CharImp< RNDACC_ITR_NEEDLE, HASH, EQUAL > >  original  ) 

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

template<class RNDACC_ITR_NEEDLE , class HASH , class EQUAL >
bslstl::BoyerMooreHorspoolSearcher_CharImp< RNDACC_ITR_NEEDLE, HASH, EQUAL >::BoyerMooreHorspoolSearcher_CharImp ( const BoyerMooreHorspoolSearcher_CharImp< RNDACC_ITR_NEEDLE, HASH, EQUAL > &  original,
BloombergLP::bslma::Allocator *  basicAllocator 
)

Create a BoyerMooreHorspoolSearcher_CharImp object having the same state as the specified original object and that uses the specified basicAllocator to supply memory. If basicAllocator is 0, the currently installed default allocator is used.

template<class RNDACC_ITR_NEEDLE , class HASH , class EQUAL >
bslstl::BoyerMooreHorspoolSearcher_CharImp< RNDACC_ITR_NEEDLE, HASH, EQUAL >::BoyerMooreHorspoolSearcher_CharImp ( BloombergLP::bslmf::MovableRef< BoyerMooreHorspoolSearcher_CharImp< RNDACC_ITR_NEEDLE, HASH, EQUAL > >  original,
BloombergLP::bslma::Allocator *  basicAllocator 
)

Create a BoyerMooreHorspoolSearcher_CharImp object having the same state as the specified original object and that uses the specified basicAllocator to supply memory. The state of original is moved (in constant time) to the new searcher if basicAllocator == original.allocator(), and is copied using basicAllocator otherwise. If basicAllocator is 0, the currently installed default allocator is used. The original object is left in an unspecified (valid) state.

template<class RNDACC_ITR_NEEDLE , class HASH , class EQUAL >
bslstl::BoyerMooreHorspoolSearcher_CharImp< RNDACC_ITR_NEEDLE, HASH, EQUAL >::~BoyerMooreHorspoolSearcher_CharImp (  ) 

Destroy this object;


Member Function Documentation

template<class RNDACC_ITR_NEEDLE , class HASH , class EQUAL >
BoyerMooreHorspoolSearcher_CharImp& bslstl::BoyerMooreHorspoolSearcher_CharImp< RNDACC_ITR_NEEDLE, HASH, EQUAL >::operator= ( const BoyerMooreHorspoolSearcher_CharImp< RNDACC_ITR_NEEDLE, HASH, EQUAL > &  rhs  ) 

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

template<class RNDACC_ITR_NEEDLE , class HASH , class EQUAL >
BoyerMooreHorspoolSearcher_CharImp& bslstl::BoyerMooreHorspoolSearcher_CharImp< RNDACC_ITR_NEEDLE, HASH, EQUAL >::operator= ( BloombergLP::bslmf::MovableRef< BoyerMooreHorspoolSearcher_CharImp< RNDACC_ITR_NEEDLE, HASH, EQUAL > >  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 RNDACC_ITR_NEEDLE , class HASH , class EQUAL >
difference_type bslstl::BoyerMooreHorspoolSearcher_CharImp< RNDACC_ITR_NEEDLE, HASH, EQUAL >::badCharacterSkip ( const value_type value  )  const

Return the number of positions to advance the search in the haystack when the specified value is found in the rightmost position of the current (unsuccessful) match attempt.

template<class RNDACC_ITR_NEEDLE , class HASH , class EQUAL >
HASH bslstl::BoyerMooreHorspoolSearcher_CharImp< RNDACC_ITR_NEEDLE, HASH, EQUAL >::hash (  )  const

Return the hashing functor supplied on construction.

template<class RNDACC_ITR_NEEDLE , class HASH , class EQUAL >
EQUAL bslstl::BoyerMooreHorspoolSearcher_CharImp< RNDACC_ITR_NEEDLE, HASH, EQUAL >::equal (  )  const

Return the equality comparison functor supplied on construction.

template<class RNDACC_ITR_NEEDLE , class HASH , class EQUAL >
BloombergLP::bslma::Allocator* bslstl::BoyerMooreHorspoolSearcher_CharImp< RNDACC_ITR_NEEDLE, HASH, EQUAL >::allocator (  )  const

Return the allocator supplied on construction.


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