An mmap storage.
More...
#include <mmap_storage.hpp>
|
| mmap_storage (const boost::interprocess::file_mapping &file_mapping_, std::size_t content_offset, std::size_t file_size, value_deserializer value_deserializer_, std::size_t value_cache_capacity=default_value_cache_capacity()) |
| Creates an mmap storage.
|
|
virtual | ~mmap_storage () |
| Destroys the mmap storage.
|
|
| storage () |
| Creates a storage.
|
|
virtual | ~storage () |
| Destroys the storage.
|
|
std::size_t | base_check_size () const |
| Returns the base-check size.
|
|
std::int32_t | base_at (std::size_t base_check_index) const |
| Returns the base value.
|
|
void | set_base_at (std::size_t base_check_index, std::int32_t base) |
| Sets a base value.
|
|
std::uint8_t | check_at (std::size_t base_check_index) const |
| Returns the check value.
|
|
void | set_check_at (std::size_t base_check_index, std::uint8_t check) |
| Sets a check value.
|
|
std::size_t | value_count () const |
| Returns the value count.
|
|
const std::any * | value_at (std::size_t value_index) const |
| Returns the value object.
|
|
void | add_value_at (std::size_t value_index, std::any value) |
| Adds a value object.
|
|
double | filling_rate () const |
| Returns the filling rate.
|
|
void | serialize (std::ostream &output_stream, const value_serializer &value_serializer_) const |
| Serializes this storage.
|
|
std::unique_ptr< storage > | clone () const |
| Clones this storage.
|
|
◆ mmap_storage()
tetengo::trie::mmap_storage::mmap_storage |
( |
const boost::interprocess::file_mapping & |
file_mapping_, |
|
|
std::size_t |
content_offset, |
|
|
std::size_t |
file_size, |
|
|
value_deserializer |
value_deserializer_, |
|
|
std::size_t |
value_cache_capacity = default_value_cache_capacity() |
|
) |
| |
Creates an mmap storage.
- Parameters
-
file_mapping_ | A file mapping. |
content_offset | A content offset in the file. |
file_size | The file size. |
value_deserializer_ | A deserializer for value objects. |
value_cache_capacity | A value cache capacity. |
- Exceptions
-
std::invalid_argument | When content_offset is greater than file_size, or the value size is not fixed. |
◆ default_value_cache_capacity()
static std::size_t tetengo::trie::mmap_storage::default_value_cache_capacity |
( |
| ) |
|
|
static |
Returns the default value cache capacity.
- Returns
- The default value cache capacity.
The documentation for this class was generated from the following file: