33#include "params/BloomFilterMulti.hh"
42 :
Base(
p), filters(
p.filters)
53 for (
auto& sub_filter :
filters) {
61 auto* cast_other =
static_cast<const Multi*
>(other);
62 assert(
filters.size() == cast_other->filters.size());
64 filters[
i]->merge(cast_other->filters[
i]);
71 for (
auto& sub_filter :
filters) {
72 sub_filter->set(
addr);
79 for (
auto& sub_filter :
filters) {
80 sub_filter->unset(
addr);
88 for (
const auto& sub_filter :
filters) {
89 if (sub_filter->isSet(
addr)) {
100 for (
const auto& sub_filter :
filters) {
110 for (
const auto& sub_filter :
filters) {
111 count += sub_filter->getTotalCount();
const int setThreshold
Threshold at which a filter entry starts being considered as set.
virtual void clear()
Clear the filter by resetting all values.
This BloomFilter has multiple sub-filters, each with its own hashing functionality.
bool isSet(Addr addr) const override
Check if the corresponding filter entries of an address should be considered as set.
void unset(Addr addr) override
Perform the filter specific function to clear the corresponding entries (can be multiple) of an addre...
std::vector< Base * > filters
Sub-filters used by this filter.
int getCount(Addr addr) const override
Get the value stored in the corresponding filter entry of an address.
int getTotalCount() const override
Get the total value stored in the filter entries.
void merge(const Base *other) override
Merges the contents of both filters into this' (Bloom Filter union).
void clear() override
Clear the filter by resetting all values.
Multi(const BloomFilterMultiParams &p)
void set(Addr addr) override
Perform the filter specific function to set the corresponding entries (can be multiple) of an address...
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.