osmium::io::CompressionFactory Class Reference

`#include <compression.hpp>`

## Public Types

typedef std::function< osmium::io::Compressor *(int, fsync)> | create_compressor_type
typedef std::function< osmium::io::Decompressor *(int)> | create_decompressor_type_fd
typedef std::function< osmium::io::Decompressor *(const char *, size_t)> | create_decompressor_type_buffer

## Public Member Functions

bool | register_compression (osmium::io::file_compression compression, create_compressor_type create_compressor, create_decompressor_type_fd create_decompressor_fd, create_decompressor_type_buffer create_decompressor_buffer)
template<typename... TArgs>
std::unique_ptr< osmium::io::Compressor > | create_compressor (osmium::io::file_compression compression, TArgs &&...args)
std::unique_ptr< osmium::io::Decompressor > | create_decompressor (osmium::io::file_compression compression, int fd)
std::unique_ptr< osmium::io::Decompressor > | create_decompressor (osmium::io::file_compression compression, const char *buffer, size_t size)

## Static Public Member Functions

static CompressionFactory & | instance ()

## Private Types

typedef std::map< const osmium::io::file_compression, std::tuple< create_compressor_type, create_decompressor_type_fd, create_decompressor_type_buffer > > | compression_map_type

## Private Member Functions

| CompressionFactory ()=default
| CompressionFactory (const CompressionFactory &)=delete
CompressionFactory & | operator= (const CompressionFactory &)=delete
| CompressionFactory (CompressionFactory &&)=delete
CompressionFactory & | operator= (CompressionFactory &&)=delete
OSMIUM_NORETURN void | error (osmium::io::file_compression compression)

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

typedef std::map<const osmium::io::file_compression, std::tuple<create_compressor_type, create_decompressor_type_fd, create_decompressor_type_buffer> > osmium::io::CompressionFactory::compression_map_type

private

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

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

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

## Constructor & Destructor Documentation

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

private default

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

private delete

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

private delete

## Member Function Documentation

template<typename... TArgs>

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

inline

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

inline

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

inline

OSMIUM_NORETURN void osmium::io::CompressionFactory::error | ( | osmium::io::file_compression | compression | ) |

inline private

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

inline static

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

private delete

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

private delete

bool osmium::io::CompressionFactory::register_compression | ( | osmium::io::file_compression | compression,
|  | create_compressor_type | create_compressor,
|  | create_decompressor_type_fd | create_decompressor_fd,
|  | create_decompressor_type_buffer | create_decompressor_buffer
| ) |  |

inline

## Member Data Documentation

compression_map_type osmium::io::CompressionFactory::m_callbacks

private

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

- osmium/io/compression.hpp