![]() |
CernVM-FS
2.13.0
|
#include <hash_filter.h>
Public Member Functions | |
virtual | ~AbstractHashFilter () |
virtual void | Fill (const shash::Any &hash)=0 |
virtual bool | Contains (const shash::Any &hash) const =0 |
virtual void | Freeze () |
virtual size_t | Count () const =0 |
This file is part of the CernVM File System.
HashFilters are a container classes that get initialized with a number of hashes. Later they can serve queries for other hashes and decide if they are contained in the filter or not. Abstract base class of a HashFilter to define the common interface.
Definition at line 20 of file hash_filter.h.
|
inlinevirtual |
Definition at line 22 of file hash_filter.h.
|
pure virtual |
Decides if a presented hash is in the filter or not Depending on the concrete implementation of this method it could be a prob- abilistic answer. However, implementations should ensure a recall rate of 100%, say: never produce false negatives.
hash | the hash to be queried |
Implemented in SmallhashFilter, and SimpleHashFilter.
|
pure virtual |
Returns the number of objects already inserted into the filter.
Implemented in SmallhashFilter, and SimpleHashFilter.
|
pure virtual |
Adds the given hash to the filter
hash | the hash to be added to the HashFilter |
Implemented in SmallhashFilter, and SimpleHashFilter.
|
inlinevirtual |
Freezes the filter after filling it with all values. This is not necessary but could be used for certain optimizations depending on the implementation of the AbstractHashFilter. Note: After Freeze() has been called, Fill() should fail!
Reimplemented in SmallhashFilter, and SimpleHashFilter.
Definition at line 49 of file hash_filter.h.