pstore2
Public Member Functions | List of all members
pstore::region::mem_based_factory Class Referencefinal
Inheritance diagram for pstore::region::mem_based_factory:
Inheritance graph
[legend]
Collaboration diagram for pstore::region::mem_based_factory:
Collaboration graph
[legend]

Public Member Functions

 mem_based_factory (std::shared_ptr< file::in_memory > file, std::uint64_t full_size, std::uint64_t min_size)
 
std::vector< memory_mapper_ptr > init () override
 Creates the memory mapping objects for the given database file. More...
 
void add (gsl::not_null< std::vector< memory_mapper_ptr > *> regions, std::uint64_t original_size, std::uint64_t new_size) override
 
std::shared_ptr< file::file_basefile () override
 
- Public Member Functions inherited from pstore::region::factory
std::uint64_t full_size () const noexcept
 
std::uint64_t min_size () const noexcept
 

Additional Inherited Members

- Protected Member Functions inherited from pstore::region::factory
constexpr factory (std::uint64_t const full_size, std::uint64_t const min_size) noexcept
 
template<typename File , typename MemoryMapper >
auto create (std::shared_ptr< File > file) -> std::vector< memory_mapper_ptr >
 
template<typename File , typename MemoryMapper >
void append (std::shared_ptr< File > file, gsl::not_null< std::vector< memory_mapper_ptr > *> regions, std::uint64_t original_size, std::uint64_t new_size)
 

Constructor & Destructor Documentation

◆ mem_based_factory()

pstore::region::mem_based_factory::mem_based_factory ( std::shared_ptr< file::in_memory file,
std::uint64_t  full_size,
std::uint64_t  min_size 
)
explicit
Parameters
fileAn open file containing the data to be memory-mapped.
full_sizeThe size of the largest memory-mapped file region.
min_sizeThe size of the smallest memory-mapped file region.

Member Function Documentation

◆ init()

auto pstore::region::mem_based_factory::init ( )
overridevirtual

Creates the memory mapping objects for the given database file.

Memory map the file regions. Creates an array of memory-mapped regions. This will consist of a number of entries whose size is equal to full_region_size followed by a number of entries of min_size bytes each up to the size of the file. A file whose size is not an exact multiple of min_size will have a single mapped region which extends beyond the (original) end of the file.

Returns
A container of memory mapper objects.

Implements pstore::region::factory.


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