CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AbstractHashFilter Class Referenceabstract

#include <hash_filter.h>

Inheritance diagram for AbstractHashFilter:

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

Detailed Description

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.

Constructor & Destructor Documentation

virtual AbstractHashFilter::~AbstractHashFilter ( )

Definition at line 22 of file hash_filter.h.

Member Function Documentation

virtual bool AbstractHashFilter::Contains ( const shash::Any hash) const
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.

hashthe hash to be queried
true if the hash is (probably) contained in the set false if it is definitely not in the set

Implemented in SmallhashFilter, and SimpleHashFilter.

virtual size_t AbstractHashFilter::Count ( ) const
pure virtual

Returns the number of objects already inserted into the filter.

number of objects in the filter

Implemented in SmallhashFilter, and SimpleHashFilter.

virtual void AbstractHashFilter::Fill ( const shash::Any hash)
pure virtual

Adds the given hash to the filter

hashthe hash to be added to the HashFilter

Implemented in SmallhashFilter, and SimpleHashFilter.

virtual void AbstractHashFilter::Freeze ( )

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.

The documentation for this class was generated from the following file: