源码可在https://github.com/learnmoreonce/SLAM 下载
源码分析文件:common/port.h
/*
common-port.h文件主要实现2大功能:
1,使用std::lround对浮点数进行四舍五入取整运算
2,利用boost的iostreams/filter/gzip对字符串压缩与解压缩
*/
#ifndef CARTOGRAPHER_COMMON_PORT_H_
#define CARTOGRAPHER_COMMON_PORT_H_
#include <cinttypes>
#include <cmath>
#include <string>
#include <boost/iostreams/device/back_inserter.hpp>
#include <boost/iostreams/filter/gzip.hpp> //包含多种解压与压缩算法
#include <boost/iostreams/filtering_stream.hpp>//配合filter实现流过滤
using int8 = int8_t;
using int16 = int16_t;
using int32 = int32_t;
using int64 = int64_t;