Loading...
Searching...
No Matches
osmium::io::CompressionFactory Class Reference

`#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
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

## Detailed Description

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.

## Member Typedef Documentation

## callbacks_type

using osmium::io::CompressionFactory::callbacks_type

private

Initial value:
std::tuple<create_compressor_type,
create_decompressor_type_fd,
create_decompressor_type_buffer>
osmium::io::CompressionFactory::create_compressor_type
std::function< osmium::io::Compressor *(int, fsync)> create_compressor_type
Definition compression.hpp:152
osmium::io::CompressionFactory::create_decompressor_type_fd
std::function< osmium::io::Decompressor *(int)> create_decompressor_type_fd
Definition compression.hpp:153
osmium::io::CompressionFactory::create_decompressor_type_buffer
std::function< osmium::io::Decompressor *(const char *, std::size_t)> create_decompressor_type_buffer
Definition compression.hpp:154

## compression_map_type

using osmium::io::CompressionFactory::compression_map_type = std::map<const osmium::io::file_compression, callbacks_type>

private

## create_compressor_type

using osmium::io::CompressionFactory::create_compressor_type = std::function<osmium::io::Compressor*(int, fsync)>

## create_decompressor_type_buffer

using osmium::io::CompressionFactory::create_decompressor_type_buffer = std::function<osmium::io::Decompressor*(const char*, std::size_t)>

## create_decompressor_type_fd

using osmium::io::CompressionFactory::create_decompressor_type_fd = std::function<osmium::io::Decompressor*(int)>

## Constructor & Destructor Documentation

## CompressionFactory() [1/3]

osmium::io::CompressionFactory::CompressionFactory | ( |  | ) |

private default

## CompressionFactory() [2/3]

osmium::io::CompressionFactory::CompressionFactory | ( | const CompressionFactory & |  | ) |

delete

## CompressionFactory() [3/3]

osmium::io::CompressionFactory::CompressionFactory | ( | CompressionFactory && |  | ) |

delete

## ~CompressionFactory()

osmium::io::CompressionFactory::~CompressionFactory | ( |  | ) |

default noexcept

## Member Function Documentation

## create_compressor()

template<typename... TArgs>

std::unique_ptr< osmium::io::Compressor > osmium::io::CompressionFactory::create_compressor | ( | const osmium::io::file_compression | compression,
|  | TArgs &&... | args ) const

inline

## create_decompressor() [1/2]

std::unique_ptr< osmium::io::Decompressor > osmium::io::CompressionFactory::create_decompressor | ( | const osmium::io::file_compression | compression,
|  | const char * | buffer,
|  | const std::size_t | size ) const

inline

## create_decompressor() [2/2]

std::unique_ptr< osmium::io::Decompressor > osmium::io::CompressionFactory::create_decompressor | ( | const osmium::io::file_compression | compression,
|  | const int | fd ) const

inline

## find_callbacks()

const callbacks_type & osmium::io::CompressionFactory::find_callbacks | ( | const osmium::io::file_compression | compression | ) | const

inline private

## instance()

static CompressionFactory & osmium::io::CompressionFactory::instance | ( |  | ) |

inline static

## operator=() [1/2]

CompressionFactory & osmium::io::CompressionFactory::operator= | ( | CompressionFactory && |  | ) |

delete

## operator=() [2/2]

CompressionFactory & osmium::io::CompressionFactory::operator= | ( | const CompressionFactory & |  | ) |

delete

## register_compression()

bool osmium::io::CompressionFactory::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 )

inline

## Member Data Documentation

## m_callbacks

compression_map_type osmium::io::CompressionFactory::m_callbacks

private

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

- include/osmium/io/compression.hpp