8#ifndef INCLUDED_BSLSTL_BOYERMOOREHORSPOOLSEARCHER
9#define INCLUDED_BSLSTL_BOYERMOOREHORSPOOLSEARCHER
653#include <bslscm_version.h>
694template <
class RNDACC_ITR_NEEDLE,
704 typedef typename bsl::iterator_traits<RNDACC_ITR_NEEDLE>::value_type
709 typedef typename bsl::iterator_traits<RNDACC_ITR_NEEDLE>::difference_type
717 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
719 typedef unsigned char ShortNeedleSkipType;
735 void privateInstallNewTable(
742 void privateInstallTableOverOld(
748 void privateInstallMismatchedTable(
753 void privateDeleteTable();
766 bool privateUseShortNeedleOptimization()
const;
771 bool privateHasSameNeedleOptimization(
776 std::size_t d_needleLength;
777 BloombergLP::bslma::Allocator *d_allocator_p;
794 RNDACC_ITR_NEEDLE needleFirst,
795 RNDACC_ITR_NEEDLE needleLast,
798 BloombergLP::bslma::Allocator *basicAllocator);
812 BloombergLP::bslmf::MovableRef<BoyerMooreHorspoolSearcher_CharImp>
822 BloombergLP::bslma::Allocator *basicAllocator);
833 BloombergLP::bslmf::MovableRef<BoyerMooreHorspoolSearcher_CharImp>
835 BloombergLP::bslma::Allocator *basicAllocator);
851 BloombergLP::bslmf::MovableRef<BoyerMooreHorspoolSearcher_CharImp>
868 BloombergLP::bslma::Allocator *
allocator()
const;
879template <
class RNDACC_ITR_NEEDLE,
886 typedef typename bsl::iterator_traits<RNDACC_ITR_NEEDLE>::value_type
889 typedef typename bsl::iterator_traits<RNDACC_ITR_NEEDLE>::difference_type
900 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
919 RNDACC_ITR_NEEDLE needleFirst,
920 RNDACC_ITR_NEEDLE needleLast,
923 BloombergLP::bslma::Allocator *basicAllocator);
937 BloombergLP::bslmf::MovableRef<BoyerMooreHorspoolSearcher_GeneralImp>
947 BloombergLP::bslma::Allocator *basicAllocator);
957 BloombergLP::bslmf::MovableRef<BoyerMooreHorspoolSearcher_GeneralImp>
959 BloombergLP::bslma::Allocator *basicAllocator);
972 BloombergLP::bslmf::MovableRef<BoyerMooreHorspoolSearcher_GeneralImp>
989 BloombergLP::bslma::Allocator *
allocator()
const;
1001template <
class RNDACC_ITR_NEEDLE,
1003 typename bsl::iterator_traits<RNDACC_ITR_NEEDLE>::value_type>,
1005 typename bsl::iterator_traits<RNDACC_ITR_NEEDLE>::value_type>
1014 typedef typename bsl::iterator_traits<RNDACC_ITR_NEEDLE>::value_type
1019 typename bsl::iterator_traits<RNDACC_ITR_NEEDLE>::value_type>
1024 typename bsl::iterator_traits<RNDACC_ITR_NEEDLE>::value_type>
1032 typedef typename bsl::iterator_traits<RNDACC_ITR_NEEDLE>::difference_type
1037 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
1039 enum { k_CAN_OPTIMIZE_FOR_CHAR = (
1048 k_CAN_OPTIMIZE_FOR_CHAR,
1050 BloombergLP::bslstl::
1051 BoyerMooreHorspoolSearcher_CharImp<RNDACC_ITR_NEEDLE,
1054 BloombergLP::bslstl::
1055 BoyerMooreHorspoolSearcher_GeneralImp<RNDACC_ITR_NEEDLE,
1060 RNDACC_ITR_NEEDLE d_needleFirst;
1061 RNDACC_ITR_NEEDLE d_needleLast;
1062 difference_type d_needleLength;
1093 EQUAL
equal = EQUAL(),
1094 BloombergLP::bslma::Allocator *basicAllocator = 0);
1109 BloombergLP::bslmf::MovableRef<BoyerMooreHorspoolSearcher> original)
1119 BloombergLP::bslma::Allocator *basicAllocator);
1131 BloombergLP::bslmf::MovableRef<BoyerMooreHorspoolSearcher>
1133 BloombergLP::bslma::Allocator *basicAllocator);
1151 BloombergLP::bslmf::MovableRef<BoyerMooreHorspoolSearcher> rhs);
1171 template<
class RNDACC_ITR_HAYSTACK>
1173 RNDACC_ITR_HAYSTACK haystackFirst,
1174 RNDACC_ITR_HAYSTACK haystackLast)
const;
1191 EQUAL
equal()
const;
1194 BloombergLP::bslma::Allocator *
allocator()
const;
1200#ifndef BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS
1212template <
class RandomAccessIterator1,
1214 typename iterator_traits<RandomAccessIterator1>::value_type>,
1215 class BinaryPredicate = equal_to<
1216 typename iterator_traits<RandomAccessIterator1>::value_type> >
1217class boyer_moore_horspool_searcher {
1221 BloombergLP::bslstl::BoyerMooreHorspoolSearcher<RandomAccessIterator1,
1223 BinaryPredicate> d_imp;
1239 boyer_moore_horspool_searcher(RandomAccessIterator1 pat_first,
1240 RandomAccessIterator1 pat_last,
1242 BinaryPredicate pred =
1245 boyer_moore_horspool_searcher(
1246 const boyer_moore_horspool_searcher& original)
1251 boyer_moore_horspool_searcher(
1252 BloombergLP::bslmf::MovableRef<boyer_moore_horspool_searcher>
1253 original) =
default;
1259 ~boyer_moore_horspool_searcher() =
default;
1263 boyer_moore_horspool_searcher& operator=(
1264 const boyer_moore_horspool_searcher& rhs) =
default;
1268 boyer_moore_horspool_searcher& operator=(
1269 BloombergLP::bslmf::MovableRef<boyer_moore_horspool_searcher>
1289 template <
class RandomAccessIterator2>
1290 pair<RandomAccessIterator2,
1291 RandomAccessIterator2> operator()(RandomAccessIterator2 first,
1292 RandomAccessIterator2 last)
const;
1310template <
class RNDACC_ITR_NEEDLE,
1315BoyerMooreHorspoolSearcher_CharImp<RNDACC_ITR_NEEDLE,
1317 EQUAL>::privateInstallNewTable(
1318 const BoyerMooreHorspoolSearcher_CharImp&
1324 privateUseShortNeedleOptimization())) {
1325 ShortNeedleSkipArray *arrayPtr =
new (*d_allocator_p)
1326 ShortNeedleSkipArray;
1329 static_cast<ShortNeedleSkipArray *
>(
object.d_table_p)->data(),
1332 d_table_p = arrayPtr;
1334 LongNeedleSkipArray *arrayPtr =
new (*d_allocator_p)
1335 LongNeedleSkipArray;
1338 static_cast<LongNeedleSkipArray *
>(
object.d_table_p)->
cbegin(),
1339 static_cast<LongNeedleSkipArray *
>(
object.d_table_p)->
cend(),
1342 d_table_p = arrayPtr;
1346template <
class RNDACC_ITR_NEEDLE,
1351BoyerMooreHorspoolSearcher_CharImp<RNDACC_ITR_NEEDLE,
1353 EQUAL>::privateInstallTableOverOld(
1354 const BoyerMooreHorspoolSearcher_CharImp&
1358 BSLS_ASSERT(privateHasSameNeedleOptimization(
object));
1361 privateUseShortNeedleOptimization())) {
1362 ShortNeedleSkipArray *arrayPtr =
static_cast<ShortNeedleSkipArray *
>(
1366 static_cast<ShortNeedleSkipArray *
>(
object.d_table_p)->data(),
1370 LongNeedleSkipArray *arrayPtr =
static_cast< LongNeedleSkipArray *
>(
1373 static_cast<LongNeedleSkipArray *
>(
object.d_table_p)->
cbegin(),
1374 static_cast<LongNeedleSkipArray *
>(
object.d_table_p)->
cend(),
1379template <
class RNDACC_ITR_NEEDLE,
1384BoyerMooreHorspoolSearcher_CharImp<RNDACC_ITR_NEEDLE,
1386 EQUAL>::privateInstallMismatchedTable(
1387 const BoyerMooreHorspoolSearcher_CharImp&
1391 object.privateUseShortNeedleOptimization())) {
1392 ShortNeedleSkipArray *arrayPtr =
new (*d_allocator_p)
1393 ShortNeedleSkipArray;
1396 static_cast<ShortNeedleSkipArray *
>(
object.d_table_p)->data(),
1399 privateDeleteTable();
1401 d_table_p = arrayPtr;
1403 LongNeedleSkipArray *arrayPtr =
new (*d_allocator_p)
1404 LongNeedleSkipArray;
1406 static_cast<LongNeedleSkipArray *
>(
object.d_table_p)->
cbegin(),
1407 static_cast<LongNeedleSkipArray *
>(
object.d_table_p)->
cend(),
1409 privateDeleteTable();
1411 d_table_p = arrayPtr;
1415template <
class RNDACC_ITR_NEEDLE,
1420BoyerMooreHorspoolSearcher_CharImp<RNDACC_ITR_NEEDLE,
1422 EQUAL>::privateDeleteTable()
1425 privateUseShortNeedleOptimization())) {
1426 d_allocator_p->deleteObjectRaw(
static_cast<ShortNeedleSkipArray *
>(
1429 d_allocator_p->deleteObjectRaw(
static_cast< LongNeedleSkipArray *
>(
1436template <
class RNDACC_ITR_NEEDLE,
1441BoyerMooreHorspoolSearcher_CharImp<RNDACC_ITR_NEEDLE,
1443 EQUAL>::privateSetPostMoveState(
1444 BoyerMooreHorspoolSearcher_CharImp *
object)
1450 object->d_needleLength = 0;
1451 object->d_table_p = 0;
1454template <
class RNDACC_ITR_NEEDLE,
1459BoyerMooreHorspoolSearcher_CharImp<RNDACC_ITR_NEEDLE,
1461 EQUAL>::privateUseShortNeedleOptimization()
1464 return d_needleLength <= UCHAR_MAX;
1467template <
class RNDACC_ITR_NEEDLE,
1472BoyerMooreHorspoolSearcher_CharImp<RNDACC_ITR_NEEDLE,
1474 EQUAL>::privateHasSameNeedleOptimization(
1475 const BoyerMooreHorspoolSearcher_CharImp&
1479 return this->privateUseShortNeedleOptimization()
1480 ==
object.privateUseShortNeedleOptimization();
1484template <
class RNDACC_ITR_NEEDLE,
1488BoyerMooreHorspoolSearcher_CharImp<RNDACC_ITR_NEEDLE,
1491BoyerMooreHorspoolSearcher_CharImp(
1492 RNDACC_ITR_NEEDLE needleFirst,
1493 RNDACC_ITR_NEEDLE needleLast,
1496 BloombergLP::bslma::Allocator *basicAllocator)
1497: d_needleLength(needleLast - needleFirst)
1498, d_allocator_p(
bslma::Default::allocator(basicAllocator))
1503 if (0 == d_needleLength) {
1508 privateUseShortNeedleOptimization())) {
1511 std::memset(arrayPtr->
data(),
1512 static_cast<ShortNeedleSkipType
>(d_needleLength),
1514 d_table_p = arrayPtr;
1519 std::fill(arrayPtr->
begin(), arrayPtr->
end(), d_needleLength);
1521 d_table_p = arrayPtr;
1524 for (RNDACC_ITR_NEEDLE current = needleFirst,
1525 last = needleLast - 1;
1526 last != current; ++current) {
1528 const unsigned char index =
static_cast<unsigned char>(*current);
1529 std::size_t skipValue = d_needleLength
1531 - (current - needleFirst);
1534 privateUseShortNeedleOptimization())) {
1538 =
static_cast<ShortNeedleSkipType
>(skipValue);
1541 =
static_cast< LongNeedleSkipType
>(skipValue);
1546template <
class RNDACC_ITR_NEEDLE,
1553BoyerMooreHorspoolSearcher_CharImp(
1555: d_needleLength(original.d_needleLength)
1556, d_allocator_p( original.d_allocator_p)
1559 if (0 < d_needleLength) {
1560 privateInstallNewTable(original);
1564template <
class RNDACC_ITR_NEEDLE,
1571BoyerMooreHorspoolSearcher_CharImp(
1572 BloombergLP::bslmf::MovableRef<BoyerMooreHorspoolSearcher_CharImp>
1575: d_needleLength(MoveUtil::access(original).d_needleLength)
1576, d_allocator_p( MoveUtil::access(original).d_allocator_p)
1577, d_table_p( MoveUtil::access(original).d_table_p)
1579 privateSetPostMoveState(&MoveUtil::access(original));
1582template <
class RNDACC_ITR_NEEDLE,
1589BoyerMooreHorspoolSearcher_CharImp(
1591 BloombergLP::bslma::Allocator *basicAllocator)
1592: d_needleLength(original.d_needleLength)
1593, d_allocator_p(
bslma::Default::allocator(basicAllocator))
1596 if (0 < d_needleLength) {
1597 privateInstallNewTable(original);
1601template <
class RNDACC_ITR_NEEDLE,
1608BoyerMooreHorspoolSearcher_CharImp(
1609 BloombergLP::bslmf::MovableRef<BoyerMooreHorspoolSearcher_CharImp>
1611 BloombergLP::bslma::Allocator *basicAllocator)
1612: d_needleLength(MoveUtil::access(original).d_needleLength)
1613, d_allocator_p(
bslma::Default::allocator(basicAllocator))
1616 if (d_allocator_p == MoveUtil::access(original).d_allocator_p) {
1618 d_table_p = MoveUtil::access(original).d_table_p;
1620 privateSetPostMoveState(&MoveUtil::access(original));
1622 if (0 < d_needleLength) {
1623 privateInstallNewTable(MoveUtil::access(original));
1628template <
class RNDACC_ITR_NEEDLE,
1635~BoyerMooreHorspoolSearcher_CharImp()
1637 privateDeleteTable();
1641template <
class RNDACC_ITR_NEEDLE,
1654 if (0 < rhs.d_needleLength) {
1655 if (d_table_p && privateHasSameNeedleOptimization(rhs)) {
1656 privateInstallTableOverOld(rhs);
1658 privateInstallMismatchedTable(rhs);
1661 privateDeleteTable();
1664 d_needleLength = rhs.d_needleLength;
1669template <
class RNDACC_ITR_NEEDLE,
1679 BloombergLP::bslmf::MovableRef<BoyerMooreHorspoolSearcher_CharImp>
1682 if (d_allocator_p == MoveUtil::access(rhs).d_allocator_p) {
1683 d_allocator_p->deallocate(d_table_p);
1684 d_table_p = MoveUtil::access(rhs).d_table_p;
1685 MoveUtil::access(rhs).d_table_p = 0;
1687 if (0 < MoveUtil::access(rhs).d_needleLength) {
1688 if (d_table_p && privateHasSameNeedleOptimization(
1689 MoveUtil::access(rhs))) {
1690 privateInstallTableOverOld(rhs);
1692 privateInstallMismatchedTable(MoveUtil::access(rhs));
1695 privateDeleteTable();
1699 d_needleLength = MoveUtil::access(rhs).d_needleLength;
1705template <
class RNDACC_ITR_NEEDLE,
1712 EQUAL>::difference_type
1715 EQUAL>::badCharacterSkip(
1719 unsigned char index =
static_cast<unsigned char>(value);
1722 privateUseShortNeedleOptimization())) {
1731template <
class RNDACC_ITR_NEEDLE,
1737 EQUAL>::hash()
const
1742template <
class RNDACC_ITR_NEEDLE,
1748 EQUAL>::equal()
const
1753template <
class RNDACC_ITR_NEEDLE,
1760 EQUAL>::allocator()
const
1762 return d_allocator_p;
1770template <
class RNDACC_ITR_NEEDLE,
1777BoyerMooreHorspoolSearcher_GeneralImp(
1778 RNDACC_ITR_NEEDLE needleFirst,
1779 RNDACC_ITR_NEEDLE needleLast,
1782 BloombergLP::bslma::Allocator *basicAllocator)
1783: d_needleLength(needleLast - needleFirst)
1784, d_map(0, hash, equal, basicAllocator)
1788 if (0 < d_needleLength) {
1789 for (RNDACC_ITR_NEEDLE current = needleFirst,
1790 last = needleLast - 1;
1791 last != current; ++current) {
1792 d_map.
insert(std::make_pair(*current,
1795 - (current - needleFirst)));
1800template <
class RNDACC_ITR_NEEDLE,
1807BoyerMooreHorspoolSearcher_GeneralImp(
1809: d_needleLength(original.d_needleLength)
1810, d_map(original, original.allocator())
1814template <
class RNDACC_ITR_NEEDLE,
1821BoyerMooreHorspoolSearcher_GeneralImp(
1822 BloombergLP::bslmf::MovableRef<BoyerMooreHorspoolSearcher_GeneralImp>
1825: d_needleLength(MoveUtil::move(MoveUtil::access(original).d_needleLength))
1826, d_map( MoveUtil::move(MoveUtil::access(original).d_map))
1830template <
class RNDACC_ITR_NEEDLE,
1837BoyerMooreHorspoolSearcher_GeneralImp(
1839 BloombergLP::bslma::Allocator *basicAllocator)
1840: d_needleLength(original.d_needleLength)
1841, d_map(original.d_map, basicAllocator)
1845template <
class RNDACC_ITR_NEEDLE,
1852BoyerMooreHorspoolSearcher_GeneralImp(
1853 BloombergLP::bslmf::MovableRef<BoyerMooreHorspoolSearcher_GeneralImp>
1855 BloombergLP::bslma::Allocator *basicAllocator)
1856: d_needleLength(MoveUtil::move(MoveUtil::access(original).d_needleLength))
1857, d_map( MoveUtil::move(MoveUtil::access(original).d_map),
1863template <
class RNDACC_ITR_NEEDLE,
1875 d_needleLength = rhs.d_needleLength;
1881template <
class RNDACC_ITR_NEEDLE,
1891 BloombergLP::bslmf::MovableRef<BoyerMooreHorspoolSearcher_GeneralImp>
1894 d_needleLength = MoveUtil::move(MoveUtil::access(rhs).d_needleLength);
1895 d_map = MoveUtil::move(MoveUtil::access(rhs).d_map);
1901template <
class RNDACC_ITR_NEEDLE,
1908 EQUAL>::difference_type
1911 EQUAL>::badCharacterSkip(
1916 return d_map.cend() == result ? d_needleLength : result->second;
1919template <
class RNDACC_ITR_NEEDLE,
1925 EQUAL>::hash()
const
1927 return d_map.hash_function();
1930template <
class RNDACC_ITR_NEEDLE,
1936 EQUAL>::equal()
const
1938 return d_map.key_eq();
1941template <
class RNDACC_ITR_NEEDLE,
1948 EQUAL>::allocator()
const
1950 return d_map.get_allocator().mechanism();
1958template <
class RNDACC_ITR_NEEDLE,
1965 EQUAL>::privateSetPostMoveState(
1971 object->d_needleFirst = d_needleFirst;
1972 object->d_needleLast = d_needleFirst;
1973 object->d_needleLength = 0;
1977template <
class RNDACC_ITR_NEEDLE,
1980BoyerMooreHorspoolSearcher<RNDACC_ITR_NEEDLE,
1983BoyerMooreHorspoolSearcher(RNDACC_ITR_NEEDLE needleFirst,
1984 RNDACC_ITR_NEEDLE needleLast,
1987 BloombergLP::bslma::Allocator *basicAllocator)
1988: d_needleFirst( needleFirst)
1989, d_needleLast( needleLast)
1990, d_needleLength(
bsl::distance(needleFirst, needleLast))
1991, d_imp(needleFirst, needleLast, hash, equal, basicAllocator)
1996template <
class RNDACC_ITR_NEEDLE,
2003: d_needleFirst( original.d_needleFirst)
2004, d_needleLast( original.d_needleLast)
2005, d_needleLength(original.d_needleLength)
2006, d_imp( original.d_imp,
2007 BloombergLP::
bslma::Default::defaultAllocator())
2011template <
class RNDACC_ITR_NEEDLE,
2017BoyerMooreHorspoolSearcher(
2018 BloombergLP::bslmf::MovableRef<BoyerMooreHorspoolSearcher> original)
2020: d_needleFirst( MoveUtil::move(MoveUtil::access(original).d_needleFirst))
2021, d_needleLast( MoveUtil::move(MoveUtil::access(original).d_needleLast))
2022, d_needleLength(MoveUtil::move(MoveUtil::access(original).d_needleLength))
2023, d_imp( MoveUtil::move(MoveUtil::access(original).d_imp))
2025 privateSetPostMoveState(&MoveUtil::access(original));
2028template <
class RNDACC_ITR_NEEDLE,
2035 BloombergLP::bslma::Allocator *basicAllocator)
2036: d_needleFirst( original.d_needleFirst)
2037, d_needleLast( original.d_needleLast)
2038, d_needleLength(original.d_needleLength)
2039, d_imp( original.d_imp, basicAllocator)
2043template <
class RNDACC_ITR_NEEDLE,
2049BoyerMooreHorspoolSearcher(
2050 BloombergLP::bslmf::MovableRef<BoyerMooreHorspoolSearcher> original,
2051 BloombergLP::bslma::Allocator *basicAllocator)
2052: d_needleFirst( MoveUtil::move(MoveUtil::access(original).d_needleFirst))
2053, d_needleLast( MoveUtil::move(MoveUtil::access(original).d_needleLast))
2054, d_needleLength(MoveUtil::move(MoveUtil::access(original).d_needleLength))
2055, d_imp( MoveUtil::move(MoveUtil::access(original).d_imp),
2058 privateSetPostMoveState(&MoveUtil::access(original));
2062template <
class RNDACC_ITR_NEEDLE,
2074 d_needleFirst = rhs.d_needleFirst;
2075 d_needleLast = rhs.d_needleLast;
2076 d_needleLength = rhs.d_needleLength;
2082template <
class RNDACC_ITR_NEEDLE,
2092 BloombergLP::bslmf::MovableRef<BoyerMooreHorspoolSearcher> rhs)
2096 d_needleFirst = MoveUtil::move(MoveUtil::access(rhs).d_needleFirst);
2097 d_needleLast = MoveUtil::move(MoveUtil::access(rhs).d_needleLast);
2098 d_needleLength = MoveUtil::move(MoveUtil::access(rhs).d_needleLength);
2099 d_imp = MoveUtil::move(MoveUtil::access(rhs).d_imp);
2101 privateSetPostMoveState(&MoveUtil::access(rhs));
2108template <
class RNDACC_ITR_NEEDLE,
2111template <
class RNDACC_ITR_HAYSTACK>
2116 RNDACC_ITR_HAYSTACK haystackFirst,
2117 RNDACC_ITR_HAYSTACK haystackLast)
const
2121 if (0 == d_needleLength) {
2122 return std::make_pair(haystackFirst, haystackFirst);
2125 std::size_t haystackLength = haystackLast - haystackFirst;
2127 for (std::size_t possibleMatch = 0;
2128 d_needleLength + possibleMatch <= haystackLength;
2129 possibleMatch += d_imp.badCharacterSkip(haystackFirst[possibleMatch
2135 const EQUAL comparator(equal());
2137 for (std::size_t idx = d_needleLength - 1;
2138 comparator(haystackFirst[possibleMatch + idx],
2139 d_needleFirst[idx]);
2143 return std::make_pair(haystackFirst + possibleMatch,
2144 haystackFirst + possibleMatch
2151 return std::make_pair(haystackLast, haystackLast);
2154template <
class RNDACC_ITR_NEEDLE,
2160 EQUAL>::needleFirst()
const
2162 return d_needleFirst;
2165template <
class RNDACC_ITR_NEEDLE,
2171 EQUAL>::needleLast()
const
2173 return d_needleLast;
2176template <
class RNDACC_ITR_NEEDLE,
2182 EQUAL>::hash()
const
2184 return d_imp.
hash();
2187template <
class RNDACC_ITR_NEEDLE,
2193 EQUAL>::equal()
const
2195 return d_imp.
equal();
2198template <
class RNDACC_ITR_NEEDLE,
2205 EQUAL>::allocator()
const
2213#ifndef BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS
2221template <
class RandomAccessIterator1,
2223 class BinaryPredicate>
2225boyer_moore_horspool_searcher<RandomAccessIterator1,
2227 BinaryPredicate>::boyer_moore_horspool_searcher(
2228 RandomAccessIterator1 pat_first,
2229 RandomAccessIterator1 pat_last,
2231 BinaryPredicate pred)
2232: d_imp(pat_first, pat_last, hf, pred)
2238template <
class RandomAccessIterator1,
2240 class BinaryPredicate>
2241template <
class RandomAccessIterator2>
2243pair<RandomAccessIterator2,
2244 RandomAccessIterator2> boyer_moore_horspool_searcher<
2245 RandomAccessIterator1,
2247 BinaryPredicate>::operator()(
2248 RandomAccessIterator2 first,
2249 RandomAccessIterator2 last)
2254 return d_imp(first, last);
2267template <
class RNDACC_ITR_NEEDLE,
2277template <
class RNDACC_ITR_NEEDLE,
2288template <
class RNDACC_ITR_NEEDLE,
Definition bslstl_pair.h:1210
Definition bslstl_unorderedmap.h:1089
pair< iterator, bool > insert(const value_type &value)
Definition bslstl_unorderedmap.h:3051
BloombergLP::bslstl::HashTableIterator< const value_type, difference_type > const_iterator
Definition bslstl_unorderedmap.h:1160
Definition bslstl_boyermoorehorspoolsearcher.h:697
EQUAL equal() const
Return the equality comparison functor supplied on construction.
Definition bslstl_boyermoorehorspoolsearcher.h:1748
~BoyerMooreHorspoolSearcher_CharImp()
Destroy this object;.
Definition bslstl_boyermoorehorspoolsearcher.h:1635
BloombergLP::bslma::Allocator * allocator() const
Return the allocator supplied on construction.
Definition bslstl_boyermoorehorspoolsearcher.h:1760
difference_type badCharacterSkip(const value_type &value) const
Definition bslstl_boyermoorehorspoolsearcher.h:1715
BoyerMooreHorspoolSearcher_CharImp & operator=(const BoyerMooreHorspoolSearcher_CharImp &rhs)
Definition bslstl_boyermoorehorspoolsearcher.h:1650
bsl::iterator_traits< RNDACC_ITR_NEEDLE >::difference_type difference_type
Definition bslstl_boyermoorehorspoolsearcher.h:710
bsl::iterator_traits< RNDACC_ITR_NEEDLE >::value_type value_type
Definition bslstl_boyermoorehorspoolsearcher.h:705
HASH hash() const
Return the hashing functor supplied on construction.
Definition bslstl_boyermoorehorspoolsearcher.h:1737
Definition bslstl_boyermoorehorspoolsearcher.h:882
difference_type badCharacterSkip(const value_type &value) const
Definition bslstl_boyermoorehorspoolsearcher.h:1911
EQUAL equal() const
Return the equality comparison functor supplied on construction.
Definition bslstl_boyermoorehorspoolsearcher.h:1936
bsl::iterator_traits< RNDACC_ITR_NEEDLE >::value_type value_type
Definition bslstl_boyermoorehorspoolsearcher.h:887
BoyerMooreHorspoolSearcher_GeneralImp & operator=(const BoyerMooreHorspoolSearcher_GeneralImp &rhs)
Definition bslstl_boyermoorehorspoolsearcher.h:1872
bsl::iterator_traits< RNDACC_ITR_NEEDLE >::difference_type difference_type
Definition bslstl_boyermoorehorspoolsearcher.h:890
BloombergLP::bslma::Allocator * allocator() const
Return the allocator used by this object to supply memory.
Definition bslstl_boyermoorehorspoolsearcher.h:1948
HASH hash() const
Return the hashing functor supplied on construction.
Definition bslstl_boyermoorehorspoolsearcher.h:1925
Definition bslstl_boyermoorehorspoolsearcher.h:1007
bsl::pair< RNDACC_ITR_HAYSTACK, RNDACC_ITR_HAYSTACK > operator()(RNDACC_ITR_HAYSTACK haystackFirst, RNDACC_ITR_HAYSTACK haystackLast) const
Definition bslstl_boyermoorehorspoolsearcher.h:2115
~BoyerMooreHorspoolSearcher()=default
BloombergLP::bslma::Allocator * allocator() const
Return the allocator used by this object to supply memory.
Definition bslstl_boyermoorehorspoolsearcher.h:2205
EQUAL equal() const
Return the equality comparison functor supplied on construction.
Definition bslstl_boyermoorehorspoolsearcher.h:2193
bsl::iterator_traits< RNDACC_ITR_NEEDLE >::value_type value_type
Definition bslstl_boyermoorehorspoolsearcher.h:1015
BoyerMooreHorspoolSearcher & operator=(const BoyerMooreHorspoolSearcher &rhs)
Definition bslstl_boyermoorehorspoolsearcher.h:2071
HASH hash() const
Return the hashing functor supplied on construction.
Definition bslstl_boyermoorehorspoolsearcher.h:2182
bsl::equal_to< typename bsl::iterator_traits< RNDACC_ITR_NEEDLE >::value_type > DefaultEqual
the default type for the EQUAL optional template parameter
Definition bslstl_boyermoorehorspoolsearcher.h:1025
RNDACC_ITR_NEEDLE needleLast() const
Definition bslstl_boyermoorehorspoolsearcher.h:2171
bsl::hash< typename bsl::iterator_traits< RNDACC_ITR_NEEDLE >::value_type > DefaultHash
the default type for the HASH optional template parameter
Definition bslstl_boyermoorehorspoolsearcher.h:1020
RNDACC_ITR_NEEDLE needleFirst() const
Definition bslstl_boyermoorehorspoolsearcher.h:2160
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#define BSLS_KEYWORD_NOEXCEPT
Definition bsls_keyword.h:632
Definition bdlb_printmethods.h:283
T::const_iterator cend(const T &container)
Definition bslstl_iterator.h:1611
T::const_iterator cbegin(const T &container)
Definition bslstl_iterator.h:1553
Definition balxml_encoderoptions.h:68
Definition bslstl_algorithm.h:82
Definition bslstl_array.h:290
BSLS_KEYWORD_CONSTEXPR_CPP14 pointer data() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_array.h:928
BSLS_KEYWORD_CONSTEXPR_CPP14 iterator end() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_array.h:740
void swap(array &rhs) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(bsl BSLS_KEYWORD_CONSTEXPR_CPP14 iterator begin() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_array.h:354
Definition bslmf_conditional.h:120
Definition bslstl_equalto.h:311
Definition bslstl_hash.h:498
Definition bslmf_issame.h:146
Definition bslma_usesbslmaallocator.h:343
Definition bslmf_isbitwisecopyable.h:298
Definition bslmf_isbitwiseequalitycomparable.h:499