CernVM-FS
2.12.0
|
#include <hash_filter.h>
Public Member Functions | |
SimpleHashFilter () | |
void | Fill (const shash::Any &hash) |
bool | Contains (const shash::Any &hash) const |
void | Freeze () |
size_t | Count () const |
Public Member Functions inherited from AbstractHashFilter | |
virtual | ~AbstractHashFilter () |
Private Attributes | |
std::set< shash::Any > | hashes_ |
bool | frozen_ |
This is a simplistic implementation of AbstractHashFilter mainly used for testing purposes. It uses an std::set and thus is highly suboptimal.
Definition at line 66 of file hash_filter.h.
|
inline |
Definition at line 68 of file hash_filter.h.
|
inlinevirtual |
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 |
Implements AbstractHashFilter.
Definition at line 75 of file hash_filter.h.
|
inlinevirtual |
Returns the number of objects already inserted into the filter.
Implements AbstractHashFilter.
Definition at line 80 of file hash_filter.h.
|
inlinevirtual |
Adds the given hash to the filter
hash | the hash to be added to the HashFilter |
Implements AbstractHashFilter.
Definition at line 70 of file hash_filter.h.
|
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 from AbstractHashFilter.
Definition at line 79 of file hash_filter.h.
|
private |
Definition at line 84 of file hash_filter.h.
|
private |
Definition at line 83 of file hash_filter.h.
Referenced by Contains(), Count(), and Fill().