libBf 0.1
Public Member Functions | Private Member Functions

bf::hash_policy< Derived > Class Template Reference

The base class for hash policies. More...

#include <hash.h>

Inheritance diagram for bf::hash_policy< Derived >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

template<typename T , typename F >
void each (const T &x, F f) const
 Apply a function \(k\) times to the hash values of \(x\).
template<typename T , typename F >
bool any (const T &x, F f) const
 Apply a function \(k\) times to \(h_i(x)\) to test whether it is true on any of the hash values.
template<typename T , typename F >
bool all (const T &x, F f) const
 Apply a function \(k\) times to \(h_i(x)\) to test whether it is true on all of the hash values.
template<typename T , typename F >
void each_with_index (const T &x, F f) const
 Apply a function \(k\) times to the pair \((h_i(x), i)\) where \(i\) is the index of the \(i^{\mathrm{th}}\) hash function.
template<typename T , typename F >
bool any_with_index (const T &x, F f) const
 Apply a function \(k\) times to the pair \((h_i(x), i)\), where \(i\) is the index of the \(i^{\mathrm{th}}\) hash function, and return true as soon as \(f\) returns true for the first time.
template<typename T , typename F >
bool all_with_index (const T &x, F f) const
 Apply a function \(k\) times to the pair \((h_i(x), i)\), where \(i\) is the index of the \(i^{\mathrm{th}}\) hash function, and return false as soon as \(f\) returns false for the first time.

Private Member Functions

Derived & derived ()
const Derived & derived () const

Detailed Description

template<typename Derived>
class bf::hash_policy< Derived >

The base class for hash policies.

Template Parameters:
Thetype of the derived policy.

Definition at line 58 of file hash.h.


Member Function Documentation

template<typename Derived>
template<typename T , typename F >
bool bf::hash_policy< Derived >::all ( const T &  x,
f 
) const [inline]

Apply a function \(k\) times to \(h_i(x)\) to test whether it is true on all of the hash values.

Template Parameters:
TThe type of item \(x\).
FThe unary functor to apply to \(h_i(x)\).
Parameters:
xThe item \(x\).
fThe functor instance.
Returns:
true if all of the function invocations \(f(h_i(x))\) are true and false otherwise.

Definition at line 100 of file hash.h.

template<typename Derived>
template<typename T , typename F >
bool bf::hash_policy< Derived >::all_with_index ( const T &  x,
f 
) const [inline]

Apply a function \(k\) times to the pair \((h_i(x), i)\), where \(i\) is the index of the \(i^{\mathrm{th}}\) hash function, and return false as soon as \(f\) returns false for the first time.

Otherwise return true.

Template Parameters:
TThe type of item \(x\).
FThe unary functor to apply to \((h_i(x), i)\).
Parameters:
xThe item \(x\).
fThe functor instance.
Returns:
true if all the function invocations \(f(h_i(x), i)\) are true.

Definition at line 155 of file hash.h.

template<typename Derived>
template<typename T , typename F >
bool bf::hash_policy< Derived >::any ( const T &  x,
f 
) const [inline]

Apply a function \(k\) times to \(h_i(x)\) to test whether it is true on any of the hash values.

Template Parameters:
TThe type of item \(x\).
FThe unary functor to apply to \((h_i(x), i)\).
Parameters:
xThe item \(x\).
fThe functor instance.
Returns:
true if any of the function invocations \(f(h_i(x))\) is true.

Definition at line 82 of file hash.h.

template<typename Derived>
template<typename T , typename F >
bool bf::hash_policy< Derived >::any_with_index ( const T &  x,
f 
) const [inline]

Apply a function \(k\) times to the pair \((h_i(x), i)\), where \(i\) is the index of the \(i^{\mathrm{th}}\) hash function, and return true as soon as \(f\) returns true for the first time.

Otherwise return false.

Template Parameters:
TThe type of item \(x\).
FThe unary functor to apply to \((h_i(x), i)\).
Parameters:
xThe item \(x\).
fThe functor instance.
Returns:
true if any of the function invocations \(f(h_i(x), i)\) is true.

Definition at line 134 of file hash.h.

template<typename Derived>
template<typename T , typename F >
void bf::hash_policy< Derived >::each ( const T &  x,
f 
) const [inline]

Apply a function \(k\) times to the hash values of \(x\).

Template Parameters:
TThe type of item \(x\).
FThe unary functor to apply to \(h_(x)\).
Parameters:
xThe item \(x\).
fThe functor instance.

Definition at line 67 of file hash.h.

template<typename Derived>
template<typename T , typename F >
void bf::hash_policy< Derived >::each_with_index ( const T &  x,
f 
) const [inline]

Apply a function \(k\) times to the pair \((h_i(x), i)\) where \(i\) is the index of the \(i^{\mathrm{th}}\) hash function.

Template Parameters:
TThe type of item \(x\).
FThe binary functor to apply to \((h_i(x), i)\).
Parameters:
xThe item \(x\).
fThe functor instance.

Definition at line 116 of file hash.h.


The documentation for this class was generated from the following file:
 All Classes Functions Variables