The base class for hash policies.
More...
#include <hash.h>
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:
-
The | type of the derived policy. |
Definition at line 58 of file hash.h.
Member Function Documentation
template<typename Derived>
template<typename T , typename F >
Apply a function \(k\) times to \(h_i(x)\) to test whether it is true
on all of the hash values.
- Template Parameters:
-
T | The type of item \(x\). |
F | The unary functor to apply to \(h_i(x)\). |
- Parameters:
-
x | The item \(x\). |
f | The 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 |
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:
-
T | The type of item \(x\). |
F | The unary functor to apply to \((h_i(x), i)\). |
- Parameters:
-
x | The item \(x\). |
f | The 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 >
Apply a function \(k\) times to \(h_i(x)\) to test whether it is true
on any of the hash values.
- Template Parameters:
-
T | The type of item \(x\). |
F | The unary functor to apply to \((h_i(x), i)\). |
- Parameters:
-
x | The item \(x\). |
f | The 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 |
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:
-
T | The type of item \(x\). |
F | The unary functor to apply to \((h_i(x), i)\). |
- Parameters:
-
x | The item \(x\). |
f | The 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 >
Apply a function \(k\) times to the hash values of \(x\).
- Template Parameters:
-
T | The type of item \(x\). |
F | The unary functor to apply to \(h_(x)\). |
- Parameters:
-
x | The item \(x\). |
f | The 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 |
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:
-
T | The type of item \(x\). |
F | The binary functor to apply to \((h_i(x), i)\). |
- Parameters:
-
x | The item \(x\). |
f | The functor instance. |
Definition at line 116 of file hash.h.
The documentation for this class was generated from the following file: