ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
Loading...
Searching...
No Matches
MMappedUUIDHashTable::table_t Struct Reference

On-disk layout of the hash table stored in the mmap file. More...

Collaboration diagram for MMappedUUIDHashTable::table_t:

Public Member Functions

constexpr unsigned long capacity ()
 Maximum number of slots in the table (2^log_size).
 

Static Public Member Functions

static constexpr std::size_t sizeForLogSize (unsigned ls)
 Compute the file size required for a table with 2^ls slots.
 
static constexpr unsigned logSizeForSize (std::size_t size)
 Compute the log2 of the slot count from the file size.
 

Public Attributes

unsigned log_size
 log2 of the number of slots
 
unsigned long nb_elements
 Current number of stored key-value pairs.
 
unsigned long next_value
 Next integer value to assign to a new UUID.
 
value_t t []
 Flexible array of hash-table slots.
 

Detailed Description

On-disk layout of the hash table stored in the mmap file.

The header fields are followed by a flexible array of value_t slots.

Definition at line 50 of file MMappedUUIDHashTable.h.

Member Function Documentation

◆ capacity()

constexpr unsigned long MMappedUUIDHashTable::table_t::capacity ( )
inlineconstexpr

Maximum number of slots in the table (2^log_size).

Returns
Current capacity (number of available hash-table slots).

Definition at line 79 of file MMappedUUIDHashTable.h.

Here is the caller graph for this function:

◆ logSizeForSize()

static constexpr unsigned MMappedUUIDHashTable::table_t::logSizeForSize ( std::size_t  size)
inlinestaticconstexpr

Compute the log2 of the slot count from the file size.

Parameters
sizeFile size in bytes.
Returns
Log2 of the number of slots that fit in size.

Definition at line 64 of file MMappedUUIDHashTable.h.

Here is the caller graph for this function:

◆ sizeForLogSize()

static constexpr std::size_t MMappedUUIDHashTable::table_t::sizeForLogSize ( unsigned  ls)
inlinestaticconstexpr

Compute the file size required for a table with 2^ls slots.

Parameters
lsLog2 of the desired slot count.
Returns
Required file size in bytes.

Definition at line 56 of file MMappedUUIDHashTable.h.

Here is the caller graph for this function:

Member Data Documentation

◆ log_size

unsigned MMappedUUIDHashTable::table_t::log_size

log2 of the number of slots

Definition at line 83 of file MMappedUUIDHashTable.h.

◆ nb_elements

unsigned long MMappedUUIDHashTable::table_t::nb_elements

Current number of stored key-value pairs.

Definition at line 84 of file MMappedUUIDHashTable.h.

◆ next_value

unsigned long MMappedUUIDHashTable::table_t::next_value

Next integer value to assign to a new UUID.

Definition at line 85 of file MMappedUUIDHashTable.h.

◆ t

value_t MMappedUUIDHashTable::table_t::t[]

Flexible array of hash-table slots.

Definition at line 86 of file MMappedUUIDHashTable.h.


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