Simple Application Framework
1
|
Unordered set container. More...
#include <HashSet.h>
Public Member Functions | |
HashSet (Size bucketHint=0) | |
Default constructor. | |
HashSet (const MyType &hs) | |
Copy constructor. | |
MyType & | operator= (const MyType &hs) |
Assignment operator. | |
MyType & | Swap (MyType &hs) |
Swap the content of two hash sets. | |
Protected Types | |
typedef Algo::Struct::HashTable < ValType, ValType, Algo::Identity< ValType > , HashFuncType, HashPolicyType, CompType > | BaseType |
typedef HashSet< ValType, HashFuncType, HashPolicyType, CompType > | MyType |
Unordered set container.
The container stores a collection of values where each value can appear only once in the set. Internally, the data are stored in an unordered list and a hash table is used to enable fast insert, erase and look-up of the values. If a hash function is chosen appropriately, all these operations can be performed in amortized constant time.
Iterator category: Bidirectional.
ValType | Data type of the elements of the set. |
HashFuncType | Unary hash functor that takes values of ValType and returns a value of type Saf::Size. |
HashPolicyType | Hash policy object that controls which hashes map to which buckets and when and how to enlarge the bucket count. The policy should never allow zero bucket count. |
CompType | A binary equality predicate on ValType . Values that have the same hash must be equal according to this predicate. |
typedef Algo::Struct::HashTable<ValType,ValType,Algo::Identity<ValType>,HashFuncType,HashPolicyType,CompType> Saf::Collection::HashSet< ValType, HashFuncType, HashPolicyType, CompType >::BaseType [protected] |
typedef HashSet<ValType,HashFuncType,HashPolicyType,CompType> Saf::Collection::HashSet< ValType, HashFuncType, HashPolicyType, CompType >::MyType [protected] |
Saf::Collection::HashSet< ValType, HashFuncType, HashPolicyType, CompType >::HashSet | ( | Size | bucketHint = 0 | ) | [inline, explicit] |
Default constructor.
[in] | bucketHint | Minimum initial number of buckets in the hash table. The actual number of buckets may be higher depending on the hash policy. |
Saf::Collection::HashSet< ValType, HashFuncType, HashPolicyType, CompType >::HashSet | ( | const MyType & | hs | ) | [inline] |
Copy constructor.
MyType& Saf::Collection::HashSet< ValType, HashFuncType, HashPolicyType, CompType >::operator= | ( | const MyType & | hs | ) | [inline] |
Assignment operator.
MyType& Saf::Collection::HashSet< ValType, HashFuncType, HashPolicyType, CompType >::Swap | ( | MyType & | hs | ) | [inline] |
Swap the content of two hash sets.
Properties: