Libosmium
2.20.0
Fast and flexible C++ library for working with OpenStreetMap data
|
#include <compression.hpp>
Public Types | |
using | create_compressor_type = std::function< osmium::io::Compressor *(int, fsync)> |
using | create_decompressor_type_fd = std::function< osmium::io::Decompressor *(int)> |
using | create_decompressor_type_buffer = std::function< osmium::io::Decompressor *(const char *, std::size_t)> |
Public Member Functions | |
CompressionFactory (const CompressionFactory &)=delete | |
CompressionFactory & | operator= (const CompressionFactory &)=delete |
CompressionFactory (CompressionFactory &&)=delete | |
CompressionFactory & | operator= (CompressionFactory &&)=delete |
~CompressionFactory () noexcept=default | |
bool | register_compression (osmium::io::file_compression compression, const create_compressor_type &create_compressor, const create_decompressor_type_fd &create_decompressor_fd, const create_decompressor_type_buffer &create_decompressor_buffer) |
template<typename... TArgs> | |
std::unique_ptr< osmium::io::Compressor > | create_compressor (const osmium::io::file_compression compression, TArgs &&... args) const |
std::unique_ptr< osmium::io::Decompressor > | create_decompressor (const osmium::io::file_compression compression, const int fd) const |
std::unique_ptr< osmium::io::Decompressor > | create_decompressor (const osmium::io::file_compression compression, const char *buffer, const std::size_t size) const |
Static Public Member Functions | |
static CompressionFactory & | instance () |
Private Types | |
using | callbacks_type = std::tuple< create_compressor_type, create_decompressor_type_fd, create_decompressor_type_buffer > |
using | compression_map_type = std::map< const osmium::io::file_compression, callbacks_type > |
Private Member Functions | |
CompressionFactory ()=default | |
const callbacks_type & | find_callbacks (const osmium::io::file_compression compression) const |
Private Attributes | |
compression_map_type | m_callbacks |
This singleton factory class is used to register compression algorithms used for reading and writing OSM files.
For each algorithm we store two functions that construct a compressor and decompressor object, respectively.
|
private |
|
private |
using osmium::io::CompressionFactory::create_compressor_type = std::function<osmium::io::Compressor*(int, fsync)> |
using osmium::io::CompressionFactory::create_decompressor_type_buffer = std::function<osmium::io::Decompressor*(const char*, std::size_t)> |
using osmium::io::CompressionFactory::create_decompressor_type_fd = std::function<osmium::io::Decompressor*(int)> |
|
privatedefault |
|
delete |
|
delete |
|
defaultnoexcept |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
|
inlinestatic |
|
delete |
|
delete |
|
inline |
|
private |