File indexing completed on 2026-08-17 08:39:06
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef BOOST_BLOOM_MULTIBLOCK_HPP
0010 #define BOOST_BLOOM_MULTIBLOCK_HPP
0011
0012 #include <boost/bloom/detail/block_base.hpp>
0013 #include <boost/bloom/detail/block_ops.hpp>
0014 #include <boost/bloom/detail/multiblock_fpr_base.hpp>
0015 #include <boost/config.hpp>
0016 #include <boost/config/workaround.hpp>
0017 #include <cstddef>
0018 #include <cstdint>
0019
0020 namespace boost{
0021 namespace bloom{
0022
0023 template<typename Block,std::size_t K>
0024 struct multiblock:
0025 public detail::multiblock_fpr_base<K>,
0026 private detail::block_base<Block,K>
0027 {
0028 static constexpr std::size_t k=K;
0029 using value_type=Block[k];
0030
0031
0032 static inline void mark(value_type& x,std::uint64_t hash)
0033 {
0034 std::size_t i=0;
0035 loop(hash,[&](std::uint64_t h){block_ops::set(x[i++],h&mask);});
0036 }
0037
0038 #if BOOST_WORKAROUND(BOOST_MSVC,<=1900)
0039
0040 #pragma warning(push)
0041 #pragma warning(disable:4800)
0042 #endif
0043
0044
0045 static inline bool check(const value_type& x,std::uint64_t hash)
0046 {
0047 int res=1;
0048 std::size_t i=0;
0049 loop(hash,[&](std::uint64_t h){block_ops::reduce(res,x[i++],h&mask);});
0050 return res;
0051 }
0052
0053 #if BOOST_WORKAROUND(BOOST_MSVC,<=1900)
0054 #pragma warning(pop)
0055 #endif
0056
0057 private:
0058 using super=detail::block_base<Block,K>;
0059 using super::mask;
0060 using super::loop;
0061 using block_ops=detail::block_ops<Block>;
0062 };
0063
0064 }
0065 }
0066 #endif