pstore2
Public Member Functions | List of all members
pstore::indirect_string_adder Class Reference

indirect_string_adder is a helper class which handles the details of adding strings to the "indirect" index. More...

#include <indirect_string.hpp>

Public Member Functions

 indirect_string_adder (std::size_t expected_size)
 
template<typename Index >
std::pair< typename Index::iterator, bool > add (transaction_base &transaction, std::shared_ptr< Index > const &index, gsl::not_null< raw_sstring_view const *> str)
 
void flush (transaction_base &transaction)
 

Detailed Description

indirect_string_adder is a helper class which handles the details of adding strings to the "indirect" index.

To ensure that the string addresses cluster tightly, we must write in two phases. The first phase adds the entries to the index. A consequence of adding a string that is not already present in the index is that its indirect_string record is written immediately to the store. Once all of the strings have been added, we must then write their bodies (the string's actual character array, in other words). The bodies must be aligned according to indirect_string's requirements.

Constructor & Destructor Documentation

◆ indirect_string_adder()

pstore::indirect_string_adder::indirect_string_adder ( std::size_t  expected_size)
explicit
Parameters
expected_sizeThe anticipated number of strings being added to the index. The class records each of the added indirect strings in order that these addresses can be patched once the string bodies have been written.

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