libcuckoo  0.3.1
Classes | Public Types | Public Member Functions | Friends | List of all members
libcuckoo::bucket_container< Key, T, Allocator, Partial, SLOT_PER_BUCKET > Class Template Reference

#include <bucket_container.hh>

Classes

class  bucket
 

Public Types

using key_type = Key
 
using mapped_type = T
 
using value_type = std::pair< const Key, T >
 
using allocator_type = typename traits_::allocator_type
 
using partial_t = Partial
 
using size_type = typename traits_::size_type
 
using reference = value_type &
 
using const_reference = const value_type &
 
using pointer = typename traits_::pointer
 
using const_pointer = typename traits_::const_pointer
 

Public Member Functions

 bucket_container (size_type hp, const allocator_type &allocator)
 
 bucket_container (const bucket_container &bc)
 
 bucket_container (const bucket_container &bc, const allocator_type &a)
 
 bucket_container (bucket_container &&bc)
 
 bucket_container (bucket_container &&bc, const allocator_type &a)
 
bucket_containeroperator= (const bucket_container &bc)
 
bucket_containeroperator= (bucket_container &&bc)
 
void swap (bucket_container &bc) noexcept
 
size_type hashpower () const
 
void hashpower (size_type val)
 
size_type size () const
 
allocator_type get_allocator () const
 
bucketoperator[] (size_type i)
 
const bucketoperator[] (size_type i) const
 
template<typename K , typename... Args>
void setKV (size_type ind, size_type slot, partial_t p, K &&k, Args &&... args)
 
void eraseKV (size_type ind, size_type slot)
 
void clear () noexcept
 
void clear_and_deallocate () noexcept
 
bool is_deallocated () const noexcept
 

Friends

template<typename ThisKey , typename ThisT >
std::enable_if< std::is_trivial< ThisKey >::value &&std::is_trivial< ThisT >::value, std::ostream & >::type operator<< (std::ostream &os, const bucket_container< ThisKey, ThisT, Allocator, Partial, SLOT_PER_BUCKET > &bc)
 
template<typename ThisKey , typename ThisT >
std::enable_if< std::is_trivial< ThisKey >::value &&std::is_trivial< ThisT >::value, std::istream & >::type operator>> (std::istream &is, bucket_container< ThisKey, ThisT, Allocator, Partial, SLOT_PER_BUCKET > &bc)
 

Detailed Description

template<class Key, class T, class Allocator, class Partial, std::size_t SLOT_PER_BUCKET>
class libcuckoo::bucket_container< Key, T, Allocator, Partial, SLOT_PER_BUCKET >

bucket_container manages storage of key-value pairs for the table. It stores the items inline in uninitialized memory, and keeps track of which slots have live data and which do not. It also stores a partial hash for each live key. It is sized by powers of two.

Template Parameters
Keytype of keys in the table
Ttype of values in the table
Allocatortype of key-value pair allocator
Partialtype of partial keys
SLOT_PER_BUCKETnumber of slots for each bucket in the table

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