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

uint64_t magic
 File-type identifier.
uint16_t version
 Format version (currently 1).
uint16_t elem_size
 sizeof(value_t) at write time
uint32_t _reserved
 Padding, must be 0.
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 51 of file MMappedUUIDHashTable.h.

Member Function Documentation

◆ capacity()

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 80 of file MMappedUUIDHashTable.h.

◆ logSizeForSize()

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 65 of file MMappedUUIDHashTable.h.

Here is the caller graph for this function:

◆ sizeForLogSize()

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 57 of file MMappedUUIDHashTable.h.

Here is the caller graph for this function:

Member Data Documentation

◆ _reserved

uint32_t MMappedUUIDHashTable::table_t::_reserved

Padding, must be 0.

Definition at line 87 of file MMappedUUIDHashTable.h.

◆ elem_size

uint16_t MMappedUUIDHashTable::table_t::elem_size

sizeof(value_t) at write time

Definition at line 86 of file MMappedUUIDHashTable.h.

◆ log_size

unsigned MMappedUUIDHashTable::table_t::log_size

log2 of the number of slots

Definition at line 88 of file MMappedUUIDHashTable.h.

◆ magic

uint64_t MMappedUUIDHashTable::table_t::magic

File-type identifier.

Definition at line 84 of file MMappedUUIDHashTable.h.

◆ nb_elements

unsigned long MMappedUUIDHashTable::table_t::nb_elements

Current number of stored key-value pairs.

Definition at line 89 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 90 of file MMappedUUIDHashTable.h.

◆ t

value_t MMappedUUIDHashTable::table_t::t[]

Flexible array of hash-table slots.

Definition at line 91 of file MMappedUUIDHashTable.h.

◆ version

uint16_t MMappedUUIDHashTable::table_t::version

Format version (currently 1).

Definition at line 85 of file MMappedUUIDHashTable.h.


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