From 2049ff09c2b41a5ccff693a4a64e517d47a08e4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Thu, 13 Dec 2018 18:45:29 +0100 Subject: [build] rework platform/default directory and add -files.txt for vendored libs --- circle.yml | 4 +- cmake/benchmark-files.txt | 1 - cmake/benchmark.cmake | 2 +- cmake/core-files.txt | 1 - cmake/files.txt.ejs | 3 +- cmake/filesource-files.txt | 28 +- cmake/filesource.cmake | 2 +- cmake/glfw.cmake | 4 +- cmake/loop-uv.cmake | 6 +- cmake/node.cmake | 8 +- cmake/offline.cmake | 4 +- cmake/render.cmake | 2 +- cmake/test-files.txt | 1 - cmake/test.cmake | 2 +- platform/android/config.cmake | 4 +- platform/android/core-files.txt | 37 +- platform/android/filesource-files.txt | 2 +- platform/android/src/file_source.cpp | 2 +- platform/android/src/jni.cpp | 4 +- platform/android/src/text/collator.cpp | 2 +- platform/android/src/unaccent.cpp | 2 +- platform/darwin/filesource-files.txt | 2 +- platform/darwin/include/mbgl/gl/gl_impl.hpp | 22 + .../darwin/include/mbgl/storage/reachability.h | 95 + .../include/mbgl/util/image+MGLAdditions.hpp | 12 + platform/darwin/mbgl/gl/gl_impl.hpp | 22 - platform/darwin/mbgl/storage/reachability.h | 95 - platform/darwin/mbgl/storage/reachability.m | 469 -- platform/darwin/mbgl/util/image+MGLAdditions.hpp | 12 - platform/darwin/src/reachability.m | 469 ++ platform/default/asset_file_source.cpp | 81 - platform/default/async_task.cpp | 66 - platform/default/bidi.cpp | 239 - platform/default/collator.cpp | 79 - platform/default/default_file_source.cpp | 316 -- platform/default/file_source_request.cpp | 37 - platform/default/headless_backend_osmesa.cpp | 47 - platform/default/http_file_source.cpp | 495 -- platform/default/image.cpp | 31 - platform/default/include/jni/string_conversion.hpp | 17 + .../default/include/mbgl/gl/headless_backend.hpp | 50 + .../default/include/mbgl/gl/headless_frontend.hpp | 61 + .../default/include/mbgl/map/map_snapshotter.hpp | 66 + .../include/mbgl/storage/file_source_request.hpp | 31 + .../include/mbgl/storage/merge_sideloaded.hpp | 53 + .../include/mbgl/storage/merge_sideloaded.js | 21 + .../include/mbgl/storage/merge_sideloaded.sql | 51 + .../include/mbgl/storage/offline_database.hpp | 130 + .../include/mbgl/storage/offline_download.hpp | 69 + .../include/mbgl/storage/offline_schema.hpp | 63 + .../default/include/mbgl/storage/offline_schema.js | 21 + .../include/mbgl/storage/offline_schema.sql | 64 + platform/default/include/mbgl/storage/sqlite3.hpp | 180 + platform/default/include/mbgl/text/unaccent.hpp | 13 + .../default/include/mbgl/util/default_styles.hpp | 30 + .../include/mbgl/util/default_thread_pool.hpp | 27 + .../include/mbgl/util/shared_thread_pool.hpp | 9 + platform/default/jni/string_conversion.hpp | 17 - platform/default/jpeg_reader.cpp | 151 - platform/default/layer_manager.cpp | 79 - platform/default/local_file_source.cpp | 81 - platform/default/local_glyph_rasterizer.cpp | 22 - platform/default/logging_stderr.cpp | 12 - platform/default/mbgl/gl/headless_backend.cpp | 85 - platform/default/mbgl/gl/headless_backend.hpp | 50 - platform/default/mbgl/gl/headless_frontend.cpp | 144 - platform/default/mbgl/gl/headless_frontend.hpp | 61 - platform/default/mbgl/map/map_snapshotter.cpp | 224 - platform/default/mbgl/map/map_snapshotter.hpp | 66 - platform/default/mbgl/storage/.clang-tidy | 2 - .../default/mbgl/storage/file_source_request.hpp | 31 - platform/default/mbgl/storage/merge_sideloaded.hpp | 53 - platform/default/mbgl/storage/merge_sideloaded.js | 21 - platform/default/mbgl/storage/merge_sideloaded.sql | 51 - platform/default/mbgl/storage/offline.cpp | 158 - platform/default/mbgl/storage/offline_database.cpp | 1129 ----- platform/default/mbgl/storage/offline_database.hpp | 130 - platform/default/mbgl/storage/offline_download.cpp | 453 -- platform/default/mbgl/storage/offline_download.hpp | 69 - platform/default/mbgl/storage/offline_schema.hpp | 63 - platform/default/mbgl/storage/offline_schema.js | 21 - platform/default/mbgl/storage/offline_schema.sql | 64 - platform/default/mbgl/test/main.cpp | 20 - platform/default/mbgl/util/default_styles.hpp | 30 - platform/default/mbgl/util/default_thread_pool.cpp | 57 - platform/default/mbgl/util/default_thread_pool.hpp | 27 - platform/default/mbgl/util/shared_thread_pool.cpp | 14 - platform/default/mbgl/util/shared_thread_pool.hpp | 9 - platform/default/online_file_source.cpp | 488 -- platform/default/png_reader.cpp | 142 - platform/default/png_writer.cpp | 77 - platform/default/run_loop.cpp | 219 - platform/default/sqlite3.cpp | 494 -- platform/default/sqlite3.hpp | 181 - platform/default/src/mbgl/gl/headless_backend.cpp | 85 + .../src/mbgl/gl/headless_backend_osmesa.cpp | 47 + platform/default/src/mbgl/gl/headless_frontend.cpp | 144 + .../src/mbgl/layermanager/layer_manager.cpp | 79 + platform/default/src/mbgl/map/map_snapshotter.cpp | 224 + .../default/src/mbgl/storage/asset_file_source.cpp | 81 + .../src/mbgl/storage/default_file_source.cpp | 316 ++ .../src/mbgl/storage/file_source_request.cpp | 37 + .../default/src/mbgl/storage/http_file_source.cpp | 495 ++ .../default/src/mbgl/storage/local_file_source.cpp | 81 + platform/default/src/mbgl/storage/offline.cpp | 158 + .../default/src/mbgl/storage/offline_database.cpp | 1129 +++++ .../default/src/mbgl/storage/offline_download.cpp | 453 ++ .../src/mbgl/storage/online_file_source.cpp | 488 ++ platform/default/src/mbgl/storage/sqlite3.cpp | 494 ++ platform/default/src/mbgl/test/main.cpp | 20 + platform/default/src/mbgl/text/bidi.cpp | 239 + platform/default/src/mbgl/text/collator.cpp | 79 + .../src/mbgl/text/local_glyph_rasterizer.cpp | 22 + platform/default/src/mbgl/text/unaccent.cpp | 43 + platform/default/src/mbgl/util/async_task.cpp | 66 + .../default/src/mbgl/util/default_thread_pool.cpp | 57 + platform/default/src/mbgl/util/image.cpp | 31 + platform/default/src/mbgl/util/jpeg_reader.cpp | 151 + platform/default/src/mbgl/util/logging_stderr.cpp | 12 + platform/default/src/mbgl/util/png_reader.cpp | 142 + platform/default/src/mbgl/util/png_writer.cpp | 77 + platform/default/src/mbgl/util/run_loop.cpp | 219 + .../default/src/mbgl/util/shared_thread_pool.cpp | 14 + platform/default/src/mbgl/util/string_stdlib.cpp | 74 + platform/default/src/mbgl/util/thread.cpp | 37 + platform/default/src/mbgl/util/thread_local.cpp | 66 + platform/default/src/mbgl/util/timer.cpp | 73 + platform/default/src/mbgl/util/utf.cpp | 17 + platform/default/string_stdlib.cpp | 74 - platform/default/thread.cpp | 37 - platform/default/thread_local.cpp | 66 - platform/default/timer.cpp | 73 - platform/default/unaccent.cpp | 43 - platform/default/unaccent.hpp | 13 - platform/default/utf.cpp | 17 - platform/ios/config.cmake | 44 +- platform/ios/core-files.txt | 356 +- platform/ios/ios.xcodeproj/project.pbxproj | 96 +- platform/ios/sdk-files.txt | 366 ++ platform/linux/config.cmake | 66 +- platform/macos/config.cmake | 50 +- platform/macos/core-files.txt | 254 +- platform/macos/sdk-files.txt | 220 + platform/qt/config.cmake | 8 +- platform/qt/qt.cmake | 30 +- platform/qt/src/sqlite3.cpp | 2 +- scripts/generate-cmake-files.js | 44 +- test/storage/offline_database.test.cpp | 2 +- test/storage/offline_download.test.cpp | 2 +- test/storage/sqlite.test.cpp | 2 +- vendor/boost-files.txt | 5259 ++++++++++++++++++++ vendor/cheap-ruler-cpp-files.txt | 4 + vendor/earcut.hpp-files.txt | 4 + vendor/eternal-files.txt | 4 + vendor/expected-files.txt | 4 + vendor/geojson-vt-cpp-files.txt | 12 + vendor/geojson.hpp-files.txt | 8 + vendor/geometry.hpp-files.txt | 20 + vendor/icu-files.txt | 74 + vendor/jni.hpp-files.txt | 30 + vendor/kdbush.hpp-files.txt | 4 + vendor/pixelmatch-cpp-files.txt | 4 + vendor/pixelmatch-files.txt | 0 vendor/polylabel-files.txt | 4 + vendor/protozero-files.txt | 14 + vendor/rapidjson-files.txt | 44 + vendor/shelf-pack-cpp-files.txt | 4 + vendor/sqlite-files.txt | 5 + vendor/supercluster.hpp-files.txt | 4 + vendor/unique_resource-files.txt | 4 + vendor/variant-files.txt | 8 + vendor/vector-tile-files.txt | 8 + vendor/wagyu-files.txt | 27 + 173 files changed, 13765 insertions(+), 8060 deletions(-) create mode 100644 platform/darwin/include/mbgl/gl/gl_impl.hpp create mode 100644 platform/darwin/include/mbgl/storage/reachability.h create mode 100644 platform/darwin/include/mbgl/util/image+MGLAdditions.hpp delete mode 100644 platform/darwin/mbgl/gl/gl_impl.hpp delete mode 100644 platform/darwin/mbgl/storage/reachability.h delete mode 100644 platform/darwin/mbgl/storage/reachability.m delete mode 100644 platform/darwin/mbgl/util/image+MGLAdditions.hpp create mode 100644 platform/darwin/src/reachability.m delete mode 100644 platform/default/asset_file_source.cpp delete mode 100644 platform/default/async_task.cpp delete mode 100644 platform/default/bidi.cpp delete mode 100644 platform/default/collator.cpp delete mode 100644 platform/default/default_file_source.cpp delete mode 100644 platform/default/file_source_request.cpp delete mode 100644 platform/default/headless_backend_osmesa.cpp delete mode 100644 platform/default/http_file_source.cpp delete mode 100644 platform/default/image.cpp create mode 100644 platform/default/include/jni/string_conversion.hpp create mode 100644 platform/default/include/mbgl/gl/headless_backend.hpp create mode 100644 platform/default/include/mbgl/gl/headless_frontend.hpp create mode 100644 platform/default/include/mbgl/map/map_snapshotter.hpp create mode 100644 platform/default/include/mbgl/storage/file_source_request.hpp create mode 100644 platform/default/include/mbgl/storage/merge_sideloaded.hpp create mode 100644 platform/default/include/mbgl/storage/merge_sideloaded.js create mode 100644 platform/default/include/mbgl/storage/merge_sideloaded.sql create mode 100644 platform/default/include/mbgl/storage/offline_database.hpp create mode 100644 platform/default/include/mbgl/storage/offline_download.hpp create mode 100644 platform/default/include/mbgl/storage/offline_schema.hpp create mode 100644 platform/default/include/mbgl/storage/offline_schema.js create mode 100644 platform/default/include/mbgl/storage/offline_schema.sql create mode 100644 platform/default/include/mbgl/storage/sqlite3.hpp create mode 100644 platform/default/include/mbgl/text/unaccent.hpp create mode 100644 platform/default/include/mbgl/util/default_styles.hpp create mode 100644 platform/default/include/mbgl/util/default_thread_pool.hpp create mode 100644 platform/default/include/mbgl/util/shared_thread_pool.hpp delete mode 100644 platform/default/jni/string_conversion.hpp delete mode 100644 platform/default/jpeg_reader.cpp delete mode 100644 platform/default/layer_manager.cpp delete mode 100644 platform/default/local_file_source.cpp delete mode 100644 platform/default/local_glyph_rasterizer.cpp delete mode 100644 platform/default/logging_stderr.cpp delete mode 100644 platform/default/mbgl/gl/headless_backend.cpp delete mode 100644 platform/default/mbgl/gl/headless_backend.hpp delete mode 100644 platform/default/mbgl/gl/headless_frontend.cpp delete mode 100644 platform/default/mbgl/gl/headless_frontend.hpp delete mode 100644 platform/default/mbgl/map/map_snapshotter.cpp delete mode 100644 platform/default/mbgl/map/map_snapshotter.hpp delete mode 100644 platform/default/mbgl/storage/.clang-tidy delete mode 100644 platform/default/mbgl/storage/file_source_request.hpp delete mode 100644 platform/default/mbgl/storage/merge_sideloaded.hpp delete mode 100644 platform/default/mbgl/storage/merge_sideloaded.js delete mode 100644 platform/default/mbgl/storage/merge_sideloaded.sql delete mode 100644 platform/default/mbgl/storage/offline.cpp delete mode 100644 platform/default/mbgl/storage/offline_database.cpp delete mode 100644 platform/default/mbgl/storage/offline_database.hpp delete mode 100644 platform/default/mbgl/storage/offline_download.cpp delete mode 100644 platform/default/mbgl/storage/offline_download.hpp delete mode 100644 platform/default/mbgl/storage/offline_schema.hpp delete mode 100644 platform/default/mbgl/storage/offline_schema.js delete mode 100644 platform/default/mbgl/storage/offline_schema.sql delete mode 100644 platform/default/mbgl/test/main.cpp delete mode 100644 platform/default/mbgl/util/default_styles.hpp delete mode 100644 platform/default/mbgl/util/default_thread_pool.cpp delete mode 100644 platform/default/mbgl/util/default_thread_pool.hpp delete mode 100644 platform/default/mbgl/util/shared_thread_pool.cpp delete mode 100644 platform/default/mbgl/util/shared_thread_pool.hpp delete mode 100644 platform/default/online_file_source.cpp delete mode 100644 platform/default/png_reader.cpp delete mode 100644 platform/default/png_writer.cpp delete mode 100644 platform/default/run_loop.cpp delete mode 100644 platform/default/sqlite3.cpp delete mode 100644 platform/default/sqlite3.hpp create mode 100644 platform/default/src/mbgl/gl/headless_backend.cpp create mode 100644 platform/default/src/mbgl/gl/headless_backend_osmesa.cpp create mode 100644 platform/default/src/mbgl/gl/headless_frontend.cpp create mode 100644 platform/default/src/mbgl/layermanager/layer_manager.cpp create mode 100644 platform/default/src/mbgl/map/map_snapshotter.cpp create mode 100644 platform/default/src/mbgl/storage/asset_file_source.cpp create mode 100644 platform/default/src/mbgl/storage/default_file_source.cpp create mode 100644 platform/default/src/mbgl/storage/file_source_request.cpp create mode 100644 platform/default/src/mbgl/storage/http_file_source.cpp create mode 100644 platform/default/src/mbgl/storage/local_file_source.cpp create mode 100644 platform/default/src/mbgl/storage/offline.cpp create mode 100644 platform/default/src/mbgl/storage/offline_database.cpp create mode 100644 platform/default/src/mbgl/storage/offline_download.cpp create mode 100644 platform/default/src/mbgl/storage/online_file_source.cpp create mode 100644 platform/default/src/mbgl/storage/sqlite3.cpp create mode 100644 platform/default/src/mbgl/test/main.cpp create mode 100644 platform/default/src/mbgl/text/bidi.cpp create mode 100644 platform/default/src/mbgl/text/collator.cpp create mode 100644 platform/default/src/mbgl/text/local_glyph_rasterizer.cpp create mode 100644 platform/default/src/mbgl/text/unaccent.cpp create mode 100644 platform/default/src/mbgl/util/async_task.cpp create mode 100644 platform/default/src/mbgl/util/default_thread_pool.cpp create mode 100644 platform/default/src/mbgl/util/image.cpp create mode 100644 platform/default/src/mbgl/util/jpeg_reader.cpp create mode 100644 platform/default/src/mbgl/util/logging_stderr.cpp create mode 100644 platform/default/src/mbgl/util/png_reader.cpp create mode 100644 platform/default/src/mbgl/util/png_writer.cpp create mode 100644 platform/default/src/mbgl/util/run_loop.cpp create mode 100644 platform/default/src/mbgl/util/shared_thread_pool.cpp create mode 100644 platform/default/src/mbgl/util/string_stdlib.cpp create mode 100644 platform/default/src/mbgl/util/thread.cpp create mode 100644 platform/default/src/mbgl/util/thread_local.cpp create mode 100644 platform/default/src/mbgl/util/timer.cpp create mode 100644 platform/default/src/mbgl/util/utf.cpp delete mode 100644 platform/default/string_stdlib.cpp delete mode 100644 platform/default/thread.cpp delete mode 100644 platform/default/thread_local.cpp delete mode 100644 platform/default/timer.cpp delete mode 100644 platform/default/unaccent.cpp delete mode 100644 platform/default/unaccent.hpp delete mode 100644 platform/default/utf.cpp create mode 100644 platform/ios/sdk-files.txt create mode 100644 platform/macos/sdk-files.txt create mode 100644 vendor/boost-files.txt create mode 100644 vendor/cheap-ruler-cpp-files.txt create mode 100644 vendor/earcut.hpp-files.txt create mode 100644 vendor/eternal-files.txt create mode 100644 vendor/expected-files.txt create mode 100644 vendor/geojson-vt-cpp-files.txt create mode 100644 vendor/geojson.hpp-files.txt create mode 100644 vendor/geometry.hpp-files.txt create mode 100644 vendor/icu-files.txt create mode 100644 vendor/jni.hpp-files.txt create mode 100644 vendor/kdbush.hpp-files.txt create mode 100644 vendor/pixelmatch-cpp-files.txt create mode 100644 vendor/pixelmatch-files.txt create mode 100644 vendor/polylabel-files.txt create mode 100644 vendor/protozero-files.txt create mode 100644 vendor/rapidjson-files.txt create mode 100644 vendor/shelf-pack-cpp-files.txt create mode 100644 vendor/sqlite-files.txt create mode 100644 vendor/supercluster.hpp-files.txt create mode 100644 vendor/unique_resource-files.txt create mode 100644 vendor/variant-files.txt create mode 100644 vendor/vector-tile-files.txt create mode 100644 vendor/wagyu-files.txt diff --git a/circle.yml b/circle.yml index 87bca8559c..7dbf8e4e8b 100644 --- a/circle.yml +++ b/circle.yml @@ -466,8 +466,8 @@ jobs: steps: - install-dependencies: { mason: false, ccache: false } - run: - name: Initialize submodule - command: git submodule update --init mapbox-gl-js + name: Initialize submodules + command: git submodule update --init - run: name: Verify submodule pin command: scripts/nitpick/submodule-pin.js diff --git a/cmake/benchmark-files.txt b/cmake/benchmark-files.txt index 16224e9cad..d739710d27 100644 --- a/cmake/benchmark-files.txt +++ b/cmake/benchmark-files.txt @@ -23,4 +23,3 @@ benchmark/parse/vector_tile.benchmark.cpp # util benchmark/util/dtoa.benchmark.cpp benchmark/util/tilecover.benchmark.cpp - diff --git a/cmake/benchmark.cmake b/cmake/benchmark.cmake index b5452a573a..0d2eebb228 100644 --- a/cmake/benchmark.cmake +++ b/cmake/benchmark.cmake @@ -6,7 +6,7 @@ target_include_directories(mbgl-benchmark PRIVATE src PRIVATE benchmark/include PRIVATE benchmark/src - PRIVATE platform/default + PRIVATE platform/default/include ) target_link_libraries(mbgl-benchmark diff --git a/cmake/core-files.txt b/cmake/core-files.txt index 5712db9f15..008cf23180 100644 --- a/cmake/core-files.txt +++ b/cmake/core-files.txt @@ -802,4 +802,3 @@ src/mbgl/util/utf.hpp src/mbgl/util/version.cpp src/mbgl/util/version.hpp src/mbgl/util/work_request.cpp - diff --git a/cmake/files.txt.ejs b/cmake/files.txt.ejs index 6c210347f6..6faa184c29 100644 --- a/cmake/files.txt.ejs +++ b/cmake/files.txt.ejs @@ -2,9 +2,8 @@ const groups = locals.groups; -%> # This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js - <% for (const key of Object.keys(groups).sort()) { -%> + # <%- key %> <%- groups[key].sort().join('\n') %> - <% } -%> diff --git a/cmake/filesource-files.txt b/cmake/filesource-files.txt index 472a08fa08..1909885e47 100644 --- a/cmake/filesource-files.txt +++ b/cmake/filesource-files.txt @@ -1,25 +1,25 @@ # File source include/mbgl/storage/default_file_source.hpp -platform/default/default_file_source.cpp -platform/default/mbgl/storage/file_source_request.hpp -platform/default/file_source_request.cpp +platform/default/src/mbgl/storage/default_file_source.cpp +platform/default/include/mbgl/storage/file_source_request.hpp +platform/default/src/mbgl/storage/file_source_request.cpp include/mbgl/storage/online_file_source.hpp -platform/default/online_file_source.cpp +platform/default/src/mbgl/storage/online_file_source.cpp src/mbgl/storage/http_file_source.hpp src/mbgl/storage/asset_file_source.hpp -platform/default/asset_file_source.cpp +platform/default/src/mbgl/storage/asset_file_source.cpp src/mbgl/storage/local_file_source.hpp -platform/default/local_file_source.cpp +platform/default/src/mbgl/storage/local_file_source.cpp # Offline include/mbgl/storage/offline.hpp -platform/default/mbgl/storage/offline.cpp -platform/default/mbgl/storage/offline_database.hpp -platform/default/mbgl/storage/offline_database.cpp -platform/default/mbgl/storage/offline_download.hpp -platform/default/mbgl/storage/offline_download.cpp -platform/default/mbgl/storage/offline_schema.hpp -platform/default/mbgl/storage/merge_sideloaded.hpp +platform/default/src/mbgl/storage/offline.cpp +platform/default/include/mbgl/storage/offline_database.hpp +platform/default/src/mbgl/storage/offline_database.cpp +platform/default/include/mbgl/storage/offline_download.hpp +platform/default/src/mbgl/storage/offline_download.cpp +platform/default/include/mbgl/storage/offline_schema.hpp +platform/default/include/mbgl/storage/merge_sideloaded.hpp # Database -platform/default/sqlite3.hpp +platform/default/include/mbgl/storage/sqlite3.hpp diff --git a/cmake/filesource.cmake b/cmake/filesource.cmake index 5b99170489..e02467633b 100644 --- a/cmake/filesource.cmake +++ b/cmake/filesource.cmake @@ -5,7 +5,7 @@ add_library(mbgl-filesource STATIC ${MBGL_FILESOURCE_FILES}) target_include_directories(mbgl-filesource PRIVATE include PRIVATE src - PRIVATE platform/default + PRIVATE platform/default/include ) target_link_libraries(mbgl-filesource diff --git a/cmake/glfw.cmake b/cmake/glfw.cmake index fe514196d5..b87ba74caf 100644 --- a/cmake/glfw.cmake +++ b/cmake/glfw.cmake @@ -9,11 +9,11 @@ target_sources(mbgl-glfw PRIVATE platform/glfw/glfw_renderer_frontend.cpp PRIVATE platform/glfw/settings_json.hpp PRIVATE platform/glfw/settings_json.cpp - PRIVATE platform/default/mbgl/util/default_styles.hpp + PRIVATE platform/default/include/mbgl/util/default_styles.hpp ) target_include_directories(mbgl-glfw - PRIVATE platform/default + PRIVATE platform/default/include ) target_link_libraries(mbgl-glfw diff --git a/cmake/loop-uv.cmake b/cmake/loop-uv.cmake index e1d3166b63..320545b3c3 100644 --- a/cmake/loop-uv.cmake +++ b/cmake/loop-uv.cmake @@ -1,9 +1,9 @@ add_library(mbgl-loop-uv INTERFACE) target_sources(mbgl-loop-uv INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR}/platform/default/async_task.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/platform/default/run_loop.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/platform/default/timer.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/platform/default/src/mbgl/util/async_task.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/platform/default/src/mbgl/util/run_loop.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/platform/default/src/mbgl/util/timer.cpp ) target_include_directories(mbgl-loop-uv INTERFACE diff --git a/cmake/node.cmake b/cmake/node.cmake index cb98d570f7..f126b81637 100644 --- a/cmake/node.cmake +++ b/cmake/node.cmake @@ -5,9 +5,9 @@ include(node_modules/@mapbox/cmake-node-module/module.cmake) add_library(mbgl-loop-node INTERFACE) target_sources(mbgl-loop-node INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR}/platform/default/async_task.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/platform/default/run_loop.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/platform/default/timer.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/platform/default/src/mbgl/util/async_task.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/platform/default/src/mbgl/util/run_loop.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/platform/default/src/mbgl/util/timer.cpp ) target_include_directories(mbgl-loop-node INTERFACE @@ -49,7 +49,7 @@ target_sources(mbgl-node INTERFACE ) target_include_directories(mbgl-node INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR}/platform/default + ${CMAKE_CURRENT_SOURCE_DIR}/platform/default/include ) target_link_libraries(mbgl-node INTERFACE diff --git a/cmake/offline.cmake b/cmake/offline.cmake index c17ffb2ef3..9f7261cd6c 100644 --- a/cmake/offline.cmake +++ b/cmake/offline.cmake @@ -3,11 +3,11 @@ add_executable(mbgl-offline ) target_sources(mbgl-offline - PRIVATE platform/default/mbgl/util/default_styles.hpp + PRIVATE platform/default/include/mbgl/util/default_styles.hpp ) target_include_directories(mbgl-offline - PRIVATE platform/default + PRIVATE platform/default/include ) target_link_libraries(mbgl-offline diff --git a/cmake/render.cmake b/cmake/render.cmake index 44912e5302..9a67a2a25e 100644 --- a/cmake/render.cmake +++ b/cmake/render.cmake @@ -3,7 +3,7 @@ add_executable(mbgl-render ) target_include_directories(mbgl-render - PRIVATE platform/default + PRIVATE platform/default/include ) target_link_libraries(mbgl-render diff --git a/cmake/test-files.txt b/cmake/test-files.txt index 4c7029f9f0..c7f71bd24a 100644 --- a/cmake/test-files.txt +++ b/cmake/test-files.txt @@ -153,4 +153,3 @@ test/util/tile_range.test.cpp test/util/timer.test.cpp test/util/token.test.cpp test/util/url.test.cpp - diff --git a/cmake/test.cmake b/cmake/test.cmake index 4f7933ade2..977f4a1413 100644 --- a/cmake/test.cmake +++ b/cmake/test.cmake @@ -21,7 +21,7 @@ target_include_directories(mbgl-test PRIVATE src PRIVATE test/include PRIVATE test/src - PRIVATE platform/default + PRIVATE platform/default/include ) target_link_libraries(mbgl-test PRIVATE diff --git a/platform/android/config.cmake b/platform/android/config.cmake index 8c94842de5..b553b5b8ab 100644 --- a/platform/android/config.cmake +++ b/platform/android/config.cmake @@ -38,7 +38,7 @@ macro(mbgl_platform_core) target_sources_from_file(mbgl-core PRIVATE platform/android/core-files.txt) target_include_directories(mbgl-core - PUBLIC platform/default + PUBLIC platform/default/include PRIVATE platform/android ) @@ -90,7 +90,7 @@ target_link_libraries(mapbox-gl set(MBGL_TEST_TARGET_TYPE "library") macro(mbgl_platform_test) target_sources(mbgl-test - PRIVATE platform/default/mbgl/test/main.cpp + PRIVATE platform/default/src/mbgl/test/main.cpp # Main test entry point platform/android/src/test/main.jni.cpp diff --git a/platform/android/core-files.txt b/platform/android/core-files.txt index 03735198a2..bc31c035c5 100644 --- a/platform/android/core-files.txt +++ b/platform/android/core-files.txt @@ -1,3 +1,6 @@ +# JNI overrides +platform/default/include/jni/string_conversion.hpp + # Loop platform/android/src/async_task.cpp platform/android/src/run_loop.cpp @@ -12,14 +15,14 @@ platform/android/src/text/local_glyph_rasterizer_jni.hpp platform/android/src/logging_android.cpp platform/android/src/thread.cpp platform/android/src/string_util.cpp -platform/default/bidi.cpp -platform/default/thread_local.cpp +platform/default/src/mbgl/text/bidi.cpp +platform/default/src/mbgl/util/thread_local.cpp platform/android/src/unaccent.cpp -platform/default/unaccent.hpp -platform/default/utf.cpp +platform/default/include/mbgl/text/unaccent.hpp +platform/default/src/mbgl/util/utf.cpp # Image handling -platform/default/png_writer.cpp +platform/default/src/mbgl/util/png_writer.cpp platform/android/src/bitmap.cpp platform/android/src/bitmap.hpp platform/android/src/bitmap_factory.cpp @@ -27,10 +30,10 @@ platform/android/src/bitmap_factory.hpp platform/android/src/image.cpp # Thread pool -platform/default/mbgl/util/shared_thread_pool.cpp -platform/default/mbgl/util/shared_thread_pool.hpp -platform/default/mbgl/util/default_thread_pool.cpp -platform/default/mbgl/util/default_thread_pool.hpp +platform/default/src/mbgl/util/shared_thread_pool.cpp +platform/default/include/mbgl/util/shared_thread_pool.hpp +platform/default/src/mbgl/util/default_thread_pool.cpp +platform/default/include/mbgl/util/default_thread_pool.hpp # Rendering platform/android/src/android_renderer_backend.cpp @@ -39,12 +42,12 @@ platform/android/src/android_renderer_frontend.cpp platform/android/src/android_renderer_frontend.hpp # Snapshots (core) -platform/default/mbgl/gl/headless_backend.cpp -platform/default/mbgl/gl/headless_backend.hpp -platform/default/mbgl/gl/headless_frontend.cpp -platform/default/mbgl/gl/headless_frontend.hpp -platform/default/mbgl/map/map_snapshotter.cpp -platform/default/mbgl/map/map_snapshotter.hpp +platform/default/src/mbgl/gl/headless_backend.cpp +platform/default/include/mbgl/gl/headless_backend.hpp +platform/default/src/mbgl/gl/headless_frontend.cpp +platform/default/include/mbgl/gl/headless_frontend.hpp +platform/default/src/mbgl/map/map_snapshotter.cpp +platform/default/include/mbgl/map/map_snapshotter.hpp platform/linux/src/headless_backend_egl.cpp # Conversion C++ -> Java @@ -74,7 +77,6 @@ platform/android/src/map/image.hpp platform/android/src/style/android_conversion.hpp platform/android/src/style/value.cpp platform/android/src/style/value.hpp -platform/android/src/style/conversion/url_or_tileset.hpp # Style platform/android/src/style/transition_options.cpp @@ -160,13 +162,13 @@ platform/android/src/geojson/line_string.hpp platform/android/src/geojson/multi_line_string.cpp platform/android/src/geojson/multi_line_string.hpp platform/android/src/geojson/multi_point.cpp -platform/android/src/geojson/multi_point.hpp platform/android/src/geojson/multi_polygon.cpp platform/android/src/geojson/multi_polygon.hpp platform/android/src/geojson/point.cpp platform/android/src/geojson/point.hpp platform/android/src/geojson/polygon.cpp platform/android/src/geojson/polygon.hpp +platform/android/src/geojson/util.hpp # Geometry platform/android/src/geometry/lat_lng.cpp @@ -191,6 +193,7 @@ platform/android/src/gson/json_primitive.hpp # Annotation platform/android/src/annotation/marker.cpp platform/android/src/annotation/marker.hpp +platform/android/src/annotation/multi_point.hpp platform/android/src/annotation/polygon.cpp platform/android/src/annotation/polygon.hpp platform/android/src/annotation/polyline.cpp diff --git a/platform/android/filesource-files.txt b/platform/android/filesource-files.txt index c88db6c725..2485e2a7ed 100644 --- a/platform/android/filesource-files.txt +++ b/platform/android/filesource-files.txt @@ -25,4 +25,4 @@ platform/android/src/offline/offline_region_status.cpp platform/android/src/offline/offline_region_status.hpp # Database -platform/default/sqlite3.cpp +platform/default/src/mbgl/storage/sqlite3.cpp diff --git a/platform/android/src/file_source.cpp b/platform/android/src/file_source.cpp index 9b639d2610..daddd0b9cd 100644 --- a/platform/android/src/file_source.cpp +++ b/platform/android/src/file_source.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include "asset_manager_file_source.hpp" diff --git a/platform/android/src/jni.cpp b/platform/android/src/jni.cpp index 8c1e45f7d3..45b3e02252 100755 --- a/platform/android/src/jni.cpp +++ b/platform/android/src/jni.cpp @@ -1,8 +1,6 @@ #include "jni.hpp" #include -#include -#include #include "annotation/marker.hpp" #include "annotation/polygon.hpp" @@ -46,6 +44,8 @@ #include "style/layers/layer_manager.hpp" #include "style/sources/source.hpp" #include "style/light.hpp" +#include "style/formatted.hpp" +#include "style/formatted_section.hpp" #include "snapshotter/map_snapshotter.hpp" #include "snapshotter/map_snapshot.hpp" #include "text/collator_jni.hpp" diff --git a/platform/android/src/text/collator.cpp b/platform/android/src/text/collator.cpp index 381851eff2..acb4f36ee1 100644 --- a/platform/android/src/text/collator.cpp +++ b/platform/android/src/text/collator.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include diff --git a/platform/android/src/unaccent.cpp b/platform/android/src/unaccent.cpp index bc2ec354d6..8da0ce4931 100644 --- a/platform/android/src/unaccent.cpp +++ b/platform/android/src/unaccent.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include "attach_env.hpp" #include "text/collator_jni.hpp" diff --git a/platform/darwin/filesource-files.txt b/platform/darwin/filesource-files.txt index 095bf4c6b0..eebb7a6e7c 100644 --- a/platform/darwin/filesource-files.txt +++ b/platform/darwin/filesource-files.txt @@ -3,4 +3,4 @@ platform/darwin/src/http_file_source.mm platform/darwin/src/MGLLoggingConfiguration.m # Database -platform/default/sqlite3.cpp +platform/default/src/mbgl/storage/sqlite3.cpp diff --git a/platform/darwin/include/mbgl/gl/gl_impl.hpp b/platform/darwin/include/mbgl/gl/gl_impl.hpp new file mode 100644 index 0000000000..0db125c7b4 --- /dev/null +++ b/platform/darwin/include/mbgl/gl/gl_impl.hpp @@ -0,0 +1,22 @@ +#pragma once + +#include "TargetConditionals.h" +#if TARGET_OS_IPHONE + #include + #include +#elif TARGET_IPHONE_SIMULATOR + #include + #include +#elif TARGET_OS_MAC + #if MBGL_USE_GLES2 + #define GL_GLEXT_PROTOTYPES + #include + #include + #else + #include + #include + #include + #endif +#else + #error Unsupported Apple platform +#endif diff --git a/platform/darwin/include/mbgl/storage/reachability.h b/platform/darwin/include/mbgl/storage/reachability.h new file mode 100644 index 0000000000..e38c9b1e20 --- /dev/null +++ b/platform/darwin/include/mbgl/storage/reachability.h @@ -0,0 +1,95 @@ +/* + Copyright (c) 2011, Tony Million. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#import +#import + + +/** + * Create NS_ENUM macro if it does not exist on the targeted version of iOS or OS X. + * + * @see http://nshipster.com/ns_enum-ns_options/ + **/ +#ifndef NS_ENUM +#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type +#endif + +extern NSString *const kMGLReachabilityChangedNotification; + +typedef NS_ENUM(NSInteger, NetworkStatus) { + // Apple NetworkStatus Compatible Names. + NotReachable = 0, + ReachableViaWiFi = 2, + ReachableViaWWAN = 1 +}; + +@class MGLReachability; + +typedef void (^NetworkReachable)(MGLReachability * reachability); +typedef void (^NetworkUnreachable)(MGLReachability * reachability); + + +@interface MGLReachability : NSObject + +@property (nonatomic, copy) NetworkReachable reachableBlock; +@property (nonatomic, copy) NetworkUnreachable unreachableBlock; + +@property (nonatomic, assign) BOOL reachableOnWWAN; + + ++(instancetype)reachabilityWithHostname:(NSString*)hostname; +// This is identical to the function above, but is here to maintain +// compatibility with Apples original code. (see .m) ++(instancetype)reachabilityWithHostName:(NSString*)hostname; ++(instancetype)reachabilityForInternetConnection; ++(instancetype)reachabilityWithAddress:(void *)hostAddress; ++(instancetype)reachabilityForLocalWiFi; + +-(instancetype)initWithReachabilityRef:(SCNetworkReachabilityRef)ref; + +-(BOOL)startNotifier; +-(void)stopNotifier; + +-(BOOL)isReachable; +-(BOOL)isReachableViaWWAN; +-(BOOL)isReachableViaWiFi; + +// WWAN may be available, but not active until a connection has been established. +// WiFi may require a connection for VPN on Demand. +-(BOOL)isConnectionRequired; // Identical DDG variant. +-(BOOL)connectionRequired; // Apple's routine. +// Dynamic, on demand connection? +-(BOOL)isConnectionOnDemand; +// Is user intervention required? +-(BOOL)isInterventionRequired; + +-(NetworkStatus)currentReachabilityStatus; +-(SCNetworkReachabilityFlags)reachabilityFlags; +-(NSString*)currentReachabilityString; +-(NSString*)currentReachabilityFlags; + +@end diff --git a/platform/darwin/include/mbgl/util/image+MGLAdditions.hpp b/platform/darwin/include/mbgl/util/image+MGLAdditions.hpp new file mode 100644 index 0000000000..c5343af4de --- /dev/null +++ b/platform/darwin/include/mbgl/util/image+MGLAdditions.hpp @@ -0,0 +1,12 @@ +#pragma once + +#include + +#include + +// Creates a CGImage from a PremultipliedImage, taking over the memory ownership. +CGImageRef CGImageCreateWithMGLPremultipliedImage(mbgl::PremultipliedImage&&); + +// Creates a PremultipliedImage by copying the pixels of the CGImage. +// Does not alter the retain count of the supplied CGImage. +mbgl::PremultipliedImage MGLPremultipliedImageFromCGImage(CGImageRef); diff --git a/platform/darwin/mbgl/gl/gl_impl.hpp b/platform/darwin/mbgl/gl/gl_impl.hpp deleted file mode 100644 index 0db125c7b4..0000000000 --- a/platform/darwin/mbgl/gl/gl_impl.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -#include "TargetConditionals.h" -#if TARGET_OS_IPHONE - #include - #include -#elif TARGET_IPHONE_SIMULATOR - #include - #include -#elif TARGET_OS_MAC - #if MBGL_USE_GLES2 - #define GL_GLEXT_PROTOTYPES - #include - #include - #else - #include - #include - #include - #endif -#else - #error Unsupported Apple platform -#endif diff --git a/platform/darwin/mbgl/storage/reachability.h b/platform/darwin/mbgl/storage/reachability.h deleted file mode 100644 index e38c9b1e20..0000000000 --- a/platform/darwin/mbgl/storage/reachability.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - Copyright (c) 2011, Tony Million. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - */ - -#import -#import - - -/** - * Create NS_ENUM macro if it does not exist on the targeted version of iOS or OS X. - * - * @see http://nshipster.com/ns_enum-ns_options/ - **/ -#ifndef NS_ENUM -#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type -#endif - -extern NSString *const kMGLReachabilityChangedNotification; - -typedef NS_ENUM(NSInteger, NetworkStatus) { - // Apple NetworkStatus Compatible Names. - NotReachable = 0, - ReachableViaWiFi = 2, - ReachableViaWWAN = 1 -}; - -@class MGLReachability; - -typedef void (^NetworkReachable)(MGLReachability * reachability); -typedef void (^NetworkUnreachable)(MGLReachability * reachability); - - -@interface MGLReachability : NSObject - -@property (nonatomic, copy) NetworkReachable reachableBlock; -@property (nonatomic, copy) NetworkUnreachable unreachableBlock; - -@property (nonatomic, assign) BOOL reachableOnWWAN; - - -+(instancetype)reachabilityWithHostname:(NSString*)hostname; -// This is identical to the function above, but is here to maintain -// compatibility with Apples original code. (see .m) -+(instancetype)reachabilityWithHostName:(NSString*)hostname; -+(instancetype)reachabilityForInternetConnection; -+(instancetype)reachabilityWithAddress:(void *)hostAddress; -+(instancetype)reachabilityForLocalWiFi; - --(instancetype)initWithReachabilityRef:(SCNetworkReachabilityRef)ref; - --(BOOL)startNotifier; --(void)stopNotifier; - --(BOOL)isReachable; --(BOOL)isReachableViaWWAN; --(BOOL)isReachableViaWiFi; - -// WWAN may be available, but not active until a connection has been established. -// WiFi may require a connection for VPN on Demand. --(BOOL)isConnectionRequired; // Identical DDG variant. --(BOOL)connectionRequired; // Apple's routine. -// Dynamic, on demand connection? --(BOOL)isConnectionOnDemand; -// Is user intervention required? --(BOOL)isInterventionRequired; - --(NetworkStatus)currentReachabilityStatus; --(SCNetworkReachabilityFlags)reachabilityFlags; --(NSString*)currentReachabilityString; --(NSString*)currentReachabilityFlags; - -@end diff --git a/platform/darwin/mbgl/storage/reachability.m b/platform/darwin/mbgl/storage/reachability.m deleted file mode 100644 index 2030e7ef71..0000000000 --- a/platform/darwin/mbgl/storage/reachability.m +++ /dev/null @@ -1,469 +0,0 @@ -/* - Copyright (c) 2011, Tony Million. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - */ - -#import - -#import -#import -#import -#import -#import -#import - - -NSString *const kMGLReachabilityChangedNotification = @"kMGLReachabilityChangedNotification"; - - -@interface MGLReachability () - -@property (nonatomic, assign) SCNetworkReachabilityRef reachabilityRef; -@property (nonatomic, strong) dispatch_queue_t reachabilitySerialQueue; -@property (nonatomic, strong) id reachabilityObject; - --(void)reachabilityChanged:(SCNetworkReachabilityFlags)flags; --(BOOL)isReachableWithFlags:(SCNetworkReachabilityFlags)flags; - -@end - - -static NSString *reachabilityFlags(SCNetworkReachabilityFlags flags) -{ - return [NSString stringWithFormat:@"%c%c %c%c%c%c%c%c%c", -#if TARGET_OS_IPHONE - (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-', -#else - 'X', -#endif - (flags & kSCNetworkReachabilityFlagsReachable) ? 'R' : '-', - (flags & kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-', - (flags & kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-', - (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-', - (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) ? 'C' : '-', - (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-', - (flags & kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-', - (flags & kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-']; -} - -// Start listening for reachability notifications on the current run loop -static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info) -{ -#pragma unused (target) - - MGLReachability *reachability = ((__bridge MGLReachability*)info); - - // We probably don't need an autoreleasepool here, as GCD docs state each queue has its own autorelease pool, - // but what the heck eh? - @autoreleasepool - { - [reachability reachabilityChanged:flags]; - } -} - - -@implementation MGLReachability - -#pragma mark - Class Constructor Methods - -+(instancetype)reachabilityWithHostName:(NSString*)hostname -{ - return [MGLReachability reachabilityWithHostname:hostname]; -} - -+(instancetype)reachabilityWithHostname:(NSString*)hostname -{ - SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithName(NULL, [hostname UTF8String]); - if (ref) - { - id reachability = [[self alloc] initWithReachabilityRef:ref]; - - return reachability; - } - - return nil; -} - -+(instancetype)reachabilityWithAddress:(void *)hostAddress -{ - SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr*)hostAddress); - if (ref) - { - id reachability = [[self alloc] initWithReachabilityRef:ref]; - - return reachability; - } - - return nil; -} - -+(instancetype)reachabilityForInternetConnection -{ - struct sockaddr_in zeroAddress; - bzero(&zeroAddress, sizeof(zeroAddress)); - zeroAddress.sin_len = sizeof(zeroAddress); - zeroAddress.sin_family = AF_INET; - - return [self reachabilityWithAddress:&zeroAddress]; -} - -+(instancetype)reachabilityForLocalWiFi -{ - struct sockaddr_in localWifiAddress; - bzero(&localWifiAddress, sizeof(localWifiAddress)); - localWifiAddress.sin_len = sizeof(localWifiAddress); - localWifiAddress.sin_family = AF_INET; - // IN_LINKLOCALNETNUM is defined in as 169.254.0.0 - localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM); - - return [self reachabilityWithAddress:&localWifiAddress]; -} - - -// Initialization methods - --(instancetype)initWithReachabilityRef:(SCNetworkReachabilityRef)ref -{ - self = [super init]; - if (self != nil) - { - self.reachableOnWWAN = YES; - self.reachabilityRef = ref; - - // We need to create a serial queue. - // We allocate this once for the lifetime of the notifier. - - self.reachabilitySerialQueue = dispatch_queue_create("com.tonymillion.reachability", NULL); - } - - return self; -} - --(void)dealloc -{ - [self stopNotifier]; - - if(self.reachabilityRef) - { - CFRelease(self.reachabilityRef); - self.reachabilityRef = nil; - } - - self.reachableBlock = nil; - self.unreachableBlock = nil; - self.reachabilitySerialQueue = nil; -} - -#pragma mark - Notifier Methods - -// Notifier -// NOTE: This uses GCD to trigger the blocks - they *WILL NOT* be called on THE MAIN THREAD -// - In other words DO NOT DO ANY UI UPDATES IN THE BLOCKS. -// INSTEAD USE dispatch_async(dispatch_get_main_queue(), ^{UISTUFF}) (or dispatch_sync if you want) - --(BOOL)startNotifier -{ - // allow start notifier to be called multiple times - if(self.reachabilityObject && (self.reachabilityObject == self)) - { - return YES; - } - - - SCNetworkReachabilityContext context = { 0, NULL, NULL, NULL, NULL }; - context.info = (__bridge void *)self; - - if(SCNetworkReachabilitySetCallback(self.reachabilityRef, TMReachabilityCallback, &context)) - { - // Set it as our reachability queue, which will retain the queue - if(SCNetworkReachabilitySetDispatchQueue(self.reachabilityRef, self.reachabilitySerialQueue)) - { - // this should do a retain on ourself, so as long as we're in notifier mode we shouldn't disappear out from under ourselves - // woah - self.reachabilityObject = self; - return YES; - } - else - { -#ifdef DEBUG - NSLog(@"SCNetworkReachabilitySetDispatchQueue() failed: %s", SCErrorString(SCError())); -#endif - - // UH OH - FAILURE - stop any callbacks! - SCNetworkReachabilitySetCallback(self.reachabilityRef, NULL, NULL); - } - } - else - { -#ifdef DEBUG - NSLog(@"SCNetworkReachabilitySetCallback() failed: %s", SCErrorString(SCError())); -#endif - } - - // if we get here we fail at the internet - self.reachabilityObject = nil; - return NO; -} - --(void)stopNotifier -{ - // First stop, any callbacks! - SCNetworkReachabilitySetCallback(self.reachabilityRef, NULL, NULL); - - // Unregister target from the GCD serial dispatch queue. - SCNetworkReachabilitySetDispatchQueue(self.reachabilityRef, NULL); - - self.reachabilityObject = nil; -} - -#pragma mark - reachability tests - -// This is for the case where you flick the airplane mode; -// you end up getting something like this: -// Reachability: WR ct----- -// Reachability: -- ------- -// Reachability: WR ct----- -// Reachability: -- ------- -// We treat this as 4 UNREACHABLE triggers - really apple should do better than this - -#define testcase (kSCNetworkReachabilityFlagsConnectionRequired | kSCNetworkReachabilityFlagsTransientConnection) - --(BOOL)isReachableWithFlags:(SCNetworkReachabilityFlags)flags -{ - BOOL connectionUP = YES; - - if(!(flags & kSCNetworkReachabilityFlagsReachable)) - connectionUP = NO; - - if( (flags & testcase) == testcase ) - connectionUP = NO; - -#if TARGET_OS_IPHONE - if(flags & kSCNetworkReachabilityFlagsIsWWAN) - { - // We're on 3G. - if(!self.reachableOnWWAN) - { - // We don't want to connect when on 3G. - connectionUP = NO; - } - } -#endif - - return connectionUP; -} - --(BOOL)isReachable -{ - SCNetworkReachabilityFlags flags; - - if(!SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) - return NO; - - return [self isReachableWithFlags:flags]; -} - --(BOOL)isReachableViaWWAN -{ -#if TARGET_OS_IPHONE - - SCNetworkReachabilityFlags flags = 0; - - if(SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) - { - // Check we're REACHABLE - if(flags & kSCNetworkReachabilityFlagsReachable) - { - // Now, check we're on WWAN - if(flags & kSCNetworkReachabilityFlagsIsWWAN) - { - return YES; - } - } - } -#endif - - return NO; -} - --(BOOL)isReachableViaWiFi -{ - SCNetworkReachabilityFlags flags = 0; - - if(SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) - { - // Check we're reachable - if((flags & kSCNetworkReachabilityFlagsReachable)) - { -#if TARGET_OS_IPHONE - // Check we're NOT on WWAN - if((flags & kSCNetworkReachabilityFlagsIsWWAN)) - { - return NO; - } -#endif - return YES; - } - } - - return NO; -} - - -// WWAN may be available, but not active until a connection has been established. -// WiFi may require a connection for VPN on Demand. --(BOOL)isConnectionRequired -{ - return [self connectionRequired]; -} - --(BOOL)connectionRequired -{ - SCNetworkReachabilityFlags flags; - - if(SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) - { - return (flags & kSCNetworkReachabilityFlagsConnectionRequired); - } - - return NO; -} - -// Dynamic, on demand connection? --(BOOL)isConnectionOnDemand -{ - SCNetworkReachabilityFlags flags; - - if (SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) - { - return ((flags & kSCNetworkReachabilityFlagsConnectionRequired) && - (flags & (kSCNetworkReachabilityFlagsConnectionOnTraffic | kSCNetworkReachabilityFlagsConnectionOnDemand))); - } - - return NO; -} - -// Is user intervention required? --(BOOL)isInterventionRequired -{ - SCNetworkReachabilityFlags flags; - - if (SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) - { - return ((flags & kSCNetworkReachabilityFlagsConnectionRequired) && - (flags & kSCNetworkReachabilityFlagsInterventionRequired)); - } - - return NO; -} - - -#pragma mark - reachability status stuff - --(NetworkStatus)currentReachabilityStatus -{ - if([self isReachable]) - { - if([self isReachableViaWiFi]) - return ReachableViaWiFi; - -#if TARGET_OS_IPHONE - return ReachableViaWWAN; -#endif - } - - return NotReachable; -} - --(SCNetworkReachabilityFlags)reachabilityFlags -{ - SCNetworkReachabilityFlags flags = 0; - - if(SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) - { - return flags; - } - - return 0; -} - --(NSString*)currentReachabilityString -{ - NetworkStatus temp = [self currentReachabilityStatus]; - - if(temp == ReachableViaWWAN) - { - // Updated for the fact that we have CDMA phones now! - return NSLocalizedString(@"Cellular", @""); - } - if (temp == ReachableViaWiFi) - { - return NSLocalizedString(@"WiFi", @""); - } - - return NSLocalizedString(@"No Connection", @""); -} - --(NSString*)currentReachabilityFlags -{ - return reachabilityFlags([self reachabilityFlags]); -} - -#pragma mark - Callback function calls this method - --(void)reachabilityChanged:(SCNetworkReachabilityFlags)flags -{ - if([self isReachableWithFlags:flags]) - { - if(self.reachableBlock) - { - self.reachableBlock(self); - } - } - else - { - if(self.unreachableBlock) - { - self.unreachableBlock(self); - } - } - - // this makes sure the change notification happens on the MAIN THREAD - dispatch_async(dispatch_get_main_queue(), ^{ - [[NSNotificationCenter defaultCenter] postNotificationName:kMGLReachabilityChangedNotification - object:self]; - }); -} - -#pragma mark - Debug Description - -- (NSString *) description -{ - NSString *description = [NSString stringWithFormat:@"<%@: %#x (%@)>", - NSStringFromClass([self class]), (unsigned int) self, [self currentReachabilityFlags]]; - return description; -} - -@end diff --git a/platform/darwin/mbgl/util/image+MGLAdditions.hpp b/platform/darwin/mbgl/util/image+MGLAdditions.hpp deleted file mode 100644 index c5343af4de..0000000000 --- a/platform/darwin/mbgl/util/image+MGLAdditions.hpp +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -#include - -#include - -// Creates a CGImage from a PremultipliedImage, taking over the memory ownership. -CGImageRef CGImageCreateWithMGLPremultipliedImage(mbgl::PremultipliedImage&&); - -// Creates a PremultipliedImage by copying the pixels of the CGImage. -// Does not alter the retain count of the supplied CGImage. -mbgl::PremultipliedImage MGLPremultipliedImageFromCGImage(CGImageRef); diff --git a/platform/darwin/src/reachability.m b/platform/darwin/src/reachability.m new file mode 100644 index 0000000000..2030e7ef71 --- /dev/null +++ b/platform/darwin/src/reachability.m @@ -0,0 +1,469 @@ +/* + Copyright (c) 2011, Tony Million. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +#import +#import +#import +#import +#import +#import + + +NSString *const kMGLReachabilityChangedNotification = @"kMGLReachabilityChangedNotification"; + + +@interface MGLReachability () + +@property (nonatomic, assign) SCNetworkReachabilityRef reachabilityRef; +@property (nonatomic, strong) dispatch_queue_t reachabilitySerialQueue; +@property (nonatomic, strong) id reachabilityObject; + +-(void)reachabilityChanged:(SCNetworkReachabilityFlags)flags; +-(BOOL)isReachableWithFlags:(SCNetworkReachabilityFlags)flags; + +@end + + +static NSString *reachabilityFlags(SCNetworkReachabilityFlags flags) +{ + return [NSString stringWithFormat:@"%c%c %c%c%c%c%c%c%c", +#if TARGET_OS_IPHONE + (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-', +#else + 'X', +#endif + (flags & kSCNetworkReachabilityFlagsReachable) ? 'R' : '-', + (flags & kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-', + (flags & kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-', + (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-', + (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) ? 'C' : '-', + (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-', + (flags & kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-', + (flags & kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-']; +} + +// Start listening for reachability notifications on the current run loop +static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info) +{ +#pragma unused (target) + + MGLReachability *reachability = ((__bridge MGLReachability*)info); + + // We probably don't need an autoreleasepool here, as GCD docs state each queue has its own autorelease pool, + // but what the heck eh? + @autoreleasepool + { + [reachability reachabilityChanged:flags]; + } +} + + +@implementation MGLReachability + +#pragma mark - Class Constructor Methods + ++(instancetype)reachabilityWithHostName:(NSString*)hostname +{ + return [MGLReachability reachabilityWithHostname:hostname]; +} + ++(instancetype)reachabilityWithHostname:(NSString*)hostname +{ + SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithName(NULL, [hostname UTF8String]); + if (ref) + { + id reachability = [[self alloc] initWithReachabilityRef:ref]; + + return reachability; + } + + return nil; +} + ++(instancetype)reachabilityWithAddress:(void *)hostAddress +{ + SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr*)hostAddress); + if (ref) + { + id reachability = [[self alloc] initWithReachabilityRef:ref]; + + return reachability; + } + + return nil; +} + ++(instancetype)reachabilityForInternetConnection +{ + struct sockaddr_in zeroAddress; + bzero(&zeroAddress, sizeof(zeroAddress)); + zeroAddress.sin_len = sizeof(zeroAddress); + zeroAddress.sin_family = AF_INET; + + return [self reachabilityWithAddress:&zeroAddress]; +} + ++(instancetype)reachabilityForLocalWiFi +{ + struct sockaddr_in localWifiAddress; + bzero(&localWifiAddress, sizeof(localWifiAddress)); + localWifiAddress.sin_len = sizeof(localWifiAddress); + localWifiAddress.sin_family = AF_INET; + // IN_LINKLOCALNETNUM is defined in as 169.254.0.0 + localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM); + + return [self reachabilityWithAddress:&localWifiAddress]; +} + + +// Initialization methods + +-(instancetype)initWithReachabilityRef:(SCNetworkReachabilityRef)ref +{ + self = [super init]; + if (self != nil) + { + self.reachableOnWWAN = YES; + self.reachabilityRef = ref; + + // We need to create a serial queue. + // We allocate this once for the lifetime of the notifier. + + self.reachabilitySerialQueue = dispatch_queue_create("com.tonymillion.reachability", NULL); + } + + return self; +} + +-(void)dealloc +{ + [self stopNotifier]; + + if(self.reachabilityRef) + { + CFRelease(self.reachabilityRef); + self.reachabilityRef = nil; + } + + self.reachableBlock = nil; + self.unreachableBlock = nil; + self.reachabilitySerialQueue = nil; +} + +#pragma mark - Notifier Methods + +// Notifier +// NOTE: This uses GCD to trigger the blocks - they *WILL NOT* be called on THE MAIN THREAD +// - In other words DO NOT DO ANY UI UPDATES IN THE BLOCKS. +// INSTEAD USE dispatch_async(dispatch_get_main_queue(), ^{UISTUFF}) (or dispatch_sync if you want) + +-(BOOL)startNotifier +{ + // allow start notifier to be called multiple times + if(self.reachabilityObject && (self.reachabilityObject == self)) + { + return YES; + } + + + SCNetworkReachabilityContext context = { 0, NULL, NULL, NULL, NULL }; + context.info = (__bridge void *)self; + + if(SCNetworkReachabilitySetCallback(self.reachabilityRef, TMReachabilityCallback, &context)) + { + // Set it as our reachability queue, which will retain the queue + if(SCNetworkReachabilitySetDispatchQueue(self.reachabilityRef, self.reachabilitySerialQueue)) + { + // this should do a retain on ourself, so as long as we're in notifier mode we shouldn't disappear out from under ourselves + // woah + self.reachabilityObject = self; + return YES; + } + else + { +#ifdef DEBUG + NSLog(@"SCNetworkReachabilitySetDispatchQueue() failed: %s", SCErrorString(SCError())); +#endif + + // UH OH - FAILURE - stop any callbacks! + SCNetworkReachabilitySetCallback(self.reachabilityRef, NULL, NULL); + } + } + else + { +#ifdef DEBUG + NSLog(@"SCNetworkReachabilitySetCallback() failed: %s", SCErrorString(SCError())); +#endif + } + + // if we get here we fail at the internet + self.reachabilityObject = nil; + return NO; +} + +-(void)stopNotifier +{ + // First stop, any callbacks! + SCNetworkReachabilitySetCallback(self.reachabilityRef, NULL, NULL); + + // Unregister target from the GCD serial dispatch queue. + SCNetworkReachabilitySetDispatchQueue(self.reachabilityRef, NULL); + + self.reachabilityObject = nil; +} + +#pragma mark - reachability tests + +// This is for the case where you flick the airplane mode; +// you end up getting something like this: +// Reachability: WR ct----- +// Reachability: -- ------- +// Reachability: WR ct----- +// Reachability: -- ------- +// We treat this as 4 UNREACHABLE triggers - really apple should do better than this + +#define testcase (kSCNetworkReachabilityFlagsConnectionRequired | kSCNetworkReachabilityFlagsTransientConnection) + +-(BOOL)isReachableWithFlags:(SCNetworkReachabilityFlags)flags +{ + BOOL connectionUP = YES; + + if(!(flags & kSCNetworkReachabilityFlagsReachable)) + connectionUP = NO; + + if( (flags & testcase) == testcase ) + connectionUP = NO; + +#if TARGET_OS_IPHONE + if(flags & kSCNetworkReachabilityFlagsIsWWAN) + { + // We're on 3G. + if(!self.reachableOnWWAN) + { + // We don't want to connect when on 3G. + connectionUP = NO; + } + } +#endif + + return connectionUP; +} + +-(BOOL)isReachable +{ + SCNetworkReachabilityFlags flags; + + if(!SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) + return NO; + + return [self isReachableWithFlags:flags]; +} + +-(BOOL)isReachableViaWWAN +{ +#if TARGET_OS_IPHONE + + SCNetworkReachabilityFlags flags = 0; + + if(SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) + { + // Check we're REACHABLE + if(flags & kSCNetworkReachabilityFlagsReachable) + { + // Now, check we're on WWAN + if(flags & kSCNetworkReachabilityFlagsIsWWAN) + { + return YES; + } + } + } +#endif + + return NO; +} + +-(BOOL)isReachableViaWiFi +{ + SCNetworkReachabilityFlags flags = 0; + + if(SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) + { + // Check we're reachable + if((flags & kSCNetworkReachabilityFlagsReachable)) + { +#if TARGET_OS_IPHONE + // Check we're NOT on WWAN + if((flags & kSCNetworkReachabilityFlagsIsWWAN)) + { + return NO; + } +#endif + return YES; + } + } + + return NO; +} + + +// WWAN may be available, but not active until a connection has been established. +// WiFi may require a connection for VPN on Demand. +-(BOOL)isConnectionRequired +{ + return [self connectionRequired]; +} + +-(BOOL)connectionRequired +{ + SCNetworkReachabilityFlags flags; + + if(SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) + { + return (flags & kSCNetworkReachabilityFlagsConnectionRequired); + } + + return NO; +} + +// Dynamic, on demand connection? +-(BOOL)isConnectionOnDemand +{ + SCNetworkReachabilityFlags flags; + + if (SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) + { + return ((flags & kSCNetworkReachabilityFlagsConnectionRequired) && + (flags & (kSCNetworkReachabilityFlagsConnectionOnTraffic | kSCNetworkReachabilityFlagsConnectionOnDemand))); + } + + return NO; +} + +// Is user intervention required? +-(BOOL)isInterventionRequired +{ + SCNetworkReachabilityFlags flags; + + if (SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) + { + return ((flags & kSCNetworkReachabilityFlagsConnectionRequired) && + (flags & kSCNetworkReachabilityFlagsInterventionRequired)); + } + + return NO; +} + + +#pragma mark - reachability status stuff + +-(NetworkStatus)currentReachabilityStatus +{ + if([self isReachable]) + { + if([self isReachableViaWiFi]) + return ReachableViaWiFi; + +#if TARGET_OS_IPHONE + return ReachableViaWWAN; +#endif + } + + return NotReachable; +} + +-(SCNetworkReachabilityFlags)reachabilityFlags +{ + SCNetworkReachabilityFlags flags = 0; + + if(SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) + { + return flags; + } + + return 0; +} + +-(NSString*)currentReachabilityString +{ + NetworkStatus temp = [self currentReachabilityStatus]; + + if(temp == ReachableViaWWAN) + { + // Updated for the fact that we have CDMA phones now! + return NSLocalizedString(@"Cellular", @""); + } + if (temp == ReachableViaWiFi) + { + return NSLocalizedString(@"WiFi", @""); + } + + return NSLocalizedString(@"No Connection", @""); +} + +-(NSString*)currentReachabilityFlags +{ + return reachabilityFlags([self reachabilityFlags]); +} + +#pragma mark - Callback function calls this method + +-(void)reachabilityChanged:(SCNetworkReachabilityFlags)flags +{ + if([self isReachableWithFlags:flags]) + { + if(self.reachableBlock) + { + self.reachableBlock(self); + } + } + else + { + if(self.unreachableBlock) + { + self.unreachableBlock(self); + } + } + + // this makes sure the change notification happens on the MAIN THREAD + dispatch_async(dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:kMGLReachabilityChangedNotification + object:self]; + }); +} + +#pragma mark - Debug Description + +- (NSString *) description +{ + NSString *description = [NSString stringWithFormat:@"<%@: %#x (%@)>", + NSStringFromClass([self class]), (unsigned int) self, [self currentReachabilityFlags]]; + return description; +} + +@end diff --git a/platform/default/asset_file_source.cpp b/platform/default/asset_file_source.cpp deleted file mode 100644 index 7988654ae5..0000000000 --- a/platform/default/asset_file_source.cpp +++ /dev/null @@ -1,81 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -namespace { - -const std::string assetProtocol = "asset://"; - -} // namespace - -namespace mbgl { - -class AssetFileSource::Impl { -public: - Impl(ActorRef, std::string root_) - : root(std::move(root_)) { - } - - void request(const std::string& url, ActorRef req) { - Response response; - - if (!acceptsURL(url)) { - response.error = std::make_unique(Response::Error::Reason::Other, - "Invalid asset URL"); - req.invoke(&FileSourceRequest::setResponse, response); - return; - } - - // Cut off the protocol and prefix with path. - const auto path = root + "/" + mbgl::util::percentDecode(url.substr(assetProtocol.size())); - struct stat buf; - int result = stat(path.c_str(), &buf); - - if (result == 0 && (S_IFDIR & buf.st_mode)) { - response.error = std::make_unique(Response::Error::Reason::NotFound); - } else if (result == -1 && errno == ENOENT) { - response.error = std::make_unique(Response::Error::Reason::NotFound); - } else { - try { - response.data = std::make_shared(util::read_file(path)); - } catch (...) { - response.error = std::make_unique( - Response::Error::Reason::Other, - util::toString(std::current_exception())); - } - } - - req.invoke(&FileSourceRequest::setResponse, response); - } - -private: - std::string root; -}; - -AssetFileSource::AssetFileSource(const std::string& root) - : impl(std::make_unique>("AssetFileSource", root)) { -} - -AssetFileSource::~AssetFileSource() = default; - -std::unique_ptr AssetFileSource::request(const Resource& resource, Callback callback) { - auto req = std::make_unique(std::move(callback)); - - impl->actor().invoke(&Impl::request, resource.url, req->actor()); - - return std::move(req); -} - -bool AssetFileSource::acceptsURL(const std::string& url) { - return 0 == url.rfind(assetProtocol, 0); -} - -} // namespace mbgl diff --git a/platform/default/async_task.cpp b/platform/default/async_task.cpp deleted file mode 100644 index 50891056d8..0000000000 --- a/platform/default/async_task.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include - -#include - -#include -#include - -#include - -namespace mbgl { -namespace util { - -class AsyncTask::Impl { -public: - Impl(std::function&& fn) - : async(new uv_async_t), - task(std::move(fn)) { - - auto* loop = reinterpret_cast(RunLoop::getLoopHandle()); - if (uv_async_init(loop, async, asyncCallback) != 0) { - throw std::runtime_error("Failed to initialize async."); - } - - handle()->data = this; - uv_unref(handle()); - } - - ~Impl() { - uv_close(handle(), [](uv_handle_t* h) { - delete reinterpret_cast(h); - }); - } - - void maySend() { - // uv_async_send will do the call coalescing for us. - if (uv_async_send(async) != 0) { - throw std::runtime_error("Failed to async send."); - } - } - -private: - static void asyncCallback(uv_async_t* handle) { - reinterpret_cast(handle->data)->task(); - } - - uv_handle_t* handle() { - return reinterpret_cast(async); - } - - uv_async_t* async; - - std::function task; -}; - -AsyncTask::AsyncTask(std::function&& fn) - : impl(std::make_unique(std::move(fn))) { -} - -AsyncTask::~AsyncTask() = default; - -void AsyncTask::send() { - impl->maySend(); -} - -} // namespace util -} // namespace mbgl diff --git a/platform/default/bidi.cpp b/platform/default/bidi.cpp deleted file mode 100644 index 32a3dc23ef..0000000000 --- a/platform/default/bidi.cpp +++ /dev/null @@ -1,239 +0,0 @@ -#include -#include - -#include -#include - -#include - -namespace mbgl { - -class BiDiImpl { -public: - BiDiImpl() : bidiText(ubidi_open()), bidiLine(ubidi_open()) { - } - ~BiDiImpl() { - ubidi_close(bidiText); - ubidi_close(bidiLine); - } - - UBiDi* bidiText = nullptr; - UBiDi* bidiLine = nullptr; -}; - -BiDi::BiDi() : impl(std::make_unique()) {} -BiDi::~BiDi() = default; - -// Takes UTF16 input in logical order and applies Arabic shaping to the input while maintaining -// logical order. Output won't be intelligible until the bidirectional algorithm is applied -std::u16string applyArabicShaping(const std::u16string& input) { - UErrorCode errorCode = U_ZERO_ERROR; - - const int32_t outputLength = - u_shapeArabic(mbgl::utf16char_cast(input.c_str()), static_cast(input.size()), nullptr, 0, - (U_SHAPE_LETTERS_SHAPE & U_SHAPE_LETTERS_MASK) | - (U_SHAPE_TEXT_DIRECTION_LOGICAL & U_SHAPE_TEXT_DIRECTION_MASK), - &errorCode); - - // Pre-flighting will always set U_BUFFER_OVERFLOW_ERROR - errorCode = U_ZERO_ERROR; - - std::u16string outputText(outputLength, 0); - - u_shapeArabic(mbgl::utf16char_cast(input.c_str()), static_cast(input.size()), mbgl::utf16char_cast(&outputText[0]), outputLength, - (U_SHAPE_LETTERS_SHAPE & U_SHAPE_LETTERS_MASK) | - (U_SHAPE_TEXT_DIRECTION_LOGICAL & U_SHAPE_TEXT_DIRECTION_MASK), - &errorCode); - - // If the algorithm fails for any reason, fall back to non-transformed text - if (U_FAILURE(errorCode)) - return input; - - return outputText; -} - -void BiDi::mergeParagraphLineBreaks(std::set& lineBreakPoints) { - int32_t paragraphCount = ubidi_countParagraphs(impl->bidiText); - for (int32_t i = 0; i < paragraphCount; i++) { - UErrorCode errorCode = U_ZERO_ERROR; - int32_t paragraphEndIndex; - ubidi_getParagraphByIndex(impl->bidiText, i, nullptr, ¶graphEndIndex, nullptr, &errorCode); - - if (U_FAILURE(errorCode)) { - throw std::runtime_error(std::string("ProcessedBiDiText::mergeParagraphLineBreaks: ") + - u_errorName(errorCode)); - } - - lineBreakPoints.insert(static_cast(paragraphEndIndex)); - } -} - -std::vector BiDi::applyLineBreaking(std::set lineBreakPoints) { - // BiDi::getLine will error if called across a paragraph boundary, so we need to ensure that all - // paragraph boundaries are included in the set of line break points. The calling code might not - // include the line break because it didn't need to wrap at that point, or because the text was - // separated with a more exotic code point such as (U+001C) - mergeParagraphLineBreaks(lineBreakPoints); - - std::vector transformedLines; - transformedLines.reserve(lineBreakPoints.size()); - - std::size_t start = 0; - for (std::size_t lineBreakPoint : lineBreakPoints) { - transformedLines.push_back(getLine(start, lineBreakPoint)); - start = lineBreakPoint; - } - - return transformedLines; -} - -std::vector BiDi::processText(const std::u16string& input, - std::set lineBreakPoints) { - UErrorCode errorCode = U_ZERO_ERROR; - - ubidi_setPara(impl->bidiText, mbgl::utf16char_cast(input.c_str()), static_cast(input.size()), - UBIDI_DEFAULT_LTR, nullptr, &errorCode); - - if (U_FAILURE(errorCode)) { - throw std::runtime_error(std::string("BiDi::processText: ") + u_errorName(errorCode)); - } - - return applyLineBreaking(lineBreakPoints); -} - -std::vector BiDi::processStyledText(const StyledText& input, std::set lineBreakPoints) { - std::vector lines; - const auto& inputText = input.first; - const auto& styleIndices = input.second; - - UErrorCode errorCode = U_ZERO_ERROR; - - ubidi_setPara(impl->bidiText, mbgl::utf16char_cast(inputText.c_str()), static_cast(inputText.size()), - UBIDI_DEFAULT_LTR, nullptr, &errorCode); - - if (U_FAILURE(errorCode)) { - throw std::runtime_error(std::string("BiDi::processStyledText: ") + u_errorName(errorCode)); - } - - mergeParagraphLineBreaks(lineBreakPoints); - - std::size_t lineStartIndex = 0; - - for (std::size_t lineBreakPoint : lineBreakPoints) { - StyledText line; - line.second.reserve(lineBreakPoint - lineStartIndex); - - errorCode = U_ZERO_ERROR; - ubidi_setLine(impl->bidiText, static_cast(lineStartIndex), static_cast(lineBreakPoint), impl->bidiLine, &errorCode); - if (U_FAILURE(errorCode)) { - throw std::runtime_error(std::string("BiDi::processStyledText (setLine): ") + u_errorName(errorCode)); - } - - errorCode = U_ZERO_ERROR; - uint32_t runCount = ubidi_countRuns(impl->bidiLine, &errorCode); - if (U_FAILURE(errorCode)) { - throw std::runtime_error(std::string("BiDi::processStyledText (countRuns): ") + u_errorName(errorCode)); - } - - for (uint32_t runIndex = 0; runIndex < runCount; runIndex++) { - int32_t runLogicalStart; - int32_t runLength; - UBiDiDirection direction = ubidi_getVisualRun(impl->bidiLine, runIndex, &runLogicalStart, &runLength); - const bool isReversed = direction == UBIDI_RTL; - - std::size_t logicalStart = lineStartIndex + runLogicalStart; - std::size_t logicalEnd = logicalStart + runLength; - if (isReversed) { - // Within this reversed section, iterate logically backwards - // Each time we see a change in style, render a reversed chunk - // of everything since the last change - std::size_t styleRunStart = logicalEnd; - uint8_t currentStyleIndex = styleIndices.at(styleRunStart - 1); - for (std::size_t i = logicalEnd - 1; i >= logicalStart; i--) { - if (currentStyleIndex != styleIndices.at(i) || i == logicalStart) { - std::size_t styleRunEnd = i == logicalStart ? i : i + 1; - std::u16string reversed = writeReverse(inputText, styleRunEnd, styleRunStart); - line.first += reversed; - for (std::size_t j = 0; j < reversed.size(); j++) { - line.second.push_back(currentStyleIndex); - } - currentStyleIndex = styleIndices.at(i); - styleRunStart = styleRunEnd; - } - if (i == 0) { - break; - } - } - - } else { - line.first += input.first.substr(logicalStart, runLength); - line.second.insert(line.second.end(), styleIndices.begin() + logicalStart, styleIndices.begin() + logicalStart + runLength); - } - } - - lines.push_back(line); - lineStartIndex = lineBreakPoint; - } - - return lines; -} - -std::u16string BiDi::writeReverse(const std::u16string& input, std::size_t logicalStart, std::size_t logicalEnd) { - UErrorCode errorCode = U_ZERO_ERROR; - int32_t logicalLength = static_cast(logicalEnd - logicalStart); - std::u16string outputText(logicalLength + 1, 0); - - // UBIDI_DO_MIRRORING: Apply unicode mirroring of characters like parentheses - // UBIDI_REMOVE_BIDI_CONTROLS: Now that all the lines are set, remove control characters so that - // they don't show up on screen (some fonts have glyphs representing them) - int32_t outputLength = - ubidi_writeReverse(mbgl::utf16char_cast(&input[logicalStart]), - logicalLength, - mbgl::utf16char_cast(&outputText[0]), - logicalLength + 1, // Extra room for null terminator, although we don't really need to have ICU write it for us - UBIDI_DO_MIRRORING | UBIDI_REMOVE_BIDI_CONTROLS, - &errorCode); - - if (U_FAILURE(errorCode)) { - throw std::runtime_error(std::string("BiDi::writeReverse: ") + u_errorName(errorCode)); - } - - outputText.resize(outputLength); // REMOVE_BIDI_CONTROLS may have shrunk the string - - return outputText; -} - -std::u16string BiDi::getLine(std::size_t start, std::size_t end) { - UErrorCode errorCode = U_ZERO_ERROR; - ubidi_setLine(impl->bidiText, static_cast(start), static_cast(end), impl->bidiLine, &errorCode); - - if (U_FAILURE(errorCode)) { - throw std::runtime_error(std::string("BiDi::getLine (setLine): ") + u_errorName(errorCode)); - } - - // Because we set UBIDI_REMOVE_BIDI_CONTROLS, the output may be smaller than what we reserve - // Setting UBIDI_INSERT_LRM_FOR_NUMERIC would require - // ubidi_getLength(pBiDi)+2*ubidi_countRuns(pBiDi) - const int32_t outputLength = ubidi_getProcessedLength(impl->bidiLine); - std::u16string outputText(outputLength, 0); - - // UBIDI_DO_MIRRORING: Apply unicode mirroring of characters like parentheses - // UBIDI_REMOVE_BIDI_CONTROLS: Now that all the lines are set, remove control characters so that - // they don't show up on screen (some fonts have glyphs representing them) - int32_t finalLength = ubidi_writeReordered(impl->bidiLine, - mbgl::utf16char_cast(&outputText[0]), - outputLength, - UBIDI_DO_MIRRORING | UBIDI_REMOVE_BIDI_CONTROLS, - &errorCode); - - outputText.resize(finalLength); // REMOVE_BIDI_CONTROLS may have shrunk the string - - if (U_FAILURE(errorCode)) { - throw std::runtime_error(std::string("BiDi::getLine (writeReordered): ") + - u_errorName(errorCode)); - } - - return outputText; -} - -} // end namespace mbgl diff --git a/platform/default/collator.cpp b/platform/default/collator.cpp deleted file mode 100644 index b7f256756e..0000000000 --- a/platform/default/collator.cpp +++ /dev/null @@ -1,79 +0,0 @@ -#include -#include -#include -#include - -/* - The default implementation of Collator ignores locale. - Case sensitivity and collation order are based on - Default Unicode Collation Element Table (DUCET). - - Diacritic-insensitivity is implemented with nunicode's - non-standard "unaccent" functionality, which is tailored - to European languages. - - It would be possible to implement locale awareness using ICU, - but would require bundling locale data. -*/ - -namespace mbgl { -namespace style { -namespace expression { - -class Collator::Impl { -public: - Impl(bool caseSensitive_, bool diacriticSensitive_, optional) - : caseSensitive(caseSensitive_) - , diacriticSensitive(diacriticSensitive_) - {} - - bool operator==(const Impl& other) const { - return caseSensitive == other.caseSensitive && - diacriticSensitive == other.diacriticSensitive; - } - - int compare(const std::string& lhs, const std::string& rhs) const { - if (caseSensitive && diacriticSensitive) { - return nu_strcoll(lhs.c_str(), rhs.c_str(), - nu_utf8_read, nu_utf8_read); - } else if (!caseSensitive && diacriticSensitive) { - return nu_strcasecoll(lhs.c_str(), rhs.c_str(), - nu_utf8_read, nu_utf8_read); - } else if (caseSensitive && !diacriticSensitive) { - return nu_strcoll(platform::unaccent(lhs).c_str(), platform::unaccent(rhs).c_str(), - nu_utf8_read, nu_utf8_read); - } else { - return nu_strcasecoll(platform::unaccent(lhs).c_str(), platform::unaccent(rhs).c_str(), - nu_utf8_read, nu_utf8_read); - } - } - - std::string resolvedLocale() const { - return ""; - } -private: - bool caseSensitive; - bool diacriticSensitive; -}; - - -Collator::Collator(bool caseSensitive, bool diacriticSensitive, optional locale_) - : impl(std::make_shared(caseSensitive, diacriticSensitive, std::move(locale_))) -{} - -bool Collator::operator==(const Collator& other) const { - return *impl == *(other.impl); -} - -int Collator::compare(const std::string& lhs, const std::string& rhs) const { - return impl->compare(lhs, rhs); -} - -std::string Collator::resolvedLocale() const { - return impl->resolvedLocale(); -} - - -} // namespace expression -} // namespace style -} // namespace mbgl diff --git a/platform/default/default_file_source.cpp b/platform/default/default_file_source.cpp deleted file mode 100644 index cad68e7de9..0000000000 --- a/platform/default/default_file_source.cpp +++ /dev/null @@ -1,316 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -namespace mbgl { - -class DefaultFileSource::Impl { -public: - Impl(std::shared_ptr assetFileSource_, std::string cachePath, uint64_t maximumCacheSize) - : assetFileSource(assetFileSource_) - , localFileSource(std::make_unique()) - , offlineDatabase(std::make_unique(cachePath, maximumCacheSize)) { - } - - void setAPIBaseURL(const std::string& url) { - onlineFileSource.setAPIBaseURL(url); - } - - std::string getAPIBaseURL() const{ - return onlineFileSource.getAPIBaseURL(); - } - - void setAccessToken(const std::string& accessToken) { - onlineFileSource.setAccessToken(accessToken); - } - - std::string getAccessToken() const { - return onlineFileSource.getAccessToken(); - } - - void setResourceTransform(optional>&& transform) { - onlineFileSource.setResourceTransform(std::move(transform)); - } - - void listRegions(std::function)> callback) { - callback(offlineDatabase->listRegions()); - } - - void createRegion(const OfflineRegionDefinition& definition, - const OfflineRegionMetadata& metadata, - std::function)> callback) { - callback(offlineDatabase->createRegion(definition, metadata)); - } - - void mergeOfflineRegions(const std::string& sideDatabasePath, - std::function)> callback) { - callback(offlineDatabase->mergeDatabase(sideDatabasePath)); - } - - void updateMetadata(const int64_t regionID, - const OfflineRegionMetadata& metadata, - std::function)> callback) { - callback(offlineDatabase->updateMetadata(regionID, metadata)); - } - - void getRegionStatus(int64_t regionID, std::function)> callback) { - if (auto download = getDownload(regionID)) { - callback(download.value()->getStatus()); - } else { - callback(unexpected(download.error())); - } - } - - void deleteRegion(OfflineRegion&& region, std::function callback) { - downloads.erase(region.getID()); - callback(offlineDatabase->deleteRegion(std::move(region))); - } - - void setRegionObserver(int64_t regionID, std::unique_ptr observer) { - if (auto download = getDownload(regionID)) { - download.value()->setObserver(std::move(observer)); - } - } - - void setRegionDownloadState(int64_t regionID, OfflineRegionDownloadState state) { - if (auto download = getDownload(regionID)) { - download.value()->setState(state); - } - } - - void request(AsyncRequest* req, Resource resource, ActorRef ref) { - auto callback = [ref] (const Response& res) mutable { - ref.invoke(&FileSourceRequest::setResponse, res); - }; - - if (AssetFileSource::acceptsURL(resource.url)) { - //Asset request - tasks[req] = assetFileSource->request(resource, callback); - } else if (LocalFileSource::acceptsURL(resource.url)) { - //Local file request - tasks[req] = localFileSource->request(resource, callback); - } else { - // Try the offline database - if (resource.hasLoadingMethod(Resource::LoadingMethod::Cache)) { - auto offlineResponse = offlineDatabase->get(resource); - - if (resource.loadingMethod == Resource::LoadingMethod::CacheOnly) { - if (!offlineResponse) { - // Ensure there's always a response that we can send, so the caller knows that - // there's no optional data available in the cache, when it's the only place - // we're supposed to load from. - offlineResponse.emplace(); - offlineResponse->noContent = true; - offlineResponse->error = std::make_unique( - Response::Error::Reason::NotFound, "Not found in offline database"); - } else if (!offlineResponse->isUsable()) { - // Don't return resources the server requested not to show when they're stale. - // Even if we can't directly use the response, we may still use it to send a - // conditional HTTP request, which is why we're saving it above. - offlineResponse->error = std::make_unique( - Response::Error::Reason::NotFound, "Cached resource is unusable"); - } - callback(*offlineResponse); - } else if (offlineResponse) { - // Copy over the fields so that we can use them when making a refresh request. - resource.priorModified = offlineResponse->modified; - resource.priorExpires = offlineResponse->expires; - resource.priorEtag = offlineResponse->etag; - resource.priorData = offlineResponse->data; - - if (offlineResponse->isUsable()) { - callback(*offlineResponse); - } - } - } - - // Get from the online file source - if (resource.hasLoadingMethod(Resource::LoadingMethod::Network)) { - MBGL_TIMING_START(watch); - tasks[req] = onlineFileSource.request(resource, [=] (Response onlineResponse) mutable { - this->offlineDatabase->put(resource, onlineResponse); - if (resource.kind == Resource::Kind::Tile) { - // onlineResponse.data will be null if data not modified - MBGL_TIMING_FINISH(watch, - " Action: " << "Requesting," << - " URL: " << resource.url.c_str() << - " Size: " << (onlineResponse.data != nullptr ? onlineResponse.data->size() : 0) << "B," << - " Time") - } - callback(onlineResponse); - }); - } - } - } - - void cancel(AsyncRequest* req) { - tasks.erase(req); - } - - void setOfflineMapboxTileCountLimit(uint64_t limit) { - offlineDatabase->setOfflineMapboxTileCountLimit(limit); - } - - void setOnlineStatus(const bool status) { - onlineFileSource.setOnlineStatus(status); - } - - void put(const Resource& resource, const Response& response) { - offlineDatabase->put(resource, response); - } - -private: - expected getDownload(int64_t regionID) { - auto it = downloads.find(regionID); - if (it != downloads.end()) { - return it->second.get(); - } - auto definition = offlineDatabase->getRegionDefinition(regionID); - if (!definition) { - return unexpected(definition.error()); - } - auto download = std::make_unique(regionID, std::move(definition.value()), - *offlineDatabase, onlineFileSource); - return downloads.emplace(regionID, std::move(download)).first->second.get(); - } - - // shared so that destruction is done on the creating thread - const std::shared_ptr assetFileSource; - const std::unique_ptr localFileSource; - std::unique_ptr offlineDatabase; - OnlineFileSource onlineFileSource; - std::unordered_map> tasks; - std::unordered_map> downloads; -}; - -DefaultFileSource::DefaultFileSource(const std::string& cachePath, - const std::string& assetRoot, - uint64_t maximumCacheSize) - : DefaultFileSource(cachePath, std::make_unique(assetRoot), maximumCacheSize) { -} - -DefaultFileSource::DefaultFileSource(const std::string& cachePath, - std::unique_ptr&& assetFileSource_, - uint64_t maximumCacheSize) - : assetFileSource(std::move(assetFileSource_)) - , impl(std::make_unique>("DefaultFileSource", assetFileSource, cachePath, maximumCacheSize)) { -} - -DefaultFileSource::~DefaultFileSource() = default; - -void DefaultFileSource::setAPIBaseURL(const std::string& baseURL) { - impl->actor().invoke(&Impl::setAPIBaseURL, baseURL); - - { - std::lock_guard lock(cachedBaseURLMutex); - cachedBaseURL = baseURL; - } -} - -std::string DefaultFileSource::getAPIBaseURL() { - std::lock_guard lock(cachedBaseURLMutex); - return cachedBaseURL; -} - -void DefaultFileSource::setAccessToken(const std::string& accessToken) { - impl->actor().invoke(&Impl::setAccessToken, accessToken); - - { - std::lock_guard lock(cachedAccessTokenMutex); - cachedAccessToken = accessToken; - } -} - -std::string DefaultFileSource::getAccessToken() { - std::lock_guard lock(cachedAccessTokenMutex); - return cachedAccessToken; -} - -void DefaultFileSource::setResourceTransform(optional>&& transform) { - impl->actor().invoke(&Impl::setResourceTransform, std::move(transform)); -} - -std::unique_ptr DefaultFileSource::request(const Resource& resource, Callback callback) { - auto req = std::make_unique(std::move(callback)); - - req->onCancel([fs = impl->actor(), req = req.get()] () mutable { fs.invoke(&Impl::cancel, req); }); - - impl->actor().invoke(&Impl::request, req.get(), resource, req->actor()); - - return std::move(req); -} - -void DefaultFileSource::listOfflineRegions(std::function)> callback) { - impl->actor().invoke(&Impl::listRegions, callback); -} - -void DefaultFileSource::createOfflineRegion(const OfflineRegionDefinition& definition, - const OfflineRegionMetadata& metadata, - std::function)> callback) { - impl->actor().invoke(&Impl::createRegion, definition, metadata, callback); -} - -void DefaultFileSource::mergeOfflineRegions(const std::string& sideDatabasePath, - std::function)> callback) { - impl->actor().invoke(&Impl::mergeOfflineRegions, sideDatabasePath, callback); -} - -void DefaultFileSource::updateOfflineMetadata(const int64_t regionID, - const OfflineRegionMetadata& metadata, - std::function)> callback) { - impl->actor().invoke(&Impl::updateMetadata, regionID, metadata, callback); -} - -void DefaultFileSource::deleteOfflineRegion(OfflineRegion&& region, std::function callback) { - impl->actor().invoke(&Impl::deleteRegion, std::move(region), callback); -} - -void DefaultFileSource::setOfflineRegionObserver(OfflineRegion& region, std::unique_ptr observer) { - impl->actor().invoke(&Impl::setRegionObserver, region.getID(), std::move(observer)); -} - -void DefaultFileSource::setOfflineRegionDownloadState(OfflineRegion& region, OfflineRegionDownloadState state) { - impl->actor().invoke(&Impl::setRegionDownloadState, region.getID(), state); -} - -void DefaultFileSource::getOfflineRegionStatus(OfflineRegion& region, std::function)> callback) const { - impl->actor().invoke(&Impl::getRegionStatus, region.getID(), callback); -} - -void DefaultFileSource::setOfflineMapboxTileCountLimit(uint64_t limit) const { - impl->actor().invoke(&Impl::setOfflineMapboxTileCountLimit, limit); -} - -void DefaultFileSource::pause() { - impl->pause(); -} - -void DefaultFileSource::resume() { - impl->resume(); -} - -void DefaultFileSource::put(const Resource& resource, const Response& response) { - impl->actor().invoke(&Impl::put, resource, response); -} - -// For testing only: - -void DefaultFileSource::setOnlineStatus(const bool status) { - impl->actor().invoke(&Impl::setOnlineStatus, status); -} - -} // namespace mbgl diff --git a/platform/default/file_source_request.cpp b/platform/default/file_source_request.cpp deleted file mode 100644 index 09ea8cc32a..0000000000 --- a/platform/default/file_source_request.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include - -#include -#include - -namespace mbgl { - -FileSourceRequest::FileSourceRequest(FileSource::Callback&& callback) - : responseCallback(callback) - , mailbox(std::make_shared(*Scheduler::GetCurrent())) { -} - -FileSourceRequest::~FileSourceRequest() { - if (cancelCallback) { - cancelCallback(); - } - - mailbox->close(); -} - -void FileSourceRequest::onCancel(std::function&& callback) { - cancelCallback = std::move(callback); -} - -void FileSourceRequest::setResponse(const Response& response) { - // Copy, because calling the callback will sometimes self - // destroy this object. We cannot move because this method - // can be called more than one. - auto callback = responseCallback; - callback(response); -} - -ActorRef FileSourceRequest::actor() { - return ActorRef(*this, mailbox); -} - -} // namespace mbgl diff --git a/platform/default/headless_backend_osmesa.cpp b/platform/default/headless_backend_osmesa.cpp deleted file mode 100644 index 0da1caf9af..0000000000 --- a/platform/default/headless_backend_osmesa.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include -#include - -#include - -#include - -namespace mbgl { - -class OSMesaBackendImpl : public HeadlessBackend::Impl { -public: - OSMesaBackendImpl() { -#if OSMESA_MAJOR_VERSION * 100 + OSMESA_MINOR_VERSION >= 305 - glContext = OSMesaCreateContextExt(OSMESA_RGBA, 16, 0, 0, nullptr); -#else - glContext = OSMesaCreateContext(OSMESA_RGBA, nullptr); -#endif - if (glContext == nullptr) { - throw std::runtime_error("Error creating GL context object."); - } - } - - ~OSMesaBackendImpl() final { - OSMesaDestroyContext(glContext); - } - - gl::ProcAddress getExtensionFunctionPointer(const char* name) final { - return OSMesaGetProcAddress(name); - } - - void activateContext() final { - if (!OSMesaMakeCurrent(glContext, &fakeBuffer, GL_UNSIGNED_BYTE, 1, 1)) { - throw std::runtime_error("Switching OpenGL context failed.\n"); - } - } - -private: - OSMesaContext glContext = nullptr; - GLubyte fakeBuffer = 0; -}; - -void HeadlessBackend::createImpl() { - assert(!impl); - impl = std::make_unique(); -} - -} // namespace mbgl diff --git a/platform/default/http_file_source.cpp b/platform/default/http_file_source.cpp deleted file mode 100644 index 213b53de98..0000000000 --- a/platform/default/http_file_source.cpp +++ /dev/null @@ -1,495 +0,0 @@ -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - -// Dynamically load all cURL functions. Debian-derived systems upgraded the OpenSSL version linked -// to in https://salsa.debian.org/debian/curl/commit/95c94957bb7e89e36e78b995fed468c42f64d18d -// They state: -// Rename libcurl3 to libcurl4, because libcurl exposes an SSL_CTX via -// CURLOPT_SSL_CTX_FUNCTION, and this object changes incompatibly between -// openssl 1.0 and openssl 1.1. -// Since we are not accessing the underlying OpenSSL context, we don't care whether we're linking -// against libcurl3 or libcurl4; both use the ABI version 4 which hasn't changed since 2006 -// (see https://curl.haxx.se/libcurl/abi.html). In fact, cURL's ABI compatibility is very good as -// shown on https://abi-laboratory.pro/tracker/timeline/curl/ -// Therefore, we're dynamically loading the cURL symbols we need to avoid linking against versioned -// symbols. -#include - -namespace curl { - -#define CURL_FUNCTIONS \ - X(global_init) \ - X(getdate) \ - X(easy_strerror) \ - X(easy_init) \ - X(easy_setopt) \ - X(easy_cleanup) \ - X(easy_getinfo) \ - X(easy_reset) \ - X(multi_init) \ - X(multi_add_handle) \ - X(multi_remove_handle) \ - X(multi_cleanup) \ - X(multi_info_read) \ - X(multi_strerror) \ - X(multi_socket_action) \ - X(multi_setopt) \ - X(share_init) \ - X(share_cleanup) \ - X(slist_append) \ - X(slist_free_all) - -#define X(name) static decltype(&curl_ ## name) name = nullptr; -CURL_FUNCTIONS -#undef X - -static void* handle = nullptr; - -static void* load(const char* name) { - void* symbol = dlsym(handle, name); - if (const char* error = dlerror()) { - fprintf(stderr, "Cannot load symbol '%s': %s\n", name, error); - dlclose(handle); - handle = nullptr; - abort(); - } - return symbol; -} - -__attribute__((constructor)) -static void load() { - assert(!handle); - handle = dlopen("libcurl.so.4", RTLD_LAZY | RTLD_LOCAL); - if (!handle) { - fprintf(stderr, "Could not open shared library '%s'\n", "libcurl.so.4"); - abort(); - } - - #define X(name) name = (decltype(&curl_ ## name))load("curl_" #name); - CURL_FUNCTIONS - #undef X -} - -__attribute__((constructor)) -static void unload() { - if (handle) { - dlclose(handle); - } -} - -} // namespace curl - - -#include -#include -#include -#include -#include - -static void handleError(CURLMcode code) { - if (code != CURLM_OK) { - throw std::runtime_error(std::string("CURL multi error: ") + curl::multi_strerror(code)); - } -} - -static void handleError(CURLcode code) { - if (code != CURLE_OK) { - throw std::runtime_error(std::string("CURL easy error: ") + curl::easy_strerror(code)); - } -} - -namespace mbgl { - -class HTTPFileSource::Impl { -public: - Impl(); - ~Impl(); - - static int handleSocket(CURL *handle, curl_socket_t s, int action, void *userp, void *socketp); - static int startTimeout(CURLM *multi, long timeout_ms, void *userp); - static void onTimeout(HTTPFileSource::Impl *context); - - void perform(curl_socket_t s, util::RunLoop::Event event); - CURL *getHandle(); - void returnHandle(CURL *handle); - void checkMultiInfo(); - - // Used as the CURL timer function to periodically check for socket updates. - util::Timer timeout; - - // CURL multi handle that we use to request multiple URLs at the same time, without having to - // block and spawn threads. - CURLM *multi = nullptr; - - // CURL share handles are used for sharing session state (e.g.) - CURLSH *share = nullptr; - - // A queue that we use for storing resuable CURL easy handles to avoid creating and destroying - // them all the time. - std::queue handles; -}; - -class HTTPRequest : public AsyncRequest { -public: - HTTPRequest(HTTPFileSource::Impl*, Resource, FileSource::Callback); - ~HTTPRequest() override; - - void handleResult(CURLcode code); - -private: - static size_t headerCallback(char *const buffer, const size_t size, const size_t nmemb, void *userp); - static size_t writeCallback(void *const contents, const size_t size, const size_t nmemb, void *userp); - - HTTPFileSource::Impl* context = nullptr; - Resource resource; - FileSource::Callback callback; - - // Will store the current response. - std::shared_ptr data; - std::unique_ptr response; - - optional retryAfter; - optional xRateLimitReset; - - CURL *handle = nullptr; - curl_slist *headers = nullptr; - - char error[CURL_ERROR_SIZE] = { 0 }; -}; - -HTTPFileSource::Impl::Impl() { - if (curl::global_init(CURL_GLOBAL_ALL)) { - throw std::runtime_error("Could not init cURL"); - } - - share = curl::share_init(); - - multi = curl::multi_init(); - handleError(curl::multi_setopt(multi, CURLMOPT_SOCKETFUNCTION, handleSocket)); - handleError(curl::multi_setopt(multi, CURLMOPT_SOCKETDATA, this)); - handleError(curl::multi_setopt(multi, CURLMOPT_TIMERFUNCTION, startTimeout)); - handleError(curl::multi_setopt(multi, CURLMOPT_TIMERDATA, this)); -} - -HTTPFileSource::Impl::~Impl() { - while (!handles.empty()) { - curl::easy_cleanup(handles.front()); - handles.pop(); - } - - curl::multi_cleanup(multi); - multi = nullptr; - - curl::share_cleanup(share); - share = nullptr; - - timeout.stop(); -} - -CURL *HTTPFileSource::Impl::getHandle() { - if (!handles.empty()) { - auto handle = handles.front(); - handles.pop(); - return handle; - } else { - return curl::easy_init(); - } -} - -void HTTPFileSource::Impl::returnHandle(CURL *handle) { - curl::easy_reset(handle); - handles.push(handle); -} - -void HTTPFileSource::Impl::checkMultiInfo() { - CURLMsg *message = nullptr; - int pending = 0; - - while ((message = curl::multi_info_read(multi, &pending))) { - switch (message->msg) { - case CURLMSG_DONE: { - HTTPRequest *baton = nullptr; - curl::easy_getinfo(message->easy_handle, CURLINFO_PRIVATE, (char *)&baton); - assert(baton); - baton->handleResult(message->data.result); - } break; - - default: - // This should never happen, because there are no other message types. - throw std::runtime_error("CURLMsg returned unknown message type"); - } - } -} - -void HTTPFileSource::Impl::perform(curl_socket_t s, util::RunLoop::Event events) { - int flags = 0; - - if (events == util::RunLoop::Event::Read) { - flags |= CURL_CSELECT_IN; - } - if (events == util::RunLoop::Event::Write) { - flags |= CURL_CSELECT_OUT; - } - - - int running_handles = 0; - curl::multi_socket_action(multi, s, flags, &running_handles); - checkMultiInfo(); -} - -int HTTPFileSource::Impl::handleSocket(CURL * /* handle */, curl_socket_t s, int action, void *userp, - void * /* socketp */) { - assert(userp); - auto context = reinterpret_cast(userp); - - switch (action) { - case CURL_POLL_IN: { - using namespace std::placeholders; - util::RunLoop::Get()->addWatch(s, util::RunLoop::Event::Read, - std::bind(&Impl::perform, context, _1, _2)); - break; - } - case CURL_POLL_OUT: { - using namespace std::placeholders; - util::RunLoop::Get()->addWatch(s, util::RunLoop::Event::Write, - std::bind(&Impl::perform, context, _1, _2)); - break; - } - case CURL_POLL_REMOVE: - util::RunLoop::Get()->removeWatch(s); - break; - default: - throw std::runtime_error("Unhandled CURL socket action"); - } - - return 0; -} - -void HTTPFileSource::Impl::onTimeout(Impl *context) { - int running_handles; - CURLMcode error = curl::multi_socket_action(context->multi, CURL_SOCKET_TIMEOUT, 0, &running_handles); - if (error != CURLM_OK) { - throw std::runtime_error(std::string("CURL multi error: ") + curl::multi_strerror(error)); - } - context->checkMultiInfo(); -} - -int HTTPFileSource::Impl::startTimeout(CURLM * /* multi */, long timeout_ms, void *userp) { - assert(userp); - auto context = reinterpret_cast(userp); - - if (timeout_ms < 0) { - // A timeout of 0 ms means that the timer will invoked in the next loop iteration. - timeout_ms = 0; - } - - context->timeout.stop(); - context->timeout.start(mbgl::Milliseconds(timeout_ms), Duration::zero(), - std::bind(&Impl::onTimeout, context)); - - return 0; -} - -HTTPRequest::HTTPRequest(HTTPFileSource::Impl* context_, Resource resource_, FileSource::Callback callback_) - : context(context_), - resource(std::move(resource_)), - callback(std::move(callback_)), - handle(context->getHandle()) { - - // If there's already a response, set the correct etags/modified headers to make sure we are - // getting a 304 response if possible. This avoids redownloading unchanged data. - if (resource.priorEtag) { - const std::string header = std::string("If-None-Match: ") + *resource.priorEtag; - headers = curl::slist_append(headers, header.c_str()); - } else if (resource.priorModified) { - const std::string time = - std::string("If-Modified-Since: ") + util::rfc1123(*resource.priorModified); - headers = curl::slist_append(headers, time.c_str()); - } - - if (headers) { - curl::easy_setopt(handle, CURLOPT_HTTPHEADER, headers); - } - - handleError(curl::easy_setopt(handle, CURLOPT_PRIVATE, this)); - handleError(curl::easy_setopt(handle, CURLOPT_ERRORBUFFER, error)); - handleError(curl::easy_setopt(handle, CURLOPT_CAINFO, "ca-bundle.crt")); - handleError(curl::easy_setopt(handle, CURLOPT_FOLLOWLOCATION, 1)); - handleError(curl::easy_setopt(handle, CURLOPT_URL, resource.url.c_str())); - handleError(curl::easy_setopt(handle, CURLOPT_WRITEFUNCTION, writeCallback)); - handleError(curl::easy_setopt(handle, CURLOPT_WRITEDATA, this)); - handleError(curl::easy_setopt(handle, CURLOPT_HEADERFUNCTION, headerCallback)); - handleError(curl::easy_setopt(handle, CURLOPT_HEADERDATA, this)); -#if LIBCURL_VERSION_NUM >= ((7) << 16 | (21) << 8 | 6) // Renamed in 7.21.6 - handleError(curl::easy_setopt(handle, CURLOPT_ACCEPT_ENCODING, "gzip, deflate")); -#else - handleError(curl::easy_setopt(handle, CURLOPT_ENCODING, "gzip, deflate")); -#endif - handleError(curl::easy_setopt(handle, CURLOPT_USERAGENT, "MapboxGL/1.0")); - handleError(curl::easy_setopt(handle, CURLOPT_SHARE, context->share)); - - // Start requesting the information. - handleError(curl::multi_add_handle(context->multi, handle)); -} - -HTTPRequest::~HTTPRequest() { - handleError(curl::multi_remove_handle(context->multi, handle)); - context->returnHandle(handle); - handle = nullptr; - - if (headers) { - curl::slist_free_all(headers); - headers = nullptr; - } -} - -// This function is called when we have new data for a request. We just append it to the string -// containing the previous data. -size_t HTTPRequest::writeCallback(void *const contents, const size_t size, const size_t nmemb, void *userp) { - assert(userp); - auto impl = reinterpret_cast(userp); - - if (!impl->data) { - impl->data = std::make_shared(); - } - - impl->data->append((char *)contents, size * nmemb); - return size * nmemb; -} - -// Compares the beginning of the (non-zero-terminated!) data buffer with the (zero-terminated!) -// header string. If the data buffer contains the header string at the beginning, it returns -// the length of the header string == begin of the value, otherwise it returns npos. -// The comparison of the header is ASCII-case-insensitive. -size_t headerMatches(const char *const header, const char *const buffer, const size_t length) { - const size_t headerLength = strlen(header); - if (length < headerLength) { - return std::string::npos; - } - size_t i = 0; - while (i < length && i < headerLength && std::tolower(buffer[i]) == std::tolower(header[i])) { - i++; - } - return i == headerLength ? i : std::string::npos; -} - -size_t HTTPRequest::headerCallback(char *const buffer, const size_t size, const size_t nmemb, void *userp) { - assert(userp); - auto baton = reinterpret_cast(userp); - - if (!baton->response) { - baton->response = std::make_unique(); - } - - const size_t length = size * nmemb; - size_t begin = std::string::npos; - if ((begin = headerMatches("last-modified: ", buffer, length)) != std::string::npos) { - // Always overwrite the modification date; We might already have a value here from the - // Date header, but this one is more accurate. - const std::string value { buffer + begin, length - begin - 2 }; // remove \r\n - baton->response->modified = Timestamp{ Seconds(curl::getdate(value.c_str(), nullptr)) }; - } else if ((begin = headerMatches("etag: ", buffer, length)) != std::string::npos) { - baton->response->etag = std::string(buffer + begin, length - begin - 2); // remove \r\n - } else if ((begin = headerMatches("cache-control: ", buffer, length)) != std::string::npos) { - const std::string value { buffer + begin, length - begin - 2 }; // remove \r\n - const auto cc = http::CacheControl::parse(value.c_str()); - baton->response->expires = cc.toTimePoint(); - baton->response->mustRevalidate = cc.mustRevalidate; - } else if ((begin = headerMatches("expires: ", buffer, length)) != std::string::npos) { - const std::string value { buffer + begin, length - begin - 2 }; // remove \r\n - baton->response->expires = Timestamp{ Seconds(curl::getdate(value.c_str(), nullptr)) }; - } else if ((begin = headerMatches("retry-after: ", buffer, length)) != std::string::npos) { - baton->retryAfter = std::string(buffer + begin, length - begin - 2); // remove \r\n - } else if ((begin = headerMatches("x-rate-limit-reset: ", buffer, length)) != std::string::npos) { - baton->xRateLimitReset = std::string(buffer + begin, length - begin - 2); // remove \r\n - } - - return length; -} - -void HTTPRequest::handleResult(CURLcode code) { - // Make sure a response object exists in case we haven't got any headers or content. - if (!response) { - response = std::make_unique(); - } - - using Error = Response::Error; - - // Add human-readable error code - if (code != CURLE_OK) { - switch (code) { - case CURLE_COULDNT_RESOLVE_PROXY: - case CURLE_COULDNT_RESOLVE_HOST: - case CURLE_COULDNT_CONNECT: - case CURLE_OPERATION_TIMEDOUT: - - response->error = std::make_unique( - Error::Reason::Connection, std::string{ curl::easy_strerror(code) } + ": " + error); - break; - - default: - response->error = std::make_unique( - Error::Reason::Other, std::string{ curl::easy_strerror(code) } + ": " + error); - break; - } - } else { - long responseCode = 0; - curl::easy_getinfo(handle, CURLINFO_RESPONSE_CODE, &responseCode); - - if (responseCode == 200) { - if (data) { - response->data = std::move(data); - } else { - response->data = std::make_shared(); - } - } else if (responseCode == 204 || (responseCode == 404 && resource.kind == Resource::Kind::Tile)) { - response->noContent = true; - } else if (responseCode == 304) { - response->notModified = true; - } else if (responseCode == 404) { - response->error = - std::make_unique(Error::Reason::NotFound, "HTTP status code 404"); - } else if (responseCode == 429) { - response->error = - std::make_unique(Error::Reason::RateLimit, "HTTP status code 429", - http::parseRetryHeaders(retryAfter, xRateLimitReset)); - } else if (responseCode >= 500 && responseCode < 600) { - response->error = - std::make_unique(Error::Reason::Server, std::string{ "HTTP status code " } + - util::toString(responseCode)); - } else { - response->error = - std::make_unique(Error::Reason::Other, std::string{ "HTTP status code " } + - util::toString(responseCode)); - } - } - - // Calling `callback` may result in deleting `this`. Copy data to temporaries first. - auto callback_ = callback; - auto response_ = *response; - callback_(response_); -} - -HTTPFileSource::HTTPFileSource() - : impl(std::make_unique()) { -} - -HTTPFileSource::~HTTPFileSource() = default; - -std::unique_ptr HTTPFileSource::request(const Resource& resource, Callback callback) { - return std::make_unique(impl.get(), resource, callback); -} - -} // namespace mbgl diff --git a/platform/default/image.cpp b/platform/default/image.cpp deleted file mode 100644 index 25063892b7..0000000000 --- a/platform/default/image.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include -#include -#include - -namespace mbgl { - -PremultipliedImage decodePNG(const uint8_t*, size_t); -PremultipliedImage decodeJPEG(const uint8_t*, size_t); - -PremultipliedImage decodeImage(const std::string& string) { - const auto* data = reinterpret_cast(string.data()); - const size_t size = string.size(); - - if (size >= 4) { - uint32_t magic = (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3]; - if (magic == 0x89504E47U) { - return decodePNG(data, size); - } - } - - if (size >= 2) { - uint16_t magic = ((data[0] << 8) | data[1]) & 0xffff; - if (magic == 0xFFD8) { - return decodeJPEG(data, size); - } - } - - throw std::runtime_error("unsupported image type"); -} - -} // namespace mbgl diff --git a/platform/default/include/jni/string_conversion.hpp b/platform/default/include/jni/string_conversion.hpp new file mode 100644 index 0000000000..66df539f4e --- /dev/null +++ b/platform/default/include/jni/string_conversion.hpp @@ -0,0 +1,17 @@ +#pragma once + +// This file replaces the default implementation in jni.hpp. + +#include + +namespace jni { + +inline std::u16string convertUTF8ToUTF16(const std::string& str) { + return mbgl::util::convertUTF8ToUTF16(str); +} + +inline std::string convertUTF16ToUTF8(const std::u16string& str) { + return mbgl::util::convertUTF16ToUTF8(str); +} + +} // namespace jni diff --git a/platform/default/include/mbgl/gl/headless_backend.hpp b/platform/default/include/mbgl/gl/headless_backend.hpp new file mode 100644 index 0000000000..7757037533 --- /dev/null +++ b/platform/default/include/mbgl/gl/headless_backend.hpp @@ -0,0 +1,50 @@ +#pragma once + +#include + +#include +#include + +namespace mbgl { + +class HeadlessBackend : public RendererBackend { +public: + HeadlessBackend(Size = { 256, 256 }); + ~HeadlessBackend() override; + + void bind() override; + Size getFramebufferSize() const override; + void updateAssumedState() override; + + void setSize(Size); + PremultipliedImage readStillImage(); + + class Impl { + public: + virtual ~Impl() = default; + virtual gl::ProcAddress getExtensionFunctionPointer(const char*) = 0; + virtual void activateContext() = 0; + virtual void deactivateContext() {} + }; + +private: + // Implementation specific functions + gl::ProcAddress getExtensionFunctionPointer(const char*) override; + + void activate() override; + void deactivate() override; + + void createImpl(); + +private: + std::unique_ptr impl; + + Size size; + float pixelRatio; + bool active = false; + + class View; + std::unique_ptr view; +}; + +} // namespace mbgl diff --git a/platform/default/include/mbgl/gl/headless_frontend.hpp b/platform/default/include/mbgl/gl/headless_frontend.hpp new file mode 100644 index 0000000000..18f0cfa537 --- /dev/null +++ b/platform/default/include/mbgl/gl/headless_frontend.hpp @@ -0,0 +1,61 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +#include + +namespace mbgl { + +class FileSource; +class Scheduler; +class Renderer; +class RendererBackend; +class Map; +class TransformState; + +class HeadlessFrontend : public RendererFrontend { +public: + HeadlessFrontend(float pixelRatio_, FileSource&, Scheduler&, const optional programCacheDir = {}, GLContextMode mode = GLContextMode::Unique, const optional localFontFamily = {}); + HeadlessFrontend(Size, float pixelRatio_, FileSource&, Scheduler&, const optional programCacheDir = {}, GLContextMode mode = GLContextMode::Unique, const optional localFontFamily = {}); + ~HeadlessFrontend() override; + + void reset() override; + void update(std::shared_ptr) override; + void setObserver(RendererObserver&) override; + + Size getSize() const; + void setSize(Size); + + Renderer* getRenderer(); + RendererBackend* getBackend(); + CameraOptions getCameraOptions(); + + bool hasImage(const std::string&); + bool hasLayer(const std::string&); + bool hasSource(const std::string&); + + ScreenCoordinate pixelForLatLng(const LatLng&); + LatLng latLngForPixel(const ScreenCoordinate&); + + PremultipliedImage readStillImage(); + PremultipliedImage render(Map&); + + optional getTransformState() const; + +private: + Size size; + float pixelRatio; + + HeadlessBackend backend; + util::AsyncTask asyncInvalidate; + + std::unique_ptr renderer; + std::shared_ptr updateParameters; +}; + +} // namespace mbgl diff --git a/platform/default/include/mbgl/map/map_snapshotter.hpp b/platform/default/include/mbgl/map/map_snapshotter.hpp new file mode 100644 index 0000000000..2deb2b3cda --- /dev/null +++ b/platform/default/include/mbgl/map/map_snapshotter.hpp @@ -0,0 +1,66 @@ +#pragma once + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace mbgl { + +template class ActorRef; +struct CameraOptions; +class FileSource; +class Size; +class LatLngBounds; + +namespace style { +class Style; +} // namespace style + +class MapSnapshotter { +public: + MapSnapshotter(FileSource* fileSource, + std::shared_ptr scheduler, + const std::pair style, + const Size&, + const float pixelRatio, + const optional cameraOptions, + const optional region, + const optional cacheDir = {}, + const optional localFontFamily = {}); + + ~MapSnapshotter(); + + void setStyleURL(const std::string& styleURL); + std::string getStyleURL() const; + + void setStyleJSON(const std::string& styleJSON); + std::string getStyleJSON() const; + + void setSize(const Size&); + Size getSize() const; + + void setCameraOptions(const CameraOptions&); + CameraOptions getCameraOptions() const; + + void setRegion(const LatLngBounds&); + LatLngBounds getRegion() const; + + using PointForFn = std::function; + using LatLngForFn = std::function; + using Attributions = std::vector; + using Callback = std::function; + void snapshot(ActorRef); + +private: + class Impl; + std::unique_ptr> impl; +}; + +} // namespace mbgl diff --git a/platform/default/include/mbgl/storage/file_source_request.hpp b/platform/default/include/mbgl/storage/file_source_request.hpp new file mode 100644 index 0000000000..6bd0d44df6 --- /dev/null +++ b/platform/default/include/mbgl/storage/file_source_request.hpp @@ -0,0 +1,31 @@ +#pragma once + +#include +#include +#include + +#include +#include + +namespace mbgl { + +class Mailbox; + +class FileSourceRequest : public AsyncRequest { +public: + FileSourceRequest(FileSource::Callback&& callback); + ~FileSourceRequest() final; + + void onCancel(std::function&& callback); + void setResponse(const Response& res); + + ActorRef actor(); + +private: + FileSource::Callback responseCallback = nullptr; + std::function cancelCallback = nullptr; + + std::shared_ptr mailbox; +}; + +} // namespace mbgl diff --git a/platform/default/include/mbgl/storage/merge_sideloaded.hpp b/platform/default/include/mbgl/storage/merge_sideloaded.hpp new file mode 100644 index 0000000000..494018c966 --- /dev/null +++ b/platform/default/include/mbgl/storage/merge_sideloaded.hpp @@ -0,0 +1,53 @@ +#pragma once + +// THIS IS A GENERATED FILE; EDIT merge_sideloaded.sql INSTEAD +// To regenerate, run `node platform/default/mbgl/storage/merge_sideloaded.js` + +namespace mbgl { + +static constexpr const char* mergeSideloadedDatabaseSQL = +"INSERT INTO regions\n" +" SELECT DISTINCT NULL, sr.definition, sr.description\n" +" FROM side.regions sr \n" +" LEFT JOIN regions r ON sr.definition = r.definition AND sr.description IS r.description\n" +" WHERE r.definition IS NULL;\n" +"CREATE TEMPORARY TABLE region_mapping AS\n" +" SELECT sr.id AS side_region_id,\n" +" r.id AS main_region_id\n" +" FROM side.regions sr\n" +" JOIN regions r ON sr.definition = r.definition AND sr.description IS r.description;\n" +"REPLACE INTO tiles\n" +" SELECT t.id,\n" +" st.url_template, st.pixel_ratio, st.z, st.x, st.y,\n" +" st.expires, st.modified, st.etag, st.data, st.compressed, st.accessed, st.must_revalidate\n" +" FROM (SELECT DISTINCT sti.* FROM side.region_tiles srt JOIN side.tiles sti ON srt.tile_id = sti.id)\n" +" AS st\n" +" LEFT JOIN tiles t ON st.url_template = t.url_template AND st.pixel_ratio = t.pixel_ratio AND st.z = t.z AND st.x = t.x AND st.y = t.y\n" +" WHERE t.id IS NULL\n" +" OR st.modified > t.modified;\n" +"INSERT OR IGNORE INTO region_tiles\n" +" SELECT rm.main_region_id, sti.id\n" +" FROM side.region_tiles srt\n" +" JOIN region_mapping rm ON srt.region_id = rm.side_region_id\n" +" JOIN (SELECT t.id, st.id AS side_tile_id FROM side.tiles st\n" +" JOIN tiles t ON st.url_template = t.url_template AND st.pixel_ratio = t.pixel_ratio AND st.z = t.z AND st.x = t.x AND st.y = t.y\n" +" ) AS sti ON srt.tile_id = sti.side_tile_id;\n" +"REPLACE INTO resources\n" +" SELECT r.id, \n" +" sr.url, sr.kind, sr.expires, sr.modified, sr.etag,\n" +" sr.data, sr.compressed, sr.accessed, sr.must_revalidate\n" +" FROM side.region_resources srr JOIN side.resources sr ON srr.resource_id = sr.id\n" +" LEFT JOIN resources r ON sr.url = r.url\n" +" WHERE r.id IS NULL\n" +" OR sr.modified > r.modified;\n" +"INSERT OR IGNORE INTO region_resources\n" +" SELECT rm.main_region_id, sri.id\n" +" FROM side.region_resources srr\n" +" JOIN region_mapping rm ON srr.region_id = rm.side_region_id\n" +" JOIN (SELECT r.id, sr.id AS side_resource_id FROM side.resources sr\n" +" JOIN resources r ON sr.url = r.url) AS sri ON srr.resource_id = sri.side_resource_id;\n" +" \n" +"DROP TABLE region_mapping;\n" +; + +} // namespace mbgl diff --git a/platform/default/include/mbgl/storage/merge_sideloaded.js b/platform/default/include/mbgl/storage/merge_sideloaded.js new file mode 100644 index 0000000000..98d52eb8b3 --- /dev/null +++ b/platform/default/include/mbgl/storage/merge_sideloaded.js @@ -0,0 +1,21 @@ +var fs = require('fs'); +fs.writeFileSync('platform/default/mbgl/storage/merge_sideloaded.hpp', `#pragma once + +// THIS IS A GENERATED FILE; EDIT merge_sideloaded.sql INSTEAD +// To regenerate, run \`node platform/default/mbgl/storage/merge_sideloaded.js\` + +namespace mbgl { + +static constexpr const char* mergeSideloadedDatabaseSQL = +${fs.readFileSync('platform/default/mbgl/storage/merge_sideloaded.sql', 'utf8') + .replace(/ *--.*/g, '') + .split('\n') + .filter(a => a) + .map(line => '"' + line + '\\n"') + .join('\n') +} +; + +} // namespace mbgl +`); + diff --git a/platform/default/include/mbgl/storage/merge_sideloaded.sql b/platform/default/include/mbgl/storage/merge_sideloaded.sql new file mode 100644 index 0000000000..55345a6f15 --- /dev/null +++ b/platform/default/include/mbgl/storage/merge_sideloaded.sql @@ -0,0 +1,51 @@ +INSERT INTO regions + SELECT DISTINCT NULL, sr.definition, sr.description -- Merge duplicate regions + FROM side.regions sr + LEFT JOIN regions r ON sr.definition = r.definition AND sr.description IS r.description + WHERE r.definition IS NULL; + +CREATE TEMPORARY TABLE region_mapping AS + SELECT sr.id AS side_region_id, + r.id AS main_region_id + FROM side.regions sr + JOIN regions r ON sr.definition = r.definition AND sr.description IS r.description; + +--Insert /Update tiles +REPLACE INTO tiles + SELECT t.id, -- use the old ID in case we run a REPLACE. If it doesn't exist yet, it'll be NULL which will auto-assign a new ID. + st.url_template, st.pixel_ratio, st.z, st.x, st.y, + st.expires, st.modified, st.etag, st.data, st.compressed, st.accessed, st.must_revalidate + FROM (SELECT DISTINCT sti.* FROM side.region_tiles srt JOIN side.tiles sti ON srt.tile_id = sti.id) -- ensure that we're only considering region tiles, and not ambient tiles. + AS st + LEFT JOIN tiles t ON st.url_template = t.url_template AND st.pixel_ratio = t.pixel_ratio AND st.z = t.z AND st.x = t.x AND st.y = t.y + WHERE t.id IS NULL -- only consider tiles that don't exist yet in the original database. + OR st.modified > t.modified; -- ...or tiles that are newer in the side loaded DB. + +-- Update region_tiles usage +INSERT OR IGNORE INTO region_tiles + SELECT rm.main_region_id, sti.id + FROM side.region_tiles srt + JOIN region_mapping rm ON srt.region_id = rm.side_region_id + JOIN (SELECT t.id, st.id AS side_tile_id FROM side.tiles st + JOIN tiles t ON st.url_template = t.url_template AND st.pixel_ratio = t.pixel_ratio AND st.z = t.z AND st.x = t.x AND st.y = t.y + ) AS sti ON srt.tile_id = sti.side_tile_id; + +-- copy over resources +REPLACE INTO resources + SELECT r.id, + sr.url, sr.kind, sr.expires, sr.modified, sr.etag, + sr.data, sr.compressed, sr.accessed, sr.must_revalidate + FROM side.region_resources srr JOIN side.resources sr ON srr.resource_id = sr.id --only consider region resources, and not ambient resources. + LEFT JOIN resources r ON sr.url = r.url + WHERE r.id IS NULL -- only consider resources that don't exist yet in the main database + OR sr.modified > r.modified; -- ...or resources that are newer in the side loaded DB. + +-- Update region_resources usage +INSERT OR IGNORE INTO region_resources + SELECT rm.main_region_id, sri.id + FROM side.region_resources srr + JOIN region_mapping rm ON srr.region_id = rm.side_region_id + JOIN (SELECT r.id, sr.id AS side_resource_id FROM side.resources sr + JOIN resources r ON sr.url = r.url) AS sri ON srr.resource_id = sri.side_resource_id; + +DROP TABLE region_mapping; \ No newline at end of file diff --git a/platform/default/include/mbgl/storage/offline_database.hpp b/platform/default/include/mbgl/storage/offline_database.hpp new file mode 100644 index 0000000000..993f36a606 --- /dev/null +++ b/platform/default/include/mbgl/storage/offline_database.hpp @@ -0,0 +1,130 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +namespace mapbox { +namespace sqlite { +class Database; +class Statement; +class Query; +class Exception; +} // namespace sqlite +} // namespace mapbox + +namespace mbgl { + +class Response; +class TileID; + +namespace util { +struct IOException; +} // namespace util + +struct MapboxTileLimitExceededException : util::Exception { + MapboxTileLimitExceededException() : util::Exception("Mapbox tile limit exceeded") {} +}; + +class OfflineDatabase : private util::noncopyable { +public: + // Limits affect ambient caching (put) only; resources required by offline + // regions are exempt. + OfflineDatabase(std::string path, uint64_t maximumCacheSize = util::DEFAULT_MAX_CACHE_SIZE); + ~OfflineDatabase(); + + optional get(const Resource&); + + // Return value is (inserted, stored size) + std::pair put(const Resource&, const Response&); + + expected listRegions(); + + expected createRegion(const OfflineRegionDefinition&, + const OfflineRegionMetadata&); + + expected + mergeDatabase(const std::string& sideDatabasePath); + + expected + updateMetadata(const int64_t regionID, const OfflineRegionMetadata&); + + std::exception_ptr deleteRegion(OfflineRegion&&); + + // Return value is (response, stored size) + optional> getRegionResource(int64_t regionID, const Resource&); + optional hasRegionResource(int64_t regionID, const Resource&); + uint64_t putRegionResource(int64_t regionID, const Resource&, const Response&); + void putRegionResources(int64_t regionID, const std::list>&, OfflineRegionStatus&); + + expected getRegionDefinition(int64_t regionID); + expected getRegionCompletedStatus(int64_t regionID); + + void setOfflineMapboxTileCountLimit(uint64_t); + uint64_t getOfflineMapboxTileCountLimit(); + bool offlineMapboxTileCountLimitExceeded(); + uint64_t getOfflineMapboxTileCount(); + bool exceedsOfflineMapboxTileCountLimit(const Resource&); + +private: + void initialize(); + void handleError(const mapbox::sqlite::Exception&, const char* action); + void handleError(const util::IOException&, const char* action); + + void removeExisting(); + void removeOldCacheTable(); + void createSchema(); + void migrateToVersion5(); + void migrateToVersion3(); + void migrateToVersion6(); + + mapbox::sqlite::Statement& getStatement(const char *); + + optional> getTile(const Resource::TileData&); + optional hasTile(const Resource::TileData&); + bool putTile(const Resource::TileData&, const Response&, + const std::string&, bool compressed); + + optional> getResource(const Resource&); + optional hasResource(const Resource&); + bool putResource(const Resource&, const Response&, + const std::string&, bool compressed); + + uint64_t putRegionResourceInternal(int64_t regionID, const Resource&, const Response&); + + optional> getInternal(const Resource&); + optional hasInternal(const Resource&); + std::pair putInternal(const Resource&, const Response&, bool evict); + + // Return value is true iff the resource was previously unused by any other regions. + bool markUsed(int64_t regionID, const Resource&); + + std::pair getCompletedResourceCountAndSize(int64_t regionID); + std::pair getCompletedTileCountAndSize(int64_t regionID); + + const std::string path; + std::unique_ptr db; + std::unordered_map> statements; + + template + T getPragma(const char *); + + uint64_t maximumCacheSize; + + uint64_t offlineMapboxTileCountLimit = util::mapbox::DEFAULT_OFFLINE_TILE_COUNT_LIMIT; + optional offlineMapboxTileCount; + + bool evict(uint64_t neededFreeSize); +}; + +} // namespace mbgl diff --git a/platform/default/include/mbgl/storage/offline_download.hpp b/platform/default/include/mbgl/storage/offline_download.hpp new file mode 100644 index 0000000000..1e77ff1d35 --- /dev/null +++ b/platform/default/include/mbgl/storage/offline_download.hpp @@ -0,0 +1,69 @@ +#pragma once + +#include +#include +#include + +#include +#include +#include +#include + +namespace mbgl { + +class OfflineDatabase; +class FileSource; +class AsyncRequest; +class Response; +class Tileset; + +namespace style { +class Parser; +} // namespace style + +/** + * Coordinates the request and storage of all resources for an offline region. + + * @private + */ +class OfflineDownload { +public: + OfflineDownload(int64_t id, OfflineRegionDefinition&&, OfflineDatabase& offline, OnlineFileSource& online); + ~OfflineDownload(); + + void setObserver(std::unique_ptr); + void setState(OfflineRegionDownloadState); + + OfflineRegionStatus getStatus() const; + +private: + void activateDownload(); + void continueDownload(); + void deactivateDownload(); + + /* + * Ensure that the resource is stored in the database, requesting it if necessary. + * While the request is in progress, it is recorded in `requests`. If the download + * is deactivated, all in progress requests are cancelled. + */ + void ensureResource(const Resource&, std::function = {}); + + void onMapboxTileCountLimitExceeded(); + + int64_t id; + OfflineRegionDefinition definition; + OfflineDatabase& offlineDatabase; + OnlineFileSource& onlineFileSource; + OfflineRegionStatus status; + std::unique_ptr observer; + + std::list> requests; + std::unordered_set requiredSourceURLs; + std::deque resourcesRemaining; + std::list> buffer; + + void queueResource(Resource); + void queueTiles(style::SourceType, uint16_t tileSize, const Tileset&); +}; + +} // namespace mbgl diff --git a/platform/default/include/mbgl/storage/offline_schema.hpp b/platform/default/include/mbgl/storage/offline_schema.hpp new file mode 100644 index 0000000000..e177d0dbd3 --- /dev/null +++ b/platform/default/include/mbgl/storage/offline_schema.hpp @@ -0,0 +1,63 @@ +#pragma once + +// THIS IS A GENERATED FILE; EDIT offline_schema.sql INSTEAD +// To regenerate, run `node platform/default/mbgl/storage/offline_schema.js` + +namespace mbgl { + +static constexpr const char* offlineDatabaseSchema = +"CREATE TABLE resources (\n" +" id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n" +" url TEXT NOT NULL,\n" +" kind INTEGER NOT NULL,\n" +" expires INTEGER,\n" +" modified INTEGER,\n" +" etag TEXT,\n" +" data BLOB,\n" +" compressed INTEGER NOT NULL DEFAULT 0,\n" +" accessed INTEGER NOT NULL,\n" +" must_revalidate INTEGER NOT NULL DEFAULT 0,\n" +" UNIQUE (url)\n" +");\n" +"CREATE TABLE tiles (\n" +" id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n" +" url_template TEXT NOT NULL,\n" +" pixel_ratio INTEGER NOT NULL,\n" +" z INTEGER NOT NULL,\n" +" x INTEGER NOT NULL,\n" +" y INTEGER NOT NULL,\n" +" expires INTEGER,\n" +" modified INTEGER,\n" +" etag TEXT,\n" +" data BLOB,\n" +" compressed INTEGER NOT NULL DEFAULT 0,\n" +" accessed INTEGER NOT NULL,\n" +" must_revalidate INTEGER NOT NULL DEFAULT 0,\n" +" UNIQUE (url_template, pixel_ratio, z, x, y)\n" +");\n" +"CREATE TABLE regions (\n" +" id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n" +" definition TEXT NOT NULL,\n" +" description BLOB\n" +");\n" +"CREATE TABLE region_resources (\n" +" region_id INTEGER NOT NULL REFERENCES regions(id) ON DELETE CASCADE,\n" +" resource_id INTEGER NOT NULL REFERENCES resources(id),\n" +" UNIQUE (region_id, resource_id)\n" +");\n" +"CREATE TABLE region_tiles (\n" +" region_id INTEGER NOT NULL REFERENCES regions(id) ON DELETE CASCADE,\n" +" tile_id INTEGER NOT NULL REFERENCES tiles(id),\n" +" UNIQUE (region_id, tile_id)\n" +");\n" +"CREATE INDEX resources_accessed\n" +"ON resources (accessed);\n" +"CREATE INDEX tiles_accessed\n" +"ON tiles (accessed);\n" +"CREATE INDEX region_resources_resource_id\n" +"ON region_resources (resource_id);\n" +"CREATE INDEX region_tiles_tile_id\n" +"ON region_tiles (tile_id);\n" +; + +} // namespace mbgl diff --git a/platform/default/include/mbgl/storage/offline_schema.js b/platform/default/include/mbgl/storage/offline_schema.js new file mode 100644 index 0000000000..fdb7dc6405 --- /dev/null +++ b/platform/default/include/mbgl/storage/offline_schema.js @@ -0,0 +1,21 @@ +var fs = require('fs'); +fs.writeFileSync('platform/default/mbgl/storage/offline_schema.hpp', `#pragma once + +// THIS IS A GENERATED FILE; EDIT offline_schema.sql INSTEAD +// To regenerate, run \`node platform/default/mbgl/storage/offline_schema.js\` + +namespace mbgl { + +static constexpr const char* offlineDatabaseSchema = +${fs.readFileSync('platform/default/mbgl/storage/offline_schema.sql', 'utf8') + .replace(/ *--.*/g, '') + .split('\n') + .filter(a => a) + .map(line => '"' + line + '\\n"') + .join('\n') +} +; + +} // namespace mbgl +`); + diff --git a/platform/default/include/mbgl/storage/offline_schema.sql b/platform/default/include/mbgl/storage/offline_schema.sql new file mode 100644 index 0000000000..722b0e0451 --- /dev/null +++ b/platform/default/include/mbgl/storage/offline_schema.sql @@ -0,0 +1,64 @@ +CREATE TABLE resources ( -- Generic table for style, source, sprite, and glyph resources. + id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + url TEXT NOT NULL, + kind INTEGER NOT NULL, + expires INTEGER, + modified INTEGER, + etag TEXT, + data BLOB, + compressed INTEGER NOT NULL DEFAULT 0, + accessed INTEGER NOT NULL, + must_revalidate INTEGER NOT NULL DEFAULT 0, + UNIQUE (url) +); + +CREATE TABLE tiles ( + id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + url_template TEXT NOT NULL, + pixel_ratio INTEGER NOT NULL, + z INTEGER NOT NULL, + x INTEGER NOT NULL, + y INTEGER NOT NULL, + expires INTEGER, + modified INTEGER, + etag TEXT, + data BLOB, + compressed INTEGER NOT NULL DEFAULT 0, + accessed INTEGER NOT NULL, + must_revalidate INTEGER NOT NULL DEFAULT 0, + UNIQUE (url_template, pixel_ratio, z, x, y) +); + +CREATE TABLE regions ( + id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + definition TEXT NOT NULL, -- JSON formatted definition of region. Regions may be of variant types: + -- e.g. bbox and zoom range, route path, flyTo parameters, etc. Note that + -- the set of tiles required for a region may span multiple sources. + description BLOB -- User provided data in user-defined format +); + +CREATE TABLE region_resources ( + region_id INTEGER NOT NULL REFERENCES regions(id) ON DELETE CASCADE, + resource_id INTEGER NOT NULL REFERENCES resources(id), + UNIQUE (region_id, resource_id) +); + +CREATE TABLE region_tiles ( + region_id INTEGER NOT NULL REFERENCES regions(id) ON DELETE CASCADE, + tile_id INTEGER NOT NULL REFERENCES tiles(id), + UNIQUE (region_id, tile_id) +); + +-- Indexes for efficient eviction queries + +CREATE INDEX resources_accessed +ON resources (accessed); + +CREATE INDEX tiles_accessed +ON tiles (accessed); + +CREATE INDEX region_resources_resource_id +ON region_resources (resource_id); + +CREATE INDEX region_tiles_tile_id +ON region_tiles (tile_id); diff --git a/platform/default/include/mbgl/storage/sqlite3.hpp b/platform/default/include/mbgl/storage/sqlite3.hpp new file mode 100644 index 0000000000..44dc746075 --- /dev/null +++ b/platform/default/include/mbgl/storage/sqlite3.hpp @@ -0,0 +1,180 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +namespace mapbox { +namespace sqlite { + +enum OpenFlag : int { + ReadOnly = 0b001, + ReadWriteCreate = 0b110, +}; + +enum class ResultCode : uint8_t { + OK = 0, + Error = 1, + Internal = 2, + Perm = 3, + Abort = 4, + Busy = 5, + Locked = 6, + NoMem = 7, + ReadOnly = 8, + Interrupt = 9, + IOErr = 10, + Corrupt = 11, + NotFound = 12, + Full = 13, + CantOpen = 14, + Protocol = 15, + Schema = 17, + TooBig = 18, + Constraint = 19, + Mismatch = 20, + Misuse = 21, + NoLFS = 22, + Auth = 23, + Range = 25, + NotADB = 26, +}; + +enum class ExtendedResultCode : uint8_t { + Unknown = 0, + ReadOnlyDBMoved = 4, +}; + +class Exception : public std::runtime_error { +public: + Exception(ResultCode err, const char* msg) : Exception(static_cast(err), msg) {} + Exception(int err, const char* msg) : Exception(err, std::string{ msg }) {} + Exception(int err, const std::string& msg) + : std::runtime_error(msg), + code(static_cast(err)), + extendedCode(static_cast(err >> 8)) { + } + const ResultCode code = ResultCode::OK; + const ExtendedResultCode extendedCode = ExtendedResultCode::Unknown; +}; + +class DatabaseImpl; +class Statement; +class StatementImpl; +class Query; +class Transaction; + +void setTempPath(const std::string&); + +class Database { +private: + Database(std::unique_ptr); + +public: + Database(const Database &) = delete; + Database &operator=(const Database &) = delete; + static mapbox::util::variant tryOpen(const std::string &filename, int flags = 0); + static Database open(const std::string &filename, int flags = 0); + + Database(Database &&); + ~Database(); + Database &operator=(Database &&); + + void setBusyTimeout(std::chrono::milliseconds); + void exec(const std::string &sql); + +private: + std::unique_ptr impl; + + friend class Statement; + friend class Transaction; +}; + +// A Statement object represents a prepared statement that can be run repeatedly run with a Query object. +class Statement { +public: + Statement(Database& db, const char* sql); + Statement(const Statement&) = delete; + Statement(Statement&&) = delete; + Statement& operator=(const Statement&) = delete; + Statement& operator=(Statement&&) = delete; + ~Statement(); + + friend class Query; + +private: + std::unique_ptr impl; + +#ifndef NDEBUG + // This flag stores whether there exists a Query object that uses this prepared statement. + // There may only be one Query object at a time. Statement objects must outlive Query objects. + // While a Query object exists, a Statement object may not be moved or deleted. + bool used = false; +#endif +}; + +// A Query object is used to run a database query with a prepared statement (stored in a Statement +// object). There may only exist one Query object per Statement object. Query objects are designed +// to be constructed and destroyed frequently. +class Query { +public: + Query(Statement&); + Query(const Query&) = delete; + Query(Query&&) = delete; + Query& operator=(const Query&) = delete; + Query& operator=(Query&&) = delete; + ~Query(); + + template + void bind(int offset, T value); + + // Text + void bind(int offset, const char*, std::size_t length, bool retain = true); + void bind(int offset, const std::string&, bool retain = true); + + // Blob + void bindBlob(int offset, const void*, std::size_t length, bool retain = true); + void bindBlob(int offset, const std::vector&, bool retain = true); + + template + T get(int offset); + + bool run(); + void reset(); + void clearBindings(); + + int64_t lastInsertRowId() const; + uint64_t changes() const; + +private: + Statement& stmt; +}; + +class Transaction { +public: + Transaction(const Transaction&) = delete; + Transaction(Transaction&&) = delete; + Transaction& operator=(const Transaction&) = delete; + + enum Mode { + Deferred, + Immediate, + Exclusive + }; + + Transaction(Database&, Mode = Deferred); + ~Transaction(); + + void commit(); + void rollback(); + +private: + DatabaseImpl& dbImpl; + bool needRollback = true; +}; + +} // namespace sqlite +} // namespace mapbox diff --git a/platform/default/include/mbgl/text/unaccent.hpp b/platform/default/include/mbgl/text/unaccent.hpp new file mode 100644 index 0000000000..85ac37a7de --- /dev/null +++ b/platform/default/include/mbgl/text/unaccent.hpp @@ -0,0 +1,13 @@ +#pragma once + +#include + +namespace mbgl { +namespace platform { + +// Non-locale-aware diacritic folding based on nunicode +// Used as a fallback when locale-aware comparisons aren't available +std::string unaccent(const std::string &string); + +} // namespace platform +} // namespace mbgl diff --git a/platform/default/include/mbgl/util/default_styles.hpp b/platform/default/include/mbgl/util/default_styles.hpp new file mode 100644 index 0000000000..13f08252a7 --- /dev/null +++ b/platform/default/include/mbgl/util/default_styles.hpp @@ -0,0 +1,30 @@ +#pragma once + +#include +#include + +namespace mbgl { +namespace util { +namespace default_styles { + +struct DefaultStyle { + const char* url; + const char* name; + const unsigned currentVersion; +}; + +constexpr const DefaultStyle streets = { "mapbox://styles/mapbox/streets-v10", "Streets", 10 }; +constexpr const DefaultStyle outdoors = { "mapbox://styles/mapbox/outdoors-v10", "Outdoors", 10 }; +constexpr const DefaultStyle light = { "mapbox://styles/mapbox/light-v9", "Light", 9 }; +constexpr const DefaultStyle dark = { "mapbox://styles/mapbox/dark-v9", "Dark", 9 }; +constexpr const DefaultStyle satellite = { "mapbox://styles/mapbox/satellite-v9", "Satellite", 9 }; +constexpr const DefaultStyle satelliteStreets = { "mapbox://styles/mapbox/satellite-streets-v10", "Satellite Streets", 10 }; + +const DefaultStyle orderedStyles[] = { + streets, outdoors, light, dark, satellite, satelliteStreets, +}; +const size_t numOrderedStyles = sizeof(orderedStyles) / sizeof(DefaultStyle); + +} // end namespace default_styles +} // end namespace util +} // end namespace mbgl diff --git a/platform/default/include/mbgl/util/default_thread_pool.hpp b/platform/default/include/mbgl/util/default_thread_pool.hpp new file mode 100644 index 0000000000..a14d16d771 --- /dev/null +++ b/platform/default/include/mbgl/util/default_thread_pool.hpp @@ -0,0 +1,27 @@ +#pragma once + +#include + +#include +#include +#include +#include + +namespace mbgl { + +class ThreadPool : public Scheduler { +public: + ThreadPool(std::size_t count); + ~ThreadPool() override; + + void schedule(std::weak_ptr) override; + +private: + std::vector threads; + std::queue> queue; + std::mutex mutex; + std::condition_variable cv; + bool terminate { false }; +}; + +} // namespace mbgl diff --git a/platform/default/include/mbgl/util/shared_thread_pool.hpp b/platform/default/include/mbgl/util/shared_thread_pool.hpp new file mode 100644 index 0000000000..04a3cb58d5 --- /dev/null +++ b/platform/default/include/mbgl/util/shared_thread_pool.hpp @@ -0,0 +1,9 @@ +#pragma once + +#include + +namespace mbgl { + +std::shared_ptr sharedThreadPool(); + +} // namespace mbgl diff --git a/platform/default/jni/string_conversion.hpp b/platform/default/jni/string_conversion.hpp deleted file mode 100644 index 66df539f4e..0000000000 --- a/platform/default/jni/string_conversion.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -// This file replaces the default implementation in jni.hpp. - -#include - -namespace jni { - -inline std::u16string convertUTF8ToUTF16(const std::string& str) { - return mbgl::util::convertUTF8ToUTF16(str); -} - -inline std::string convertUTF16ToUTF8(const std::u16string& str) { - return mbgl::util::convertUTF16ToUTF8(str); -} - -} // namespace jni diff --git a/platform/default/jpeg_reader.cpp b/platform/default/jpeg_reader.cpp deleted file mode 100644 index 5f613f9423..0000000000 --- a/platform/default/jpeg_reader.cpp +++ /dev/null @@ -1,151 +0,0 @@ -#include -#include - -#include -#include -#include - -extern "C" -{ -#include -} - -namespace mbgl { - -const static unsigned BUF_SIZE = 4096; - -struct jpeg_stream_wrapper { - jpeg_source_mgr manager; - std::istream* stream; - std::array buffer; -}; - -static void init_source(j_decompress_ptr cinfo) { - auto* wrap = reinterpret_cast(cinfo->src); - wrap->stream->seekg(0, std::ios_base::beg); -} - -static boolean fill_input_buffer(j_decompress_ptr cinfo) { - auto* wrap = reinterpret_cast(cinfo->src); - wrap->stream->read(reinterpret_cast(&wrap->buffer[0]), BUF_SIZE); - std::streamsize size = wrap->stream->gcount(); - wrap->manager.next_input_byte = wrap->buffer.data(); - wrap->manager.bytes_in_buffer = BUF_SIZE; - return (size > 0) ? TRUE : FALSE; -} - -static void skip(j_decompress_ptr cinfo, long count) { - if (count <= 0) return; // A zero or negative skip count should be treated as a no-op. - auto* wrap = reinterpret_cast(cinfo->src); - - if (wrap->manager.bytes_in_buffer > 0 && count < static_cast(wrap->manager.bytes_in_buffer)) - { - wrap->manager.bytes_in_buffer -= count; - wrap->manager.next_input_byte = &wrap->buffer[BUF_SIZE - wrap->manager.bytes_in_buffer]; - } - else - { - wrap->stream->seekg(count - wrap->manager.bytes_in_buffer, std::ios_base::cur); - // trigger buffer fill - wrap->manager.next_input_byte = nullptr; - wrap->manager.bytes_in_buffer = 0; // bytes_in_buffer may be zero on return. - } -} - -static void term(j_decompress_ptr) {} - -static void attach_stream(j_decompress_ptr cinfo, std::istream* in) { - if (cinfo->src == nullptr) { - cinfo->src = (struct jpeg_source_mgr *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof(jpeg_stream_wrapper)); - } - auto * src = reinterpret_cast (cinfo->src); - src->manager.init_source = init_source; - src->manager.fill_input_buffer = fill_input_buffer; - src->manager.skip_input_data = skip; - src->manager.resync_to_restart = jpeg_resync_to_restart; - src->manager.term_source = term; - src->manager.bytes_in_buffer = 0; - src->manager.next_input_byte = nullptr; - src->stream = in; -} - -static void on_error(j_common_ptr) {} - -static void on_error_message(j_common_ptr cinfo) { - char buffer[JMSG_LENGTH_MAX]; - (*cinfo->err->format_message)(cinfo, buffer); - throw std::runtime_error(std::string("JPEG Reader: libjpeg could not read image: ") + buffer); -} - -struct jpeg_info_guard { - jpeg_info_guard(jpeg_decompress_struct* cinfo) - : i_(cinfo) {} - - ~jpeg_info_guard() { - jpeg_destroy_decompress(i_); - } - - jpeg_decompress_struct* i_; -}; - -PremultipliedImage decodeJPEG(const uint8_t* data, size_t size) { - util::CharArrayBuffer dataBuffer { reinterpret_cast(data), size }; - std::istream stream(&dataBuffer); - - jpeg_decompress_struct cinfo; - jpeg_info_guard iguard(&cinfo); - jpeg_error_mgr jerr; - cinfo.err = jpeg_std_error(&jerr); - jerr.error_exit = on_error; - jerr.output_message = on_error_message; - jpeg_create_decompress(&cinfo); - attach_stream(&cinfo, &stream); - - int ret = jpeg_read_header(&cinfo, TRUE); - if (ret != JPEG_HEADER_OK) - throw std::runtime_error("JPEG Reader: failed to read header"); - - jpeg_start_decompress(&cinfo); - - if (cinfo.out_color_space == JCS_UNKNOWN) - throw std::runtime_error("JPEG Reader: failed to read unknown color space"); - - if (cinfo.output_width == 0 || cinfo.output_height == 0) - throw std::runtime_error("JPEG Reader: failed to read image size"); - - size_t width = cinfo.output_width; - size_t height = cinfo.output_height; - size_t components = cinfo.output_components; - size_t rowStride = components * width; - - PremultipliedImage image({ static_cast(width), static_cast(height) }); - uint8_t* dst = image.data.get(); - - JSAMPARRAY buffer = (*cinfo.mem->alloc_sarray)((j_common_ptr) &cinfo, JPOOL_IMAGE, rowStride, 1); - - while (cinfo.output_scanline < cinfo.output_height) { - jpeg_read_scanlines(&cinfo, buffer, 1); - - for (size_t i = 0; i < width; ++i) { - dst[0] = buffer[0][components * i]; - dst[3] = 0xFF; - - if (components > 2) { - dst[1] = buffer[0][components * i + 1]; - dst[2] = buffer[0][components * i + 2]; - } else { - dst[1] = dst[0]; - dst[2] = dst[0]; - } - - dst += 4; - } - } - - jpeg_finish_decompress(&cinfo); - - return image; -} - -} // namespace mbgl diff --git a/platform/default/layer_manager.cpp b/platform/default/layer_manager.cpp deleted file mode 100644 index 05d0f4d1ae..0000000000 --- a/platform/default/layer_manager.cpp +++ /dev/null @@ -1,79 +0,0 @@ -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -namespace mbgl { - -class LayerManagerDefault final : public LayerManager { -public: - LayerManagerDefault(); - -private: - void addLayerType(std::unique_ptr); - // LayerManager overrides. - LayerFactory* getFactory(const std::string& type) noexcept final; - LayerFactory* getFactory(const style::LayerTypeInfo*) noexcept final; - - std::vector> factories; - std::map typeToFactory; -}; - -LayerManagerDefault::LayerManagerDefault() { - addLayerType(std::make_unique()); - addLayerType(std::make_unique()); - addLayerType(std::make_unique()); - addLayerType(std::make_unique()); - addLayerType(std::make_unique()); - addLayerType(std::make_unique()); - addLayerType(std::make_unique()); - addLayerType(std::make_unique()); - addLayerType(std::make_unique()); - addLayerType(std::make_unique()); -} - -void LayerManagerDefault::addLayerType(std::unique_ptr factory) { - std::string type{factory->getTypeInfo()->type}; - if (!type.empty()) { - typeToFactory.emplace(std::make_pair(std::move(type), factory.get())); - } - factories.emplace_back(std::move(factory)); -} - -LayerFactory* LayerManagerDefault::getFactory(const mbgl::style::LayerTypeInfo* typeInfo) noexcept { - assert(typeInfo); - for (const auto& factory: factories) { - if (factory->getTypeInfo() == typeInfo) { - return factory.get(); - } - } - assert(false); - return nullptr; -} - -LayerFactory* LayerManagerDefault::getFactory(const std::string& type) noexcept { - auto search = typeToFactory.find(type); - return (search != typeToFactory.end()) ? search->second : nullptr; -} - -// static -LayerManager* LayerManager::get() noexcept { - static LayerManagerDefault instance; - return &instance; -} - -const bool LayerManager::annotationsEnabled = true; - -} // namespace mbgl diff --git a/platform/default/local_file_source.cpp b/platform/default/local_file_source.cpp deleted file mode 100644 index 1b7b7b9278..0000000000 --- a/platform/default/local_file_source.cpp +++ /dev/null @@ -1,81 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#if defined(_WINDOWS) && !defined(S_ISDIR) -#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -#endif - -namespace { - -const std::string fileProtocol = "file://"; - -} // namespace - -namespace mbgl { - -class LocalFileSource::Impl { -public: - Impl(ActorRef) {} - - void request(const std::string& url, ActorRef req) { - Response response; - - if (!acceptsURL(url)) { - response.error = std::make_unique(Response::Error::Reason::Other, - "Invalid file URL"); - req.invoke(&FileSourceRequest::setResponse, response); - return; - } - - // Cut off the protocol and prefix with path. - const auto path = mbgl::util::percentDecode(url.substr(fileProtocol.size())); - struct stat buf; - int result = stat(path.c_str(), &buf); - - if (result == 0 && S_ISDIR(buf.st_mode)) { - response.error = std::make_unique(Response::Error::Reason::NotFound); - } else if (result == -1 && errno == ENOENT) { - response.error = std::make_unique(Response::Error::Reason::NotFound); - } else { - try { - response.data = std::make_shared(util::read_file(path)); - } catch (...) { - response.error = std::make_unique( - Response::Error::Reason::Other, - util::toString(std::current_exception())); - } - } - - req.invoke(&FileSourceRequest::setResponse, response); - } - -}; - -LocalFileSource::LocalFileSource() - : impl(std::make_unique>("LocalFileSource")) { -} - -LocalFileSource::~LocalFileSource() = default; - -std::unique_ptr LocalFileSource::request(const Resource& resource, Callback callback) { - auto req = std::make_unique(std::move(callback)); - - impl->actor().invoke(&Impl::request, resource.url, req->actor()); - - return std::move(req); -} - -bool LocalFileSource::acceptsURL(const std::string& url) { - return 0 == url.rfind(fileProtocol, 0); -} - -} // namespace mbgl diff --git a/platform/default/local_glyph_rasterizer.cpp b/platform/default/local_glyph_rasterizer.cpp deleted file mode 100644 index 7866f29420..0000000000 --- a/platform/default/local_glyph_rasterizer.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include - -namespace mbgl { - -class LocalGlyphRasterizer::Impl { -}; - -LocalGlyphRasterizer::LocalGlyphRasterizer(const optional) -{} - -LocalGlyphRasterizer::~LocalGlyphRasterizer() -{} - -bool LocalGlyphRasterizer::canRasterizeGlyph(const FontStack&, GlyphID) { - return false; -} - -Glyph LocalGlyphRasterizer::rasterizeGlyph(const FontStack&, GlyphID) { - return Glyph(); -} - -} // namespace mbgl diff --git a/platform/default/logging_stderr.cpp b/platform/default/logging_stderr.cpp deleted file mode 100644 index 41585fb7bb..0000000000 --- a/platform/default/logging_stderr.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include -#include - -#include - -namespace mbgl { - -void Log::platformRecord(EventSeverity severity, const std::string &msg) { - std::cerr << "[" << Enum::toString(severity) << "] " << msg << std::endl; -} - -} // namespace mbgl diff --git a/platform/default/mbgl/gl/headless_backend.cpp b/platform/default/mbgl/gl/headless_backend.cpp deleted file mode 100644 index ba08aecab7..0000000000 --- a/platform/default/mbgl/gl/headless_backend.cpp +++ /dev/null @@ -1,85 +0,0 @@ -#include -#include -#include - -#include -#include -#include - -namespace mbgl { - -class HeadlessBackend::View { -public: - View(gl::Context& context, Size size_) - : color(context.createRenderbuffer(size_)), - depthStencil(context.createRenderbuffer(size_)), - framebuffer(context.createFramebuffer(color, depthStencil)) { - } - - gl::Renderbuffer color; - gl::Renderbuffer depthStencil; - gl::Framebuffer framebuffer; -}; - -HeadlessBackend::HeadlessBackend(Size size_) - : size(size_) { -} - -HeadlessBackend::~HeadlessBackend() { - BackendScope guard { *this }; - view.reset(); - context.reset(); -} - -gl::ProcAddress HeadlessBackend::getExtensionFunctionPointer(const char* name) { - assert(impl); - return impl->getExtensionFunctionPointer(name); -} - -void HeadlessBackend::activate() { - active = true; - - if (!impl) { - createImpl(); - } - - assert(impl); - impl->activateContext(); -} - -void HeadlessBackend::deactivate() { - assert(impl); - impl->deactivateContext(); - active = false; -} - -void HeadlessBackend::bind() { - gl::Context& context_ = getContext(); - - if (!view) { - view = std::make_unique(context_, size); - } - - context_.bindFramebuffer = view->framebuffer.framebuffer; - context_.scissorTest = false; - context_.viewport = { 0, 0, size }; -} - -Size HeadlessBackend::getFramebufferSize() const { - return size; -} - -void HeadlessBackend::updateAssumedState() { - // no-op -} - -void HeadlessBackend::setSize(Size size_) { - size = size_; - view.reset(); -} - -PremultipliedImage HeadlessBackend::readStillImage() { - return getContext().readFramebuffer(size); -} - -} // namespace mbgl diff --git a/platform/default/mbgl/gl/headless_backend.hpp b/platform/default/mbgl/gl/headless_backend.hpp deleted file mode 100644 index 7757037533..0000000000 --- a/platform/default/mbgl/gl/headless_backend.hpp +++ /dev/null @@ -1,50 +0,0 @@ -#pragma once - -#include - -#include -#include - -namespace mbgl { - -class HeadlessBackend : public RendererBackend { -public: - HeadlessBackend(Size = { 256, 256 }); - ~HeadlessBackend() override; - - void bind() override; - Size getFramebufferSize() const override; - void updateAssumedState() override; - - void setSize(Size); - PremultipliedImage readStillImage(); - - class Impl { - public: - virtual ~Impl() = default; - virtual gl::ProcAddress getExtensionFunctionPointer(const char*) = 0; - virtual void activateContext() = 0; - virtual void deactivateContext() {} - }; - -private: - // Implementation specific functions - gl::ProcAddress getExtensionFunctionPointer(const char*) override; - - void activate() override; - void deactivate() override; - - void createImpl(); - -private: - std::unique_ptr impl; - - Size size; - float pixelRatio; - bool active = false; - - class View; - std::unique_ptr view; -}; - -} // namespace mbgl diff --git a/platform/default/mbgl/gl/headless_frontend.cpp b/platform/default/mbgl/gl/headless_frontend.cpp deleted file mode 100644 index 37b0f91f32..0000000000 --- a/platform/default/mbgl/gl/headless_frontend.cpp +++ /dev/null @@ -1,144 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -namespace mbgl { - -HeadlessFrontend::HeadlessFrontend(float pixelRatio_, FileSource& fileSource, Scheduler& scheduler, const optional programCacheDir, GLContextMode mode, const optional localFontFamily) - : HeadlessFrontend({ 256, 256 }, pixelRatio_, fileSource, scheduler, programCacheDir, mode, localFontFamily) { -} - -HeadlessFrontend::HeadlessFrontend(Size size_, float pixelRatio_, FileSource& fileSource, Scheduler& scheduler, const optional programCacheDir, GLContextMode mode, const optional localFontFamily) - : size(size_), - pixelRatio(pixelRatio_), - backend({ static_cast(size.width * pixelRatio), - static_cast(size.height * pixelRatio) }), - asyncInvalidate([this] { - if (renderer && updateParameters) { - mbgl::BackendScope guard { backend }; - renderer->render(*updateParameters); - } - }), - renderer(std::make_unique(backend, pixelRatio, fileSource, scheduler, mode, programCacheDir, localFontFamily)) { -} - -HeadlessFrontend::~HeadlessFrontend() = default; - -void HeadlessFrontend::reset() { - assert(renderer); - renderer.reset(); -} - -void HeadlessFrontend::update(std::shared_ptr updateParameters_) { - updateParameters = updateParameters_; - asyncInvalidate.send(); -} - -void HeadlessFrontend::setObserver(RendererObserver& observer_) { - assert(renderer); - renderer->setObserver(&observer_); -} - -Size HeadlessFrontend::getSize() const { - return size; -} - -Renderer* HeadlessFrontend::getRenderer() { - assert(renderer); - return renderer.get(); -} - -RendererBackend* HeadlessFrontend::getBackend() { - return &backend; -} - -CameraOptions HeadlessFrontend::getCameraOptions() { - if (updateParameters) - return RendererState::getCameraOptions(*updateParameters); - - static CameraOptions nullCamera; - return nullCamera; -} - -bool HeadlessFrontend::hasImage(const std::string& id) { - if (updateParameters) { - return RendererState::hasImage(*updateParameters, id); - } - - return false; -} - -bool HeadlessFrontend::hasLayer(const std::string& id) { - if (updateParameters) { - return RendererState::hasLayer(*updateParameters, id); - } - - return false; -} - -bool HeadlessFrontend::hasSource(const std::string& id) { - if (updateParameters) { - return RendererState::hasSource(*updateParameters, id); - } - - return false; -} -ScreenCoordinate HeadlessFrontend::pixelForLatLng(const LatLng& coordinate) { - if (updateParameters) { - return RendererState::pixelForLatLng(*updateParameters, coordinate); - } - - return ScreenCoordinate {}; -} - -LatLng HeadlessFrontend::latLngForPixel(const ScreenCoordinate& point) { - if (updateParameters) { - return RendererState::latLngForPixel(*updateParameters, point); - } - - return LatLng {}; -} - -void HeadlessFrontend::setSize(Size size_) { - if (size != size_) { - size = size_; - backend.setSize({ static_cast(size_.width * pixelRatio), - static_cast(size_.height * pixelRatio) }); - } -} - -PremultipliedImage HeadlessFrontend::readStillImage() { - return backend.readStillImage(); -} - -PremultipliedImage HeadlessFrontend::render(Map& map) { - PremultipliedImage result; - - map.renderStill([&](std::exception_ptr error) { - if (error) { - std::rethrow_exception(error); - } else { - result = backend.readStillImage(); - } - }); - - while (!result.valid()) { - util::RunLoop::Get()->runOnce(); - } - - return result; -} - -optional HeadlessFrontend::getTransformState() const { - if (updateParameters) { - return updateParameters->transformState; - } else { - return {}; - } -} - -} // namespace mbgl diff --git a/platform/default/mbgl/gl/headless_frontend.hpp b/platform/default/mbgl/gl/headless_frontend.hpp deleted file mode 100644 index 18f0cfa537..0000000000 --- a/platform/default/mbgl/gl/headless_frontend.hpp +++ /dev/null @@ -1,61 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include - -#include - -namespace mbgl { - -class FileSource; -class Scheduler; -class Renderer; -class RendererBackend; -class Map; -class TransformState; - -class HeadlessFrontend : public RendererFrontend { -public: - HeadlessFrontend(float pixelRatio_, FileSource&, Scheduler&, const optional programCacheDir = {}, GLContextMode mode = GLContextMode::Unique, const optional localFontFamily = {}); - HeadlessFrontend(Size, float pixelRatio_, FileSource&, Scheduler&, const optional programCacheDir = {}, GLContextMode mode = GLContextMode::Unique, const optional localFontFamily = {}); - ~HeadlessFrontend() override; - - void reset() override; - void update(std::shared_ptr) override; - void setObserver(RendererObserver&) override; - - Size getSize() const; - void setSize(Size); - - Renderer* getRenderer(); - RendererBackend* getBackend(); - CameraOptions getCameraOptions(); - - bool hasImage(const std::string&); - bool hasLayer(const std::string&); - bool hasSource(const std::string&); - - ScreenCoordinate pixelForLatLng(const LatLng&); - LatLng latLngForPixel(const ScreenCoordinate&); - - PremultipliedImage readStillImage(); - PremultipliedImage render(Map&); - - optional getTransformState() const; - -private: - Size size; - float pixelRatio; - - HeadlessBackend backend; - util::AsyncTask asyncInvalidate; - - std::unique_ptr renderer; - std::shared_ptr updateParameters; -}; - -} // namespace mbgl diff --git a/platform/default/mbgl/map/map_snapshotter.cpp b/platform/default/mbgl/map/map_snapshotter.cpp deleted file mode 100644 index ae14b20721..0000000000 --- a/platform/default/mbgl/map/map_snapshotter.cpp +++ /dev/null @@ -1,224 +0,0 @@ -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace mbgl { - -class MapSnapshotter::Impl { -public: - Impl(FileSource*, - std::shared_ptr, - const std::pair style, - const Size&, - const float pixelRatio, - const optional cameraOptions, - const optional region, - const optional programCacheDir, - const optional localFontFamily = {}); - - void setStyleURL(std::string styleURL); - std::string getStyleURL() const; - - void setStyleJSON(std::string styleJSON); - std::string getStyleJSON() const; - - void setSize(Size); - Size getSize() const; - - void setCameraOptions(CameraOptions); - CameraOptions getCameraOptions() const; - - void setRegion(LatLngBounds); - LatLngBounds getRegion() const; - - void snapshot(ActorRef); - -private: - std::shared_ptr scheduler; - HeadlessFrontend frontend; - Map map; -}; - -MapSnapshotter::Impl::Impl(FileSource* fileSource, - std::shared_ptr scheduler_, - const std::pair style, - const Size& size, - const float pixelRatio, - const optional cameraOptions, - const optional region, - const optional programCacheDir, - const optional localFontFamily) - : scheduler(std::move(scheduler_)) - , frontend(size, pixelRatio, *fileSource, *scheduler, programCacheDir, GLContextMode::Unique, localFontFamily) - , map(frontend, MapObserver::nullObserver(), size, pixelRatio, *fileSource, *scheduler, MapMode::Static) { - - if (style.first) { - map.getStyle().loadJSON(style.second); - } else{ - map.getStyle().loadURL(style.second); - } - - if (cameraOptions) { - map.jumpTo(*cameraOptions); - } - - // Set region, if specified - if (region) { - this->setRegion(*region); - } -} - -void MapSnapshotter::Impl::snapshot(ActorRef callback) { - map.renderStill([this, callback = std::move(callback)] (std::exception_ptr error) mutable { - - // Create lambda that captures the current transform state - // and can be used to translate for geographic to screen - // coordinates - assert (frontend.getTransformState()); - PointForFn pointForFn { [=, center=map.getLatLng(), transformState = *frontend.getTransformState()] (const LatLng& latLng) { - LatLng unwrappedLatLng = latLng.wrapped(); - unwrappedLatLng.unwrapForShortestPath(center); - Transform transform { transformState }; - return transform.latLngToScreenCoordinate(unwrappedLatLng); - }}; - - // Create lambda that captures the current transform state - // and can be used to translate for geographic to screen - // coordinates - assert (frontend.getTransformState()); - LatLngForFn latLngForFn { [=, transformState = *frontend.getTransformState()] (const ScreenCoordinate& screenCoordinate) { - Transform transform { transformState }; - return transform.screenCoordinateToLatLng(screenCoordinate); - }}; - - // Collect all source attributions - std::vector attributions; - for (auto source : map.getStyle().getSources()) { - auto attribution = source->getAttribution(); - if (attribution) { - attributions.push_back(*attribution); - } - } - - // Invoke callback - callback.invoke( - &MapSnapshotter::Callback::operator(), - error, - error ? PremultipliedImage() : frontend.readStillImage(), - std::move(attributions), - std::move(pointForFn), - std::move(latLngForFn) - ); - }); -} - -void MapSnapshotter::Impl::setStyleURL(std::string styleURL) { - map.getStyle().loadURL(styleURL); -} - -std::string MapSnapshotter::Impl::getStyleURL() const { - return map.getStyle().getURL(); -} - -void MapSnapshotter::Impl::setStyleJSON(std::string styleJSON) { - map.getStyle().loadJSON(styleJSON); -} - -std::string MapSnapshotter::Impl::getStyleJSON() const { - return map.getStyle().getJSON(); -} - -void MapSnapshotter::Impl::setSize(Size size) { - map.setSize(size); - frontend.setSize(size); -} - -Size MapSnapshotter::Impl::getSize() const { - return map.getSize(); -} - -void MapSnapshotter::Impl::setCameraOptions(CameraOptions cameraOptions) { - map.jumpTo(cameraOptions); -} - -CameraOptions MapSnapshotter::Impl::getCameraOptions() const { - EdgeInsets insets; - return map.getCameraOptions(insets); -} - -void MapSnapshotter::Impl::setRegion(LatLngBounds region) { - mbgl::EdgeInsets insets = { 0, 0, 0, 0 }; - std::vector latLngs = { region.southwest(), region.northeast() }; - map.jumpTo(map.cameraForLatLngs(latLngs, insets)); -} - -LatLngBounds MapSnapshotter::Impl::getRegion() const { - return map.latLngBoundsForCamera(getCameraOptions()); -} - -MapSnapshotter::MapSnapshotter(FileSource* fileSource, - std::shared_ptr scheduler, - const std::pair style, - const Size& size, - const float pixelRatio, - const optional cameraOptions, - const optional region, - const optional programCacheDir, - const optional localFontFamily) - : impl(std::make_unique>("Map Snapshotter", fileSource, std::move(scheduler), style, size, pixelRatio, cameraOptions, region, programCacheDir, localFontFamily)) { -} - -MapSnapshotter::~MapSnapshotter() = default; - -void MapSnapshotter::snapshot(ActorRef callback) { - impl->actor().invoke(&Impl::snapshot, std::move(callback)); -} - -void MapSnapshotter::setStyleURL(const std::string& styleURL) { - impl->actor().invoke(&Impl::setStyleURL, styleURL); -} - -std::string MapSnapshotter::getStyleURL() const { - return impl->actor().ask(&Impl::getStyleURL).get(); -} - -void MapSnapshotter::setStyleJSON(const std::string& styleJSON) { - impl->actor().invoke(&Impl::setStyleJSON, styleJSON); -} - -std::string MapSnapshotter::getStyleJSON() const { - return impl->actor().ask(&Impl::getStyleJSON).get(); -} - -void MapSnapshotter::setSize(const Size& size) { - impl->actor().invoke(&Impl::setSize, size); -} - -Size MapSnapshotter::getSize() const { - return impl->actor().ask(&Impl::getSize).get(); -} - -void MapSnapshotter::setCameraOptions(const CameraOptions& options) { - impl->actor().invoke(&Impl::setCameraOptions, options); -} - -CameraOptions MapSnapshotter::getCameraOptions() const { - return impl->actor().ask(&Impl::getCameraOptions).get(); -} - -void MapSnapshotter::setRegion(const LatLngBounds& bounds) { - impl->actor().invoke(&Impl::setRegion, std::move(bounds)); -} - -LatLngBounds MapSnapshotter::getRegion() const { - return impl->actor().ask(&Impl::getRegion).get(); -} - -} // namespace mbgl diff --git a/platform/default/mbgl/map/map_snapshotter.hpp b/platform/default/mbgl/map/map_snapshotter.hpp deleted file mode 100644 index 2deb2b3cda..0000000000 --- a/platform/default/mbgl/map/map_snapshotter.hpp +++ /dev/null @@ -1,66 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -namespace mbgl { - -template class ActorRef; -struct CameraOptions; -class FileSource; -class Size; -class LatLngBounds; - -namespace style { -class Style; -} // namespace style - -class MapSnapshotter { -public: - MapSnapshotter(FileSource* fileSource, - std::shared_ptr scheduler, - const std::pair style, - const Size&, - const float pixelRatio, - const optional cameraOptions, - const optional region, - const optional cacheDir = {}, - const optional localFontFamily = {}); - - ~MapSnapshotter(); - - void setStyleURL(const std::string& styleURL); - std::string getStyleURL() const; - - void setStyleJSON(const std::string& styleJSON); - std::string getStyleJSON() const; - - void setSize(const Size&); - Size getSize() const; - - void setCameraOptions(const CameraOptions&); - CameraOptions getCameraOptions() const; - - void setRegion(const LatLngBounds&); - LatLngBounds getRegion() const; - - using PointForFn = std::function; - using LatLngForFn = std::function; - using Attributions = std::vector; - using Callback = std::function; - void snapshot(ActorRef); - -private: - class Impl; - std::unique_ptr> impl; -}; - -} // namespace mbgl diff --git a/platform/default/mbgl/storage/.clang-tidy b/platform/default/mbgl/storage/.clang-tidy deleted file mode 100644 index b4ecd26b95..0000000000 --- a/platform/default/mbgl/storage/.clang-tidy +++ /dev/null @@ -1,2 +0,0 @@ -Checks: 'modernize-*,misc-static-assert,llvm-namespace-comment,-clang-analyzer-security.insecureAPI.rand,-clang-analyzer-core.uninitialized.UndefReturn,-clang-analyzer-core.StackAddressEscape,-clang-analyzer-core.CallAndMessage,-clang-diagnostic-unused-command-line-argument,-clang-analyzer-core.uninitialized.*,-clang-analyzer-core.NullDereference,-clang-analyzer-cplusplus.NewDelete,-clang-analyzer-unix.MismatchedDeallocator,-clang-analyzer-unix.cstring.NullArg,-clang-analyzer-cplusplus.NewDeleteLeaks,-clang-analyzer-unix.Malloc,-clang-analyzer-core.NonNullParamChecker' -HeaderFilterRegex: '\/mbgl\/' diff --git a/platform/default/mbgl/storage/file_source_request.hpp b/platform/default/mbgl/storage/file_source_request.hpp deleted file mode 100644 index 6bd0d44df6..0000000000 --- a/platform/default/mbgl/storage/file_source_request.hpp +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -#include -#include -#include - -#include -#include - -namespace mbgl { - -class Mailbox; - -class FileSourceRequest : public AsyncRequest { -public: - FileSourceRequest(FileSource::Callback&& callback); - ~FileSourceRequest() final; - - void onCancel(std::function&& callback); - void setResponse(const Response& res); - - ActorRef actor(); - -private: - FileSource::Callback responseCallback = nullptr; - std::function cancelCallback = nullptr; - - std::shared_ptr mailbox; -}; - -} // namespace mbgl diff --git a/platform/default/mbgl/storage/merge_sideloaded.hpp b/platform/default/mbgl/storage/merge_sideloaded.hpp deleted file mode 100644 index 494018c966..0000000000 --- a/platform/default/mbgl/storage/merge_sideloaded.hpp +++ /dev/null @@ -1,53 +0,0 @@ -#pragma once - -// THIS IS A GENERATED FILE; EDIT merge_sideloaded.sql INSTEAD -// To regenerate, run `node platform/default/mbgl/storage/merge_sideloaded.js` - -namespace mbgl { - -static constexpr const char* mergeSideloadedDatabaseSQL = -"INSERT INTO regions\n" -" SELECT DISTINCT NULL, sr.definition, sr.description\n" -" FROM side.regions sr \n" -" LEFT JOIN regions r ON sr.definition = r.definition AND sr.description IS r.description\n" -" WHERE r.definition IS NULL;\n" -"CREATE TEMPORARY TABLE region_mapping AS\n" -" SELECT sr.id AS side_region_id,\n" -" r.id AS main_region_id\n" -" FROM side.regions sr\n" -" JOIN regions r ON sr.definition = r.definition AND sr.description IS r.description;\n" -"REPLACE INTO tiles\n" -" SELECT t.id,\n" -" st.url_template, st.pixel_ratio, st.z, st.x, st.y,\n" -" st.expires, st.modified, st.etag, st.data, st.compressed, st.accessed, st.must_revalidate\n" -" FROM (SELECT DISTINCT sti.* FROM side.region_tiles srt JOIN side.tiles sti ON srt.tile_id = sti.id)\n" -" AS st\n" -" LEFT JOIN tiles t ON st.url_template = t.url_template AND st.pixel_ratio = t.pixel_ratio AND st.z = t.z AND st.x = t.x AND st.y = t.y\n" -" WHERE t.id IS NULL\n" -" OR st.modified > t.modified;\n" -"INSERT OR IGNORE INTO region_tiles\n" -" SELECT rm.main_region_id, sti.id\n" -" FROM side.region_tiles srt\n" -" JOIN region_mapping rm ON srt.region_id = rm.side_region_id\n" -" JOIN (SELECT t.id, st.id AS side_tile_id FROM side.tiles st\n" -" JOIN tiles t ON st.url_template = t.url_template AND st.pixel_ratio = t.pixel_ratio AND st.z = t.z AND st.x = t.x AND st.y = t.y\n" -" ) AS sti ON srt.tile_id = sti.side_tile_id;\n" -"REPLACE INTO resources\n" -" SELECT r.id, \n" -" sr.url, sr.kind, sr.expires, sr.modified, sr.etag,\n" -" sr.data, sr.compressed, sr.accessed, sr.must_revalidate\n" -" FROM side.region_resources srr JOIN side.resources sr ON srr.resource_id = sr.id\n" -" LEFT JOIN resources r ON sr.url = r.url\n" -" WHERE r.id IS NULL\n" -" OR sr.modified > r.modified;\n" -"INSERT OR IGNORE INTO region_resources\n" -" SELECT rm.main_region_id, sri.id\n" -" FROM side.region_resources srr\n" -" JOIN region_mapping rm ON srr.region_id = rm.side_region_id\n" -" JOIN (SELECT r.id, sr.id AS side_resource_id FROM side.resources sr\n" -" JOIN resources r ON sr.url = r.url) AS sri ON srr.resource_id = sri.side_resource_id;\n" -" \n" -"DROP TABLE region_mapping;\n" -; - -} // namespace mbgl diff --git a/platform/default/mbgl/storage/merge_sideloaded.js b/platform/default/mbgl/storage/merge_sideloaded.js deleted file mode 100644 index 98d52eb8b3..0000000000 --- a/platform/default/mbgl/storage/merge_sideloaded.js +++ /dev/null @@ -1,21 +0,0 @@ -var fs = require('fs'); -fs.writeFileSync('platform/default/mbgl/storage/merge_sideloaded.hpp', `#pragma once - -// THIS IS A GENERATED FILE; EDIT merge_sideloaded.sql INSTEAD -// To regenerate, run \`node platform/default/mbgl/storage/merge_sideloaded.js\` - -namespace mbgl { - -static constexpr const char* mergeSideloadedDatabaseSQL = -${fs.readFileSync('platform/default/mbgl/storage/merge_sideloaded.sql', 'utf8') - .replace(/ *--.*/g, '') - .split('\n') - .filter(a => a) - .map(line => '"' + line + '\\n"') - .join('\n') -} -; - -} // namespace mbgl -`); - diff --git a/platform/default/mbgl/storage/merge_sideloaded.sql b/platform/default/mbgl/storage/merge_sideloaded.sql deleted file mode 100644 index 55345a6f15..0000000000 --- a/platform/default/mbgl/storage/merge_sideloaded.sql +++ /dev/null @@ -1,51 +0,0 @@ -INSERT INTO regions - SELECT DISTINCT NULL, sr.definition, sr.description -- Merge duplicate regions - FROM side.regions sr - LEFT JOIN regions r ON sr.definition = r.definition AND sr.description IS r.description - WHERE r.definition IS NULL; - -CREATE TEMPORARY TABLE region_mapping AS - SELECT sr.id AS side_region_id, - r.id AS main_region_id - FROM side.regions sr - JOIN regions r ON sr.definition = r.definition AND sr.description IS r.description; - ---Insert /Update tiles -REPLACE INTO tiles - SELECT t.id, -- use the old ID in case we run a REPLACE. If it doesn't exist yet, it'll be NULL which will auto-assign a new ID. - st.url_template, st.pixel_ratio, st.z, st.x, st.y, - st.expires, st.modified, st.etag, st.data, st.compressed, st.accessed, st.must_revalidate - FROM (SELECT DISTINCT sti.* FROM side.region_tiles srt JOIN side.tiles sti ON srt.tile_id = sti.id) -- ensure that we're only considering region tiles, and not ambient tiles. - AS st - LEFT JOIN tiles t ON st.url_template = t.url_template AND st.pixel_ratio = t.pixel_ratio AND st.z = t.z AND st.x = t.x AND st.y = t.y - WHERE t.id IS NULL -- only consider tiles that don't exist yet in the original database. - OR st.modified > t.modified; -- ...or tiles that are newer in the side loaded DB. - --- Update region_tiles usage -INSERT OR IGNORE INTO region_tiles - SELECT rm.main_region_id, sti.id - FROM side.region_tiles srt - JOIN region_mapping rm ON srt.region_id = rm.side_region_id - JOIN (SELECT t.id, st.id AS side_tile_id FROM side.tiles st - JOIN tiles t ON st.url_template = t.url_template AND st.pixel_ratio = t.pixel_ratio AND st.z = t.z AND st.x = t.x AND st.y = t.y - ) AS sti ON srt.tile_id = sti.side_tile_id; - --- copy over resources -REPLACE INTO resources - SELECT r.id, - sr.url, sr.kind, sr.expires, sr.modified, sr.etag, - sr.data, sr.compressed, sr.accessed, sr.must_revalidate - FROM side.region_resources srr JOIN side.resources sr ON srr.resource_id = sr.id --only consider region resources, and not ambient resources. - LEFT JOIN resources r ON sr.url = r.url - WHERE r.id IS NULL -- only consider resources that don't exist yet in the main database - OR sr.modified > r.modified; -- ...or resources that are newer in the side loaded DB. - --- Update region_resources usage -INSERT OR IGNORE INTO region_resources - SELECT rm.main_region_id, sri.id - FROM side.region_resources srr - JOIN region_mapping rm ON srr.region_id = rm.side_region_id - JOIN (SELECT r.id, sr.id AS side_resource_id FROM side.resources sr - JOIN resources r ON sr.url = r.url) AS sri ON srr.resource_id = sri.side_resource_id; - -DROP TABLE region_mapping; \ No newline at end of file diff --git a/platform/default/mbgl/storage/offline.cpp b/platform/default/mbgl/storage/offline.cpp deleted file mode 100644 index e1ec0acb31..0000000000 --- a/platform/default/mbgl/storage/offline.cpp +++ /dev/null @@ -1,158 +0,0 @@ -#include -#include -#include - -#include -#include - -#include -#include -#include - -#include - -namespace mbgl { - -// OfflineTilePyramidRegionDefinition - -OfflineTilePyramidRegionDefinition::OfflineTilePyramidRegionDefinition( - std::string styleURL_, LatLngBounds bounds_, double minZoom_, double maxZoom_, float pixelRatio_) - : styleURL(std::move(styleURL_)), - bounds(std::move(bounds_)), - minZoom(minZoom_), - maxZoom(maxZoom_), - pixelRatio(pixelRatio_) { - if (minZoom < 0 || maxZoom < 0 || maxZoom < minZoom || pixelRatio < 0 || - !std::isfinite(minZoom) || std::isnan(maxZoom) || !std::isfinite(pixelRatio)) { - throw std::invalid_argument("Invalid offline region definition"); - } -} - - -// OfflineGeometryRegionDefinition - -OfflineGeometryRegionDefinition::OfflineGeometryRegionDefinition(std::string styleURL_, Geometry geometry_, double minZoom_, double maxZoom_, float pixelRatio_) - : styleURL(styleURL_) - , geometry(std::move(geometry_)) - , minZoom(minZoom_) - , maxZoom(maxZoom_) - , pixelRatio(pixelRatio_) { - if (minZoom < 0 || maxZoom < 0 || maxZoom < minZoom || pixelRatio < 0 || - !std::isfinite(minZoom) || std::isnan(maxZoom) || !std::isfinite(pixelRatio)) { - throw std::invalid_argument("Invalid offline region definition"); - } -} - -OfflineRegionDefinition decodeOfflineRegionDefinition(const std::string& region) { - rapidjson::GenericDocument, rapidjson::CrtAllocator> doc; - doc.Parse<0>(region.c_str()); - - // validation - - auto hasValidBounds = [&] { - return doc.HasMember("bounds") && doc["bounds"].IsArray() && doc["bounds"].Size() == 4 - && doc["bounds"][0].IsDouble() && doc["bounds"][1].IsDouble() - && doc["bounds"][2].IsDouble() && doc["bounds"][3].IsDouble(); - }; - - auto hasValidGeometry = [&] { - return doc.HasMember("geometry") && doc["geometry"].IsObject(); - }; - - if (doc.HasParseError() - || !doc.HasMember("style_url") || !doc["style_url"].IsString() - || !(hasValidBounds() || hasValidGeometry()) - || !doc.HasMember("min_zoom") || !doc["min_zoom"].IsDouble() - || (doc.HasMember("max_zoom") && !doc["max_zoom"].IsDouble()) - || !doc.HasMember("pixel_ratio") || !doc["pixel_ratio"].IsDouble()) { - throw std::runtime_error("Malformed offline region definition"); - } - - // Common properties - - std::string styleURL { doc["style_url"].GetString(), doc["style_url"].GetStringLength() }; - double minZoom = doc["min_zoom"].GetDouble(); - double maxZoom = doc.HasMember("max_zoom") ? doc["max_zoom"].GetDouble() : INFINITY; - float pixelRatio = doc["pixel_ratio"].GetDouble(); - - if (doc.HasMember("bounds")) { - return OfflineTilePyramidRegionDefinition{ - styleURL, - LatLngBounds::hull( - LatLng(doc["bounds"][0].GetDouble(), doc["bounds"][1].GetDouble()), - LatLng(doc["bounds"][2].GetDouble(), doc["bounds"][3].GetDouble())), - minZoom, maxZoom, pixelRatio }; - } else { - return OfflineGeometryRegionDefinition{ - styleURL, - mapbox::geojson::convert>(doc["geometry"].GetObject()), - minZoom, maxZoom, pixelRatio }; - }; - -} - -std::string encodeOfflineRegionDefinition(const OfflineRegionDefinition& region) { - rapidjson::GenericDocument, rapidjson::CrtAllocator> doc; - doc.SetObject(); - - // Encode common properties - region.match([&](auto& _region) { - doc.AddMember("style_url", rapidjson::StringRef(_region.styleURL.data(), _region.styleURL.length()), doc.GetAllocator()); - doc.AddMember("min_zoom", _region.minZoom, doc.GetAllocator()); - if (std::isfinite(_region.maxZoom)) { - doc.AddMember("max_zoom", _region.maxZoom, doc.GetAllocator()); - } - - doc.AddMember("pixel_ratio", _region.pixelRatio, doc.GetAllocator()); - }); - - // Encode specific properties - region.match( - [&] (const OfflineTilePyramidRegionDefinition& _region) { - rapidjson::GenericValue, rapidjson::CrtAllocator> bounds(rapidjson::kArrayType); - bounds.PushBack(_region.bounds.south(), doc.GetAllocator()); - bounds.PushBack(_region.bounds.west(), doc.GetAllocator()); - bounds.PushBack(_region.bounds.north(), doc.GetAllocator()); - bounds.PushBack(_region.bounds.east(), doc.GetAllocator()); - doc.AddMember("bounds", bounds, doc.GetAllocator()); - - }, - [&] (const OfflineGeometryRegionDefinition& _region) { - doc.AddMember("geometry", mapbox::geojson::convert(_region.geometry, doc.GetAllocator()), doc.GetAllocator()); - - } - ); - - rapidjson::StringBuffer buffer; - rapidjson::Writer writer(buffer); - doc.Accept(writer); - - return buffer.GetString(); -} - - -// OfflineRegion - -OfflineRegion::OfflineRegion(int64_t id_, - OfflineRegionDefinition definition_, - OfflineRegionMetadata metadata_) - : id(id_), - definition(std::move(definition_)), - metadata(std::move(metadata_)) { -} - -OfflineRegion::OfflineRegion(OfflineRegion&&) = default; -OfflineRegion::~OfflineRegion() = default; - -const OfflineRegionDefinition& OfflineRegion::getDefinition() const { - return definition; -} - -const OfflineRegionMetadata& OfflineRegion::getMetadata() const { - return metadata; -} - -int64_t OfflineRegion::getID() const { - return id; -} -} // namespace mbgl diff --git a/platform/default/mbgl/storage/offline_database.cpp b/platform/default/mbgl/storage/offline_database.cpp deleted file mode 100644 index 28c1359106..0000000000 --- a/platform/default/mbgl/storage/offline_database.cpp +++ /dev/null @@ -1,1129 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -#include "offline_schema.hpp" -#include "merge_sideloaded.hpp" - -#include "sqlite3.hpp" - -namespace mbgl { - -OfflineDatabase::OfflineDatabase(std::string path_, uint64_t maximumCacheSize_) - : path(std::move(path_)), - maximumCacheSize(maximumCacheSize_) { - try { - initialize(); - } catch (const util::IOException& ex) { - handleError(ex, "open database"); - } catch (const mapbox::sqlite::Exception& ex) { - handleError(ex, "open database"); - } - // Assume that we can't open the database right now and work with an empty database object. -} - -OfflineDatabase::~OfflineDatabase() { - // Deleting these SQLite objects may result in exceptions, but we're in a destructor, so we - // can't throw anything. - try { - statements.clear(); - db.reset(); - } catch (const util::IOException& ex) { - handleError(ex, "close database"); - } catch (const mapbox::sqlite::Exception& ex) { - handleError(ex, "close database"); - } -} - -void OfflineDatabase::initialize() { - assert(!db); - assert(statements.empty()); - - db = std::make_unique( - mapbox::sqlite::Database::open(path, mapbox::sqlite::ReadWriteCreate)); - db->setBusyTimeout(Milliseconds::max()); - db->exec("PRAGMA foreign_keys = ON"); - - const auto userVersion = getPragma("PRAGMA user_version"); - switch (userVersion) { - case 0: - case 1: - // Newly created database, or old cache-only database; remove old table if it exists. - removeOldCacheTable(); - createSchema(); - return; - case 2: - migrateToVersion3(); - // fall through - case 3: - // Removed migration, see below. - // fall through - case 4: - migrateToVersion5(); - // fall through - case 5: - migrateToVersion6(); - // fall through - case 6: - // Happy path; we're done - return; - default: - // Downgrade: delete the database and try to reinitialize. - removeExisting(); - initialize(); - } -} - -void OfflineDatabase::handleError(const mapbox::sqlite::Exception& ex, const char* action) { - if (ex.code == mapbox::sqlite::ResultCode::NotADB || - ex.code == mapbox::sqlite::ResultCode::Corrupt || - (ex.code == mapbox::sqlite::ResultCode::ReadOnly && - ex.extendedCode == mapbox::sqlite::ExtendedResultCode::ReadOnlyDBMoved)) { - // The database was corruped, moved away, or deleted. We're going to start fresh with a - // clean slate for the next operation. - Log::Error(Event::Database, static_cast(ex.code), "Can't %s: %s", action, ex.what()); - try { - removeExisting(); - } catch (const util::IOException& ioEx) { - handleError(ioEx, action); - } - } else { - // We treat the error as temporary, and pretend we have an inaccessible DB. - Log::Warning(Event::Database, static_cast(ex.code), "Can't %s: %s", action, ex.what()); - } -} - -void OfflineDatabase::handleError(const util::IOException& ex, const char* action) { - // We failed to delete the database file. - Log::Error(Event::Database, ex.code, "Can't %s: %s", action, ex.what()); -} - -void OfflineDatabase::removeExisting() { - Log::Warning(Event::Database, "Removing existing incompatible offline database"); - - statements.clear(); - db.reset(); - - util::deleteFile(path); -} - -void OfflineDatabase::removeOldCacheTable() { - assert(db); - db->exec("DROP TABLE IF EXISTS http_cache"); - db->exec("VACUUM"); -} - -void OfflineDatabase::createSchema() { - assert(db); - db->exec("PRAGMA auto_vacuum = INCREMENTAL"); - db->exec("PRAGMA journal_mode = DELETE"); - db->exec("PRAGMA synchronous = FULL"); - mapbox::sqlite::Transaction transaction(*db); - db->exec(offlineDatabaseSchema); - db->exec("PRAGMA user_version = 6"); - transaction.commit(); -} - -void OfflineDatabase::migrateToVersion3() { - assert(db); - db->exec("PRAGMA auto_vacuum = INCREMENTAL"); - db->exec("VACUUM"); - db->exec("PRAGMA user_version = 3"); -} - -// Schema version 4 was WAL journal + NORMAL sync. It was reverted during pre- -// release development and the migration was removed entirely to avoid potential -// conflicts from quickly (and needlessly) switching journal and sync modes. -// -// See: https://github.com/mapbox/mapbox-gl-native/pull/6320 - -void OfflineDatabase::migrateToVersion5() { - assert(db); - db->exec("PRAGMA journal_mode = DELETE"); - db->exec("PRAGMA synchronous = FULL"); - db->exec("PRAGMA user_version = 5"); -} - -void OfflineDatabase::migrateToVersion6() { - assert(db); - mapbox::sqlite::Transaction transaction(*db); - db->exec("ALTER TABLE resources ADD COLUMN must_revalidate INTEGER NOT NULL DEFAULT 0"); - db->exec("ALTER TABLE tiles ADD COLUMN must_revalidate INTEGER NOT NULL DEFAULT 0"); - db->exec("PRAGMA user_version = 6"); - transaction.commit(); -} - -mapbox::sqlite::Statement& OfflineDatabase::getStatement(const char* sql) { - if (!db) { - initialize(); - } - auto it = statements.find(sql); - if (it == statements.end()) { - it = statements.emplace(sql, std::make_unique(*db, sql)).first; - } - return *it->second; -} - -optional OfflineDatabase::get(const Resource& resource) try { - auto result = getInternal(resource); - return result ? optional{ result->first } : nullopt; -} catch (const util::IOException& ex) { - handleError(ex, "read resource"); - return nullopt; -} catch (const mapbox::sqlite::Exception& ex) { - handleError(ex, "read resource"); - return nullopt; -} - -optional> OfflineDatabase::getInternal(const Resource& resource) { - if (resource.kind == Resource::Kind::Tile) { - assert(resource.tileData); - return getTile(*resource.tileData); - } else { - return getResource(resource); - } -} - -optional OfflineDatabase::hasInternal(const Resource& resource) { - if (resource.kind == Resource::Kind::Tile) { - assert(resource.tileData); - return hasTile(*resource.tileData); - } else { - return hasResource(resource); - } -} - -std::pair OfflineDatabase::put(const Resource& resource, const Response& response) try { - if (!db) { - initialize(); - } - mapbox::sqlite::Transaction transaction(*db, mapbox::sqlite::Transaction::Immediate); - auto result = putInternal(resource, response, true); - transaction.commit(); - return result; -} catch (const mapbox::sqlite::Exception& ex) { - handleError(ex, "write resource"); - return { false, 0 }; -} - -std::pair OfflineDatabase::putInternal(const Resource& resource, const Response& response, bool evict_) { - if (response.error) { - return { false, 0 }; - } - - std::string compressedData; - bool compressed = false; - uint64_t size = 0; - - if (response.data) { - compressedData = util::compress(*response.data); - compressed = compressedData.size() < response.data->size(); - size = compressed ? compressedData.size() : response.data->size(); - } - - if (evict_ && !evict(size)) { - Log::Info(Event::Database, "Unable to make space for entry"); - return { false, 0 }; - } - - bool inserted; - - if (resource.kind == Resource::Kind::Tile) { - assert(resource.tileData); - inserted = putTile(*resource.tileData, response, - compressed ? compressedData : response.data ? *response.data : "", - compressed); - } else { - inserted = putResource(resource, response, - compressed ? compressedData : response.data ? *response.data : "", - compressed); - } - - return { inserted, size }; -} - -optional> OfflineDatabase::getResource(const Resource& resource) { - // Update accessed timestamp used for LRU eviction. - try { - mapbox::sqlite::Query accessedQuery{ getStatement("UPDATE resources SET accessed = ?1 WHERE url = ?2") }; - accessedQuery.bind(1, util::now()); - accessedQuery.bind(2, resource.url); - accessedQuery.run(); - } catch (const mapbox::sqlite::Exception& ex) { - if (ex.code == mapbox::sqlite::ResultCode::NotADB || - ex.code == mapbox::sqlite::ResultCode::Corrupt) { - throw; - } - - // If we don't have any indication that the database is corrupt, continue as usual. - Log::Warning(Event::Database, static_cast(ex.code), "Can't update timestamp: %s", ex.what()); - } - - // clang-format off - mapbox::sqlite::Query query{ getStatement( - // 0 1 2 3 4 5 - "SELECT etag, expires, must_revalidate, modified, data, compressed " - "FROM resources " - "WHERE url = ?") }; - // clang-format on - - query.bind(1, resource.url); - - if (!query.run()) { - return nullopt; - } - - Response response; - uint64_t size = 0; - - response.etag = query.get>(0); - response.expires = query.get>(1); - response.mustRevalidate = query.get(2); - response.modified = query.get>(3); - - auto data = query.get>(4); - if (!data) { - response.noContent = true; - } else if (query.get(5)) { - response.data = std::make_shared(util::decompress(*data)); - size = data->length(); - } else { - response.data = std::make_shared(*data); - size = data->length(); - } - - return std::make_pair(response, size); -} - -optional OfflineDatabase::hasResource(const Resource& resource) { - mapbox::sqlite::Query query{ getStatement("SELECT length(data) FROM resources WHERE url = ?") }; - query.bind(1, resource.url); - if (!query.run()) { - return nullopt; - } - - return query.get>(0); -} - -bool OfflineDatabase::putResource(const Resource& resource, - const Response& response, - const std::string& data, - bool compressed) { - if (response.notModified) { - // clang-format off - mapbox::sqlite::Query notModifiedQuery{ getStatement( - "UPDATE resources " - "SET accessed = ?1, " - " expires = ?2, " - " must_revalidate = ?3 " - "WHERE url = ?4 ") }; - // clang-format on - - notModifiedQuery.bind(1, util::now()); - notModifiedQuery.bind(2, response.expires); - notModifiedQuery.bind(3, response.mustRevalidate); - notModifiedQuery.bind(4, resource.url); - notModifiedQuery.run(); - return false; - } - - // We can't use REPLACE because it would change the id value. - // clang-format off - mapbox::sqlite::Query updateQuery{ getStatement( - "UPDATE resources " - "SET kind = ?1, " - " etag = ?2, " - " expires = ?3, " - " must_revalidate = ?4, " - " modified = ?5, " - " accessed = ?6, " - " data = ?7, " - " compressed = ?8 " - "WHERE url = ?9 ") }; - // clang-format on - - updateQuery.bind(1, int(resource.kind)); - updateQuery.bind(2, response.etag); - updateQuery.bind(3, response.expires); - updateQuery.bind(4, response.mustRevalidate); - updateQuery.bind(5, response.modified); - updateQuery.bind(6, util::now()); - updateQuery.bind(9, resource.url); - - if (response.noContent) { - updateQuery.bind(7, nullptr); - updateQuery.bind(8, false); - } else { - updateQuery.bindBlob(7, data.data(), data.size(), false); - updateQuery.bind(8, compressed); - } - - updateQuery.run(); - if (updateQuery.changes() != 0) { - return false; - } - - // clang-format off - mapbox::sqlite::Query insertQuery{ getStatement( - "INSERT INTO resources (url, kind, etag, expires, must_revalidate, modified, accessed, data, compressed) " - "VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9) ") }; - // clang-format on - - insertQuery.bind(1, resource.url); - insertQuery.bind(2, int(resource.kind)); - insertQuery.bind(3, response.etag); - insertQuery.bind(4, response.expires); - insertQuery.bind(5, response.mustRevalidate); - insertQuery.bind(6, response.modified); - insertQuery.bind(7, util::now()); - - if (response.noContent) { - insertQuery.bind(8, nullptr); - insertQuery.bind(9, false); - } else { - insertQuery.bindBlob(8, data.data(), data.size(), false); - insertQuery.bind(9, compressed); - } - - insertQuery.run(); - - return true; -} - -optional> OfflineDatabase::getTile(const Resource::TileData& tile) { - // Update accessed timestamp used for LRU eviction. - try { - // clang-format off - mapbox::sqlite::Query accessedQuery{ getStatement( - "UPDATE tiles " - "SET accessed = ?1 " - "WHERE url_template = ?2 " - " AND pixel_ratio = ?3 " - " AND x = ?4 " - " AND y = ?5 " - " AND z = ?6 ") }; - // clang-format on - - accessedQuery.bind(1, util::now()); - accessedQuery.bind(2, tile.urlTemplate); - accessedQuery.bind(3, tile.pixelRatio); - accessedQuery.bind(4, tile.x); - accessedQuery.bind(5, tile.y); - accessedQuery.bind(6, tile.z); - accessedQuery.run(); - } catch (const mapbox::sqlite::Exception& ex) { - if (ex.code == mapbox::sqlite::ResultCode::NotADB || ex.code == mapbox::sqlite::ResultCode::Corrupt) { - throw; - } - - // If we don't have any indication that the database is corrupt, continue as usual. - Log::Warning(Event::Database, static_cast(ex.code), "Can't update timestamp: %s", ex.what()); - } - - // clang-format off - mapbox::sqlite::Query query{ getStatement( - // 0 1 2, 3, 4, 5 - "SELECT etag, expires, must_revalidate, modified, data, compressed " - "FROM tiles " - "WHERE url_template = ?1 " - " AND pixel_ratio = ?2 " - " AND x = ?3 " - " AND y = ?4 " - " AND z = ?5 ") }; - // clang-format on - - query.bind(1, tile.urlTemplate); - query.bind(2, tile.pixelRatio); - query.bind(3, tile.x); - query.bind(4, tile.y); - query.bind(5, tile.z); - - if (!query.run()) { - return nullopt; - } - - Response response; - uint64_t size = 0; - - response.etag = query.get>(0); - response.expires = query.get>(1); - response.mustRevalidate = query.get(2); - response.modified = query.get>(3); - - optional data = query.get>(4); - if (!data) { - response.noContent = true; - } else if (query.get(5)) { - response.data = std::make_shared(util::decompress(*data)); - size = data->length(); - } else { - response.data = std::make_shared(*data); - size = data->length(); - } - - return std::make_pair(response, size); -} - -optional OfflineDatabase::hasTile(const Resource::TileData& tile) { - // clang-format off - mapbox::sqlite::Query size{ getStatement( - "SELECT length(data) " - "FROM tiles " - "WHERE url_template = ?1 " - " AND pixel_ratio = ?2 " - " AND x = ?3 " - " AND y = ?4 " - " AND z = ?5 ") }; - // clang-format on - - size.bind(1, tile.urlTemplate); - size.bind(2, tile.pixelRatio); - size.bind(3, tile.x); - size.bind(4, tile.y); - size.bind(5, tile.z); - - if (!size.run()) { - return nullopt; - } - - return size.get>(0); -} - -bool OfflineDatabase::putTile(const Resource::TileData& tile, - const Response& response, - const std::string& data, - bool compressed) { - if (response.notModified) { - // clang-format off - mapbox::sqlite::Query notModifiedQuery{ getStatement( - "UPDATE tiles " - "SET accessed = ?1, " - " expires = ?2, " - " must_revalidate = ?3 " - "WHERE url_template = ?4 " - " AND pixel_ratio = ?5 " - " AND x = ?6 " - " AND y = ?7 " - " AND z = ?8 ") }; - // clang-format on - - notModifiedQuery.bind(1, util::now()); - notModifiedQuery.bind(2, response.expires); - notModifiedQuery.bind(3, response.mustRevalidate); - notModifiedQuery.bind(4, tile.urlTemplate); - notModifiedQuery.bind(5, tile.pixelRatio); - notModifiedQuery.bind(6, tile.x); - notModifiedQuery.bind(7, tile.y); - notModifiedQuery.bind(8, tile.z); - notModifiedQuery.run(); - return false; - } - - // We can't use REPLACE because it would change the id value. - - // clang-format off - mapbox::sqlite::Query updateQuery{ getStatement( - "UPDATE tiles " - "SET modified = ?1, " - " etag = ?2, " - " expires = ?3, " - " must_revalidate = ?4, " - " accessed = ?5, " - " data = ?6, " - " compressed = ?7 " - "WHERE url_template = ?8 " - " AND pixel_ratio = ?9 " - " AND x = ?10 " - " AND y = ?11 " - " AND z = ?12 ") }; - // clang-format on - - updateQuery.bind(1, response.modified); - updateQuery.bind(2, response.etag); - updateQuery.bind(3, response.expires); - updateQuery.bind(4, response.mustRevalidate); - updateQuery.bind(5, util::now()); - updateQuery.bind(8, tile.urlTemplate); - updateQuery.bind(9, tile.pixelRatio); - updateQuery.bind(10, tile.x); - updateQuery.bind(11, tile.y); - updateQuery.bind(12, tile.z); - - if (response.noContent) { - updateQuery.bind(6, nullptr); - updateQuery.bind(7, false); - } else { - updateQuery.bindBlob(6, data.data(), data.size(), false); - updateQuery.bind(7, compressed); - } - - updateQuery.run(); - if (updateQuery.changes() != 0) { - return false; - } - - // clang-format off - mapbox::sqlite::Query insertQuery{ getStatement( - "INSERT INTO tiles (url_template, pixel_ratio, x, y, z, modified, must_revalidate, etag, expires, accessed, data, compressed) " - "VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12)") }; - // clang-format on - - insertQuery.bind(1, tile.urlTemplate); - insertQuery.bind(2, tile.pixelRatio); - insertQuery.bind(3, tile.x); - insertQuery.bind(4, tile.y); - insertQuery.bind(5, tile.z); - insertQuery.bind(6, response.modified); - insertQuery.bind(7, response.mustRevalidate); - insertQuery.bind(8, response.etag); - insertQuery.bind(9, response.expires); - insertQuery.bind(10, util::now()); - - if (response.noContent) { - insertQuery.bind(11, nullptr); - insertQuery.bind(12, false); - } else { - insertQuery.bindBlob(11, data.data(), data.size(), false); - insertQuery.bind(12, compressed); - } - - insertQuery.run(); - - return true; -} - -expected OfflineDatabase::listRegions() try { - mapbox::sqlite::Query query{ getStatement("SELECT id, definition, description FROM regions") }; - OfflineRegions result; - while (query.run()) { - const auto id = query.get(0); - const auto definition = query.get(1); - const auto description = query.get>(2); - try { - // Construct, then move because this constructor is private. - OfflineRegion region(id, decodeOfflineRegionDefinition(definition), description); - result.emplace_back(std::move(region)); - } catch (const std::exception& ex) { - // Catch errors from malformed offline region definitions - // and skip them. - Log::Error(Event::General, "%s", ex.what()); - } - } - // Explicit move to avoid triggering the copy constructor. - return { std::move(result) }; -} catch (const mapbox::sqlite::Exception& ex) { - handleError(ex, "list regions"); - return unexpected(std::current_exception()); -} - -expected -OfflineDatabase::createRegion(const OfflineRegionDefinition& definition, - const OfflineRegionMetadata& metadata) try { - // clang-format off - mapbox::sqlite::Query query{ getStatement( - "INSERT INTO regions (definition, description) " - "VALUES (?1, ?2) ") }; - // clang-format on - - query.bind(1, encodeOfflineRegionDefinition(definition)); - query.bindBlob(2, metadata); - query.run(); - return OfflineRegion(query.lastInsertRowId(), definition, metadata); -} catch (const mapbox::sqlite::Exception& ex) { - handleError(ex, "create region"); - return unexpected(std::current_exception()); -} - -expected -OfflineDatabase::mergeDatabase(const std::string& sideDatabasePath) { - try { - // clang-format off - mapbox::sqlite::Query query{ getStatement("ATTACH DATABASE ?1 AS side") }; - // clang-format on - - query.bind(1, sideDatabasePath); - query.run(); - } catch (const mapbox::sqlite::Exception& ex) { - Log::Error(Event::Database, static_cast(ex.code), "Can't attach database (%s) for merge: %s", sideDatabasePath.c_str(), ex.what()); - return unexpected(std::current_exception()); - } - try { - // Support sideloaded databases at user_version = 6. Future schema version - // changes will need to implement migration paths for sideloaded databases at - // version 6. - auto sideUserVersion = static_cast(getPragma("PRAGMA side.user_version")); - const auto mainUserVersion = getPragma("PRAGMA user_version"); - if (sideUserVersion < 6 || sideUserVersion != mainUserVersion) { - throw std::runtime_error("Merge database has incorrect user_version"); - } - - auto currentTileCount = getOfflineMapboxTileCount(); - // clang-format off - mapbox::sqlite::Query queryTiles{ getStatement( - "SELECT COUNT(DISTINCT st.id) " - "FROM side.tiles st " - //only consider region tiles, and not ambient tiles. - "JOIN side.region_tiles srt ON srt.tile_id = st.id " - "LEFT JOIN tiles t ON st.url_template = t.url_template AND " - "st.pixel_ratio = t.pixel_ratio AND " - "st.z = t.z AND " - "st.x = t.x AND " - "st.y = t.y " - "WHERE t.id IS NULL " - "AND st.url_template LIKE 'mapbox://%' ") }; - // clang-format on - queryTiles.run(); - auto countOfTilesToMerge = queryTiles.get(0); - if ((countOfTilesToMerge + currentTileCount) > offlineMapboxTileCountLimit) { - throw MapboxTileLimitExceededException(); - } - queryTiles.reset(); - - mapbox::sqlite::Transaction transaction(*db); - db->exec(mergeSideloadedDatabaseSQL); - transaction.commit(); - - // clang-format off - mapbox::sqlite::Query queryRegions{ getStatement( - "SELECT DISTINCT r.id, r.definition, r.description " - "FROM side.regions sr " - "JOIN regions r ON sr.definition = r.definition AND sr.description IS r.description") }; - // clang-format on - - OfflineRegions result; - while (queryRegions.run()) { - // Construct, then move because this constructor is private. - OfflineRegion region(queryRegions.get(0), - decodeOfflineRegionDefinition(queryRegions.get(1)), - queryRegions.get>(2)); - result.emplace_back(std::move(region)); - } - db->exec("DETACH DATABASE side"); - // Explicit move to avoid triggering the copy constructor. - return { std::move(result) }; - } catch (const std::runtime_error& ex) { - db->exec("DETACH DATABASE side"); - Log::Error(Event::Database, "%s", ex.what()); - - return unexpected(std::current_exception()); - } - return {}; -} - -expected -OfflineDatabase::updateMetadata(const int64_t regionID, const OfflineRegionMetadata& metadata) try { - // clang-format off - mapbox::sqlite::Query query{ getStatement( - "UPDATE regions SET description = ?1 " - "WHERE id = ?2") }; - // clang-format on - query.bindBlob(1, metadata); - query.bind(2, regionID); - query.run(); - - return metadata; -} catch (const mapbox::sqlite::Exception& ex) { - handleError(ex, "update region metadata"); - return unexpected(std::current_exception()); -} - -std::exception_ptr OfflineDatabase::deleteRegion(OfflineRegion&& region) try { - { - mapbox::sqlite::Query query{ getStatement("DELETE FROM regions WHERE id = ?") }; - query.bind(1, region.getID()); - query.run(); - } - - evict(0); - assert(db); - db->exec("PRAGMA incremental_vacuum"); - - // Ensure that the cached offlineTileCount value is recalculated. - offlineMapboxTileCount = {}; - return nullptr; -} catch (const mapbox::sqlite::Exception& ex) { - handleError(ex, "delete region"); - return std::current_exception(); -} - -optional> OfflineDatabase::getRegionResource(int64_t regionID, const Resource& resource) try { - auto response = getInternal(resource); - - if (response) { - markUsed(regionID, resource); - } - - return response; -} catch (const mapbox::sqlite::Exception& ex) { - handleError(ex, "read region resource"); - return nullopt; -} - -optional OfflineDatabase::hasRegionResource(int64_t regionID, const Resource& resource) try { - auto response = hasInternal(resource); - - if (response) { - markUsed(regionID, resource); - } - - return response; -} catch (const mapbox::sqlite::Exception& ex) { - handleError(ex, "query region resource"); - return nullopt; -} - -uint64_t OfflineDatabase::putRegionResource(int64_t regionID, - const Resource& resource, - const Response& response) try { - if (!db) { - initialize(); - } - mapbox::sqlite::Transaction transaction(*db); - auto size = putRegionResourceInternal(regionID, resource, response); - transaction.commit(); - return size; -} catch (const mapbox::sqlite::Exception& ex) { - handleError(ex, "write region resource"); - return 0; -} - -void OfflineDatabase::putRegionResources(int64_t regionID, - const std::list>& resources, - OfflineRegionStatus& status) try { - if (!db) { - initialize(); - } - mapbox::sqlite::Transaction transaction(*db); - - // Accumulate all statistics locally first before adding them to the OfflineRegionStatus object - // to ensure correctness when the transaction fails. - uint64_t completedResourceCount = 0; - uint64_t completedResourceSize = 0; - uint64_t completedTileCount = 0; - uint64_t completedTileSize = 0; - - for (const auto& elem : resources) { - const auto& resource = std::get<0>(elem); - const auto& response = std::get<1>(elem); - - try { - uint64_t resourceSize = putRegionResourceInternal(regionID, resource, response); - completedResourceCount++; - completedResourceSize += resourceSize; - if (resource.kind == Resource::Kind::Tile) { - completedTileCount += 1; - completedTileSize += resourceSize; - } - } catch (const MapboxTileLimitExceededException&) { - // Commit the rest of the batch and rethrow - transaction.commit(); - throw; - } - } - - // Commit the completed batch - transaction.commit(); - - status.completedResourceCount += completedResourceCount; - status.completedResourceSize += completedResourceSize; - status.completedTileCount += completedTileCount; - status.completedTileSize += completedTileSize; -} catch (const mapbox::sqlite::Exception& ex) { - handleError(ex, "write region resources"); -} - -uint64_t OfflineDatabase::putRegionResourceInternal(int64_t regionID, const Resource& resource, const Response& response) { - if (exceedsOfflineMapboxTileCountLimit(resource)) { - throw MapboxTileLimitExceededException(); - } - - uint64_t size = putInternal(resource, response, false).second; - bool previouslyUnused = markUsed(regionID, resource); - - if (offlineMapboxTileCount - && resource.kind == Resource::Kind::Tile - && util::mapbox::isMapboxURL(resource.url) - && previouslyUnused) { - *offlineMapboxTileCount += 1; - } - - return size; -} - -bool OfflineDatabase::markUsed(int64_t regionID, const Resource& resource) { - if (resource.kind == Resource::Kind::Tile) { - // clang-format off - mapbox::sqlite::Query insertQuery{ getStatement( - "INSERT OR IGNORE INTO region_tiles (region_id, tile_id) " - "SELECT ?1, tiles.id " - "FROM tiles " - "WHERE url_template = ?2 " - " AND pixel_ratio = ?3 " - " AND x = ?4 " - " AND y = ?5 " - " AND z = ?6 ") }; - // clang-format on - - const Resource::TileData& tile = *resource.tileData; - insertQuery.bind(1, regionID); - insertQuery.bind(2, tile.urlTemplate); - insertQuery.bind(3, tile.pixelRatio); - insertQuery.bind(4, tile.x); - insertQuery.bind(5, tile.y); - insertQuery.bind(6, tile.z); - insertQuery.run(); - - if (insertQuery.changes() == 0) { - return false; - } - - // clang-format off - mapbox::sqlite::Query selectQuery{ getStatement( - "SELECT region_id " - "FROM region_tiles, tiles " - "WHERE region_id != ?1 " - " AND url_template = ?2 " - " AND pixel_ratio = ?3 " - " AND x = ?4 " - " AND y = ?5 " - " AND z = ?6 " - "LIMIT 1 ") }; - // clang-format on - - selectQuery.bind(1, regionID); - selectQuery.bind(2, tile.urlTemplate); - selectQuery.bind(3, tile.pixelRatio); - selectQuery.bind(4, tile.x); - selectQuery.bind(5, tile.y); - selectQuery.bind(6, tile.z); - return !selectQuery.run(); - } else { - // clang-format off - mapbox::sqlite::Query insertQuery{ getStatement( - "INSERT OR IGNORE INTO region_resources (region_id, resource_id) " - "SELECT ?1, resources.id " - "FROM resources " - "WHERE resources.url = ?2 ") }; - // clang-format on - - insertQuery.bind(1, regionID); - insertQuery.bind(2, resource.url); - insertQuery.run(); - - if (insertQuery.changes() == 0) { - return false; - } - - // clang-format off - mapbox::sqlite::Query selectQuery{ getStatement( - "SELECT region_id " - "FROM region_resources, resources " - "WHERE region_id != ?1 " - " AND resources.url = ?2 " - "LIMIT 1 ") }; - // clang-format on - - selectQuery.bind(1, regionID); - selectQuery.bind(2, resource.url); - return !selectQuery.run(); - } -} - -expected OfflineDatabase::getRegionDefinition(int64_t regionID) try { - mapbox::sqlite::Query query{ getStatement("SELECT definition FROM regions WHERE id = ?1") }; - query.bind(1, regionID); - query.run(); - - return decodeOfflineRegionDefinition(query.get(0)); -} catch (const mapbox::sqlite::Exception& ex) { - handleError(ex, "load region"); - return unexpected(std::current_exception()); -} - -expected OfflineDatabase::getRegionCompletedStatus(int64_t regionID) try { - OfflineRegionStatus result; - - std::tie(result.completedResourceCount, result.completedResourceSize) - = getCompletedResourceCountAndSize(regionID); - std::tie(result.completedTileCount, result.completedTileSize) - = getCompletedTileCountAndSize(regionID); - - result.completedResourceCount += result.completedTileCount; - result.completedResourceSize += result.completedTileSize; - - return result; -} catch (const mapbox::sqlite::Exception& ex) { - handleError(ex, "get region status"); - return unexpected(std::current_exception()); -} - -std::pair OfflineDatabase::getCompletedResourceCountAndSize(int64_t regionID) { - // clang-format off - mapbox::sqlite::Query query{ getStatement( - "SELECT COUNT(*), SUM(LENGTH(data)) " - "FROM region_resources, resources " - "WHERE region_id = ?1 " - "AND resource_id = resources.id ") }; - // clang-format on - query.bind(1, regionID); - query.run(); - return { query.get(0), query.get(1) }; -} - -std::pair OfflineDatabase::getCompletedTileCountAndSize(int64_t regionID) { - // clang-format off - mapbox::sqlite::Query query{ getStatement( - "SELECT COUNT(*), SUM(LENGTH(data)) " - "FROM region_tiles, tiles " - "WHERE region_id = ?1 " - "AND tile_id = tiles.id ") }; - // clang-format on - query.bind(1, regionID); - query.run(); - return { query.get(0), query.get(1) }; -} - -template -T OfflineDatabase::getPragma(const char* sql) { - mapbox::sqlite::Query query{ getStatement(sql) }; - query.run(); - return query.get(0); -} - -// Remove least-recently used resources and tiles until the used database size, -// as calculated by multiplying the number of in-use pages by the page size, is -// less than the maximum cache size. Returns false if this condition cannot be -// satisfied. -// -// SQLite database never shrinks in size unless we call VACCUM. We here -// are monitoring the soft limit (i.e. number of free pages in the file) -// and as it approaches to the hard limit (i.e. the actual file size) we -// delete an arbitrary number of old cache entries. The free pages approach saves -// us from calling VACCUM or keeping a running total, which can be costly. -bool OfflineDatabase::evict(uint64_t neededFreeSize) { - uint64_t pageSize = getPragma("PRAGMA page_size"); - uint64_t pageCount = getPragma("PRAGMA page_count"); - - auto usedSize = [&] { - return pageSize * (pageCount - getPragma("PRAGMA freelist_count")); - }; - - // The addition of pageSize is a fudge factor to account for non `data` column - // size, and because pages can get fragmented on the database. - while (usedSize() + neededFreeSize + pageSize > maximumCacheSize) { - // clang-format off - mapbox::sqlite::Query accessedQuery{ getStatement( - "SELECT max(accessed) " - "FROM ( " - " SELECT accessed " - " FROM resources " - " LEFT JOIN region_resources " - " ON resource_id = resources.id " - " WHERE resource_id IS NULL " - " UNION ALL " - " SELECT accessed " - " FROM tiles " - " LEFT JOIN region_tiles " - " ON tile_id = tiles.id " - " WHERE tile_id IS NULL " - " ORDER BY accessed ASC LIMIT ?1 " - ") " - ) }; - accessedQuery.bind(1, 50); - // clang-format on - if (!accessedQuery.run()) { - return false; - } - Timestamp accessed = accessedQuery.get(0); - - // clang-format off - mapbox::sqlite::Query resourceQuery{ getStatement( - "DELETE FROM resources " - "WHERE id IN ( " - " SELECT id FROM resources " - " LEFT JOIN region_resources " - " ON resource_id = resources.id " - " WHERE resource_id IS NULL " - " AND accessed <= ?1 " - ") ") }; - // clang-format on - resourceQuery.bind(1, accessed); - resourceQuery.run(); - const uint64_t resourceChanges = resourceQuery.changes(); - - // clang-format off - mapbox::sqlite::Query tileQuery{ getStatement( - "DELETE FROM tiles " - "WHERE id IN ( " - " SELECT id FROM tiles " - " LEFT JOIN region_tiles " - " ON tile_id = tiles.id " - " WHERE tile_id IS NULL " - " AND accessed <= ?1 " - ") ") }; - // clang-format on - tileQuery.bind(1, accessed); - tileQuery.run(); - const uint64_t tileChanges = tileQuery.changes(); - - // The cached value of offlineTileCount does not need to be updated - // here because only non-offline tiles can be removed by eviction. - - if (resourceChanges == 0 && tileChanges == 0) { - return false; - } - } - - return true; -} - -void OfflineDatabase::setOfflineMapboxTileCountLimit(uint64_t limit) { - offlineMapboxTileCountLimit = limit; -} - -uint64_t OfflineDatabase::getOfflineMapboxTileCountLimit() { - return offlineMapboxTileCountLimit; -} - -bool OfflineDatabase::offlineMapboxTileCountLimitExceeded() { - return getOfflineMapboxTileCount() >= offlineMapboxTileCountLimit; -} - -uint64_t OfflineDatabase::getOfflineMapboxTileCount() try { - // Calculating this on every call would be much simpler than caching and - // manually updating the value, but it would make offline downloads an O(n²) - // operation, because the database query below involves an index scan of - // region_tiles. - - if (offlineMapboxTileCount) { - return *offlineMapboxTileCount; - } - - // clang-format off - mapbox::sqlite::Query query{ getStatement( - "SELECT COUNT(DISTINCT id) " - "FROM region_tiles, tiles " - "WHERE tile_id = tiles.id " - "AND url_template LIKE 'mapbox://%' ") }; - // clang-format on - - query.run(); - - offlineMapboxTileCount = query.get(0); - return *offlineMapboxTileCount; -} catch (const mapbox::sqlite::Exception& ex) { - handleError(ex, "get offline Mapbox tile count"); - return std::numeric_limits::max(); -} - -bool OfflineDatabase::exceedsOfflineMapboxTileCountLimit(const Resource& resource) { - return resource.kind == Resource::Kind::Tile - && util::mapbox::isMapboxURL(resource.url) - && offlineMapboxTileCountLimitExceeded(); -} - -} // namespace mbgl diff --git a/platform/default/mbgl/storage/offline_database.hpp b/platform/default/mbgl/storage/offline_database.hpp deleted file mode 100644 index 993f36a606..0000000000 --- a/platform/default/mbgl/storage/offline_database.hpp +++ /dev/null @@ -1,130 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -namespace mapbox { -namespace sqlite { -class Database; -class Statement; -class Query; -class Exception; -} // namespace sqlite -} // namespace mapbox - -namespace mbgl { - -class Response; -class TileID; - -namespace util { -struct IOException; -} // namespace util - -struct MapboxTileLimitExceededException : util::Exception { - MapboxTileLimitExceededException() : util::Exception("Mapbox tile limit exceeded") {} -}; - -class OfflineDatabase : private util::noncopyable { -public: - // Limits affect ambient caching (put) only; resources required by offline - // regions are exempt. - OfflineDatabase(std::string path, uint64_t maximumCacheSize = util::DEFAULT_MAX_CACHE_SIZE); - ~OfflineDatabase(); - - optional get(const Resource&); - - // Return value is (inserted, stored size) - std::pair put(const Resource&, const Response&); - - expected listRegions(); - - expected createRegion(const OfflineRegionDefinition&, - const OfflineRegionMetadata&); - - expected - mergeDatabase(const std::string& sideDatabasePath); - - expected - updateMetadata(const int64_t regionID, const OfflineRegionMetadata&); - - std::exception_ptr deleteRegion(OfflineRegion&&); - - // Return value is (response, stored size) - optional> getRegionResource(int64_t regionID, const Resource&); - optional hasRegionResource(int64_t regionID, const Resource&); - uint64_t putRegionResource(int64_t regionID, const Resource&, const Response&); - void putRegionResources(int64_t regionID, const std::list>&, OfflineRegionStatus&); - - expected getRegionDefinition(int64_t regionID); - expected getRegionCompletedStatus(int64_t regionID); - - void setOfflineMapboxTileCountLimit(uint64_t); - uint64_t getOfflineMapboxTileCountLimit(); - bool offlineMapboxTileCountLimitExceeded(); - uint64_t getOfflineMapboxTileCount(); - bool exceedsOfflineMapboxTileCountLimit(const Resource&); - -private: - void initialize(); - void handleError(const mapbox::sqlite::Exception&, const char* action); - void handleError(const util::IOException&, const char* action); - - void removeExisting(); - void removeOldCacheTable(); - void createSchema(); - void migrateToVersion5(); - void migrateToVersion3(); - void migrateToVersion6(); - - mapbox::sqlite::Statement& getStatement(const char *); - - optional> getTile(const Resource::TileData&); - optional hasTile(const Resource::TileData&); - bool putTile(const Resource::TileData&, const Response&, - const std::string&, bool compressed); - - optional> getResource(const Resource&); - optional hasResource(const Resource&); - bool putResource(const Resource&, const Response&, - const std::string&, bool compressed); - - uint64_t putRegionResourceInternal(int64_t regionID, const Resource&, const Response&); - - optional> getInternal(const Resource&); - optional hasInternal(const Resource&); - std::pair putInternal(const Resource&, const Response&, bool evict); - - // Return value is true iff the resource was previously unused by any other regions. - bool markUsed(int64_t regionID, const Resource&); - - std::pair getCompletedResourceCountAndSize(int64_t regionID); - std::pair getCompletedTileCountAndSize(int64_t regionID); - - const std::string path; - std::unique_ptr db; - std::unordered_map> statements; - - template - T getPragma(const char *); - - uint64_t maximumCacheSize; - - uint64_t offlineMapboxTileCountLimit = util::mapbox::DEFAULT_OFFLINE_TILE_COUNT_LIMIT; - optional offlineMapboxTileCount; - - bool evict(uint64_t neededFreeSize); -}; - -} // namespace mbgl diff --git a/platform/default/mbgl/storage/offline_download.cpp b/platform/default/mbgl/storage/offline_download.cpp deleted file mode 100644 index c97797a5a2..0000000000 --- a/platform/default/mbgl/storage/offline_download.cpp +++ /dev/null @@ -1,453 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace mbgl { - -using namespace style; - -// Generic functions - -template -Range coveringZoomRange(const RegionDefinition& definition, - style::SourceType type, uint16_t tileSize, const Range& zoomRange) { - double minZ = std::max(util::coveringZoomLevel(definition.minZoom, type, tileSize), zoomRange.min); - double maxZ = std::min(util::coveringZoomLevel(definition.maxZoom, type, tileSize), zoomRange.max); - - assert(minZ >= 0); - assert(maxZ >= 0); - assert(minZ < std::numeric_limits::max()); - assert(maxZ < std::numeric_limits::max()); - return { static_cast(minZ), static_cast(maxZ) }; -} - -template -void tileCover(const Geometry& geometry, uint8_t z, Fn&& fn) { - util::TileCover cover(geometry, z); - while (cover.hasNext()) { - fn(cover.next()->canonical); - } -} - - -template -void tileCover(const OfflineRegionDefinition& definition, style::SourceType type, - uint16_t tileSize, const Range& zoomRange, Fn&& fn) { - const Range clampedZoomRange = - definition.match([&](auto& reg) { return coveringZoomRange(reg, type, tileSize, zoomRange); }); - - for (uint8_t z = clampedZoomRange.min; z <= clampedZoomRange.max; z++) { - definition.match( - [&](const OfflineTilePyramidRegionDefinition& reg){ tileCover(reg.bounds, z, fn); }, - [&](const OfflineGeometryRegionDefinition& reg){ tileCover(reg.geometry, z, fn); } - ); - } -} - -uint64_t tileCount(const OfflineRegionDefinition& definition, style::SourceType type, - uint16_t tileSize, const Range& zoomRange) { - - const Range clampedZoomRange = - definition.match([&](auto& reg) { return coveringZoomRange(reg, type, tileSize, zoomRange); }); - - unsigned long result = 0;; - for (uint8_t z = clampedZoomRange.min; z <= clampedZoomRange.max; z++) { - result += definition.match( - [&](const OfflineTilePyramidRegionDefinition& reg){ return util::tileCount(reg.bounds, z); }, - [&](const OfflineGeometryRegionDefinition& reg){ return util::tileCount(reg.geometry, z); } - ); - } - - return result; -} - -// OfflineDownload - -OfflineDownload::OfflineDownload(int64_t id_, - OfflineRegionDefinition&& definition_, - OfflineDatabase& offlineDatabase_, - OnlineFileSource& onlineFileSource_) - : id(id_), - definition(definition_), - offlineDatabase(offlineDatabase_), - onlineFileSource(onlineFileSource_) { - setObserver(nullptr); -} - -OfflineDownload::~OfflineDownload() = default; - -void OfflineDownload::setObserver(std::unique_ptr observer_) { - observer = observer_ ? std::move(observer_) : std::make_unique(); -} - -void OfflineDownload::setState(OfflineRegionDownloadState state) { - if (status.downloadState == state) { - return; - } - - status.downloadState = state; - - if (status.downloadState == OfflineRegionDownloadState::Active) { - activateDownload(); - } else { - deactivateDownload(); - } - - observer->statusChanged(status); -} - -OfflineRegionStatus OfflineDownload::getStatus() const { - if (status.downloadState == OfflineRegionDownloadState::Active) { - return status; - } - - auto result = offlineDatabase.getRegionCompletedStatus(id); - if (!result) { - // We can't find this offline region because the database is unavailable, or the download - // does not exist. - return {}; - } - - result->requiredResourceCount++; - optional styleResponse = - offlineDatabase.get(Resource::style(definition.match([](auto& reg){ return reg.styleURL; }))); - if (!styleResponse) { - return *result; - } - - style::Parser parser; - parser.parse(*styleResponse->data); - - result->requiredResourceCountIsPrecise = true; - - for (const auto& source : parser.sources) { - SourceType type = source->getType(); - - auto handleTiledSource = [&] (const variant& urlOrTileset, const uint16_t tileSize) { - if (urlOrTileset.is()) { - result->requiredResourceCount += - tileCount(definition, type, tileSize, urlOrTileset.get().zoomRange); - } else { - result->requiredResourceCount += 1; - const auto& url = urlOrTileset.get(); - optional sourceResponse = offlineDatabase.get(Resource::source(url)); - if (sourceResponse) { - style::conversion::Error error; - optional tileset = style::conversion::convertJSON(*sourceResponse->data, error); - if (tileset) { - result->requiredResourceCount += - tileCount(definition, type, tileSize, (*tileset).zoomRange); - } - } else { - result->requiredResourceCountIsPrecise = false; - } - } - }; - - switch (type) { - case SourceType::Vector: { - const auto& vectorSource = *source->as(); - handleTiledSource(vectorSource.getURLOrTileset(), util::tileSize); - break; - } - - case SourceType::Raster: { - const auto& rasterSource = *source->as(); - handleTiledSource(rasterSource.getURLOrTileset(), rasterSource.getTileSize()); - break; - } - - case SourceType::RasterDEM: { - const auto& rasterDEMSource = *source->as(); - handleTiledSource(rasterDEMSource.getURLOrTileset(), rasterDEMSource.getTileSize()); - break; - } - - case SourceType::GeoJSON: { - const auto& geojsonSource = *source->as(); - if (geojsonSource.getURL()) { - result->requiredResourceCount += 1; - } - break; - } - - case SourceType::Image: { - const auto& imageSource = *source->as(); - if (imageSource.getURL()) { - result->requiredResourceCount += 1; - } - break; - } - - case SourceType::Video: - case SourceType::Annotations: - case SourceType::CustomVector: - break; - } - } - - if (!parser.glyphURL.empty()) { - result->requiredResourceCount += parser.fontStacks().size() * GLYPH_RANGES_PER_FONT_STACK; - } - - if (!parser.spriteURL.empty()) { - result->requiredResourceCount += 4; - } - - return *result; -} - -void OfflineDownload::activateDownload() { - status = OfflineRegionStatus(); - status.downloadState = OfflineRegionDownloadState::Active; - status.requiredResourceCount++; - ensureResource(Resource::style(definition.match([](auto& reg){ return reg.styleURL; }), Resource::Priority::Low), - [&](Response styleResponse) { - status.requiredResourceCountIsPrecise = true; - - style::Parser parser; - parser.parse(*styleResponse.data); - - for (const auto& source : parser.sources) { - SourceType type = source->getType(); - - auto handleTiledSource = [&] (const variant& urlOrTileset, const uint16_t tileSize) { - if (urlOrTileset.is()) { - queueTiles(type, tileSize, urlOrTileset.get()); - } else { - const auto& url = urlOrTileset.get(); - status.requiredResourceCountIsPrecise = false; - status.requiredResourceCount++; - requiredSourceURLs.insert(url); - - ensureResource(Resource::source(url, Resource::Priority::Low), [=](Response sourceResponse) { - style::conversion::Error error; - optional tileset = style::conversion::convertJSON(*sourceResponse.data, error); - if (tileset) { - util::mapbox::canonicalizeTileset(*tileset, url, type, tileSize); - queueTiles(type, tileSize, *tileset); - - requiredSourceURLs.erase(url); - if (requiredSourceURLs.empty()) { - status.requiredResourceCountIsPrecise = true; - } - } - }); - } - }; - - switch (type) { - case SourceType::Vector: { - const auto& vectorSource = *source->as(); - handleTiledSource(vectorSource.getURLOrTileset(), util::tileSize); - break; - } - - case SourceType::Raster: { - const auto& rasterSource = *source->as(); - handleTiledSource(rasterSource.getURLOrTileset(), rasterSource.getTileSize()); - break; - } - - case SourceType::RasterDEM: { - const auto& rasterDEMSource = *source->as(); - handleTiledSource(rasterDEMSource.getURLOrTileset(), rasterDEMSource.getTileSize()); - break; - } - - case SourceType::GeoJSON: { - const auto& geojsonSource = *source->as(); - if (geojsonSource.getURL()) { - queueResource(Resource::source(*geojsonSource.getURL())); - } - break; - } - - case SourceType::Image: { - const auto& imageSource = *source->as(); - auto imageUrl = imageSource.getURL(); - if (imageUrl && !imageUrl->empty()) { - queueResource(Resource::image(*imageUrl)); - } - break; - } - - case SourceType::Video: - case SourceType::Annotations: - case SourceType::CustomVector: - break; - } - } - - if (!parser.glyphURL.empty()) { - for (const auto& fontStack : parser.fontStacks()) { - for (char16_t i = 0; i < GLYPH_RANGES_PER_FONT_STACK; i++) { - queueResource(Resource::glyphs(parser.glyphURL, fontStack, getGlyphRange(i * GLYPHS_PER_GLYPH_RANGE))); - } - } - } - - if (!parser.spriteURL.empty()) { - // Always request 1x and @2x sprite images for portability. - queueResource(Resource::spriteImage(parser.spriteURL, 1)); - queueResource(Resource::spriteImage(parser.spriteURL, 2)); - queueResource(Resource::spriteJSON(parser.spriteURL, 1)); - queueResource(Resource::spriteJSON(parser.spriteURL, 2)); - } - - continueDownload(); - }); -} - -/* - Fill up our own request queue by requesting the next few resources. This is called - when activating the download, or when a request completes successfully. - - Note "successfully"; it's not called when a requests receives an error. A request - that errors will be retried after some delay. So in that sense it's still "active" - and consuming resources, notably the request object, its timer, and network resources - when the timer fires. - - We could try to squeeze in subsequent requests while we wait for the errored request - to retry. But that risks overloading the upstream request queue -- defeating our own - metering -- if there are a lot of errored requests that all come up for retry at the - same time. And many times, the cause of a request error will apply to many requests - of the same type. For instance if a server is unreachable, all the requests to that - host are going to error. In that case, continuing to try subsequent resources after - the first few errors is fruitless anyway. -*/ -void OfflineDownload::continueDownload() { - if (resourcesRemaining.empty() && status.complete()) { - setState(OfflineRegionDownloadState::Inactive); - return; - } - - while (!resourcesRemaining.empty() && requests.size() < onlineFileSource.getMaximumConcurrentRequests()) { - ensureResource(resourcesRemaining.front()); - resourcesRemaining.pop_front(); - } -} - -void OfflineDownload::deactivateDownload() { - requiredSourceURLs.clear(); - resourcesRemaining.clear(); - requests.clear(); -} - -void OfflineDownload::queueResource(Resource resource) { - resource.setPriority(Resource::Priority::Low); - status.requiredResourceCount++; - resourcesRemaining.push_front(std::move(resource)); -} - -void OfflineDownload::queueTiles(SourceType type, uint16_t tileSize, const Tileset& tileset) { - tileCover(definition, type, tileSize, tileset.zoomRange, [&](const auto& tile) { - status.requiredResourceCount++; - resourcesRemaining.push_back(Resource::tile( - tileset.tiles[0], definition.match([](auto& def) { return def.pixelRatio; }), tile.x, - tile.y, tile.z, tileset.scheme, Resource::Priority::Low)); - }); -} - -void OfflineDownload::ensureResource(const Resource& resource, - std::function callback) { - assert(resource.priority == Resource::Priority::Low); - - auto workRequestsIt = requests.insert(requests.begin(), nullptr); - *workRequestsIt = util::RunLoop::Get()->invokeCancellable([=]() { - requests.erase(workRequestsIt); - - auto getResourceSizeInDatabase = [&] () -> optional { - if (!callback) { - return offlineDatabase.hasRegionResource(id, resource); - } - optional> response = offlineDatabase.getRegionResource(id, resource); - if (!response) { - return {}; - } - callback(response->first); - return response->second; - }; - - optional offlineResponse = getResourceSizeInDatabase(); - if (offlineResponse) { - status.completedResourceCount++; - status.completedResourceSize += *offlineResponse; - if (resource.kind == Resource::Kind::Tile) { - status.completedTileCount += 1; - status.completedTileSize += *offlineResponse; - } - - observer->statusChanged(status); - continueDownload(); - return; - } - - if (offlineDatabase.exceedsOfflineMapboxTileCountLimit(resource)) { - onMapboxTileCountLimitExceeded(); - return; - } - - auto fileRequestsIt = requests.insert(requests.begin(), nullptr); - *fileRequestsIt = onlineFileSource.request(resource, [=](Response onlineResponse) { - if (onlineResponse.error) { - observer->responseError(*onlineResponse.error); - return; - } - - requests.erase(fileRequestsIt); - - if (callback) { - callback(onlineResponse); - } - - // Queue up for batched insertion - buffer.emplace_back(resource, onlineResponse); - - // Flush buffer periodically - if (buffer.size() == 64 || resourcesRemaining.size() == 0) { - try { - offlineDatabase.putRegionResources(id, buffer, status); - } catch (const MapboxTileLimitExceededException&) { - onMapboxTileCountLimitExceeded(); - return; - } - - buffer.clear(); - observer->statusChanged(status); - } - - if (offlineDatabase.exceedsOfflineMapboxTileCountLimit(resource)) { - onMapboxTileCountLimitExceeded(); - return; - } - - continueDownload(); - }); - }); -} - -void OfflineDownload::onMapboxTileCountLimitExceeded() { - observer->mapboxTileCountLimitExceeded(offlineDatabase.getOfflineMapboxTileCountLimit()); - setState(OfflineRegionDownloadState::Inactive); -} - -} // namespace mbgl diff --git a/platform/default/mbgl/storage/offline_download.hpp b/platform/default/mbgl/storage/offline_download.hpp deleted file mode 100644 index 1e77ff1d35..0000000000 --- a/platform/default/mbgl/storage/offline_download.hpp +++ /dev/null @@ -1,69 +0,0 @@ -#pragma once - -#include -#include -#include - -#include -#include -#include -#include - -namespace mbgl { - -class OfflineDatabase; -class FileSource; -class AsyncRequest; -class Response; -class Tileset; - -namespace style { -class Parser; -} // namespace style - -/** - * Coordinates the request and storage of all resources for an offline region. - - * @private - */ -class OfflineDownload { -public: - OfflineDownload(int64_t id, OfflineRegionDefinition&&, OfflineDatabase& offline, OnlineFileSource& online); - ~OfflineDownload(); - - void setObserver(std::unique_ptr); - void setState(OfflineRegionDownloadState); - - OfflineRegionStatus getStatus() const; - -private: - void activateDownload(); - void continueDownload(); - void deactivateDownload(); - - /* - * Ensure that the resource is stored in the database, requesting it if necessary. - * While the request is in progress, it is recorded in `requests`. If the download - * is deactivated, all in progress requests are cancelled. - */ - void ensureResource(const Resource&, std::function = {}); - - void onMapboxTileCountLimitExceeded(); - - int64_t id; - OfflineRegionDefinition definition; - OfflineDatabase& offlineDatabase; - OnlineFileSource& onlineFileSource; - OfflineRegionStatus status; - std::unique_ptr observer; - - std::list> requests; - std::unordered_set requiredSourceURLs; - std::deque resourcesRemaining; - std::list> buffer; - - void queueResource(Resource); - void queueTiles(style::SourceType, uint16_t tileSize, const Tileset&); -}; - -} // namespace mbgl diff --git a/platform/default/mbgl/storage/offline_schema.hpp b/platform/default/mbgl/storage/offline_schema.hpp deleted file mode 100644 index e177d0dbd3..0000000000 --- a/platform/default/mbgl/storage/offline_schema.hpp +++ /dev/null @@ -1,63 +0,0 @@ -#pragma once - -// THIS IS A GENERATED FILE; EDIT offline_schema.sql INSTEAD -// To regenerate, run `node platform/default/mbgl/storage/offline_schema.js` - -namespace mbgl { - -static constexpr const char* offlineDatabaseSchema = -"CREATE TABLE resources (\n" -" id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n" -" url TEXT NOT NULL,\n" -" kind INTEGER NOT NULL,\n" -" expires INTEGER,\n" -" modified INTEGER,\n" -" etag TEXT,\n" -" data BLOB,\n" -" compressed INTEGER NOT NULL DEFAULT 0,\n" -" accessed INTEGER NOT NULL,\n" -" must_revalidate INTEGER NOT NULL DEFAULT 0,\n" -" UNIQUE (url)\n" -");\n" -"CREATE TABLE tiles (\n" -" id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n" -" url_template TEXT NOT NULL,\n" -" pixel_ratio INTEGER NOT NULL,\n" -" z INTEGER NOT NULL,\n" -" x INTEGER NOT NULL,\n" -" y INTEGER NOT NULL,\n" -" expires INTEGER,\n" -" modified INTEGER,\n" -" etag TEXT,\n" -" data BLOB,\n" -" compressed INTEGER NOT NULL DEFAULT 0,\n" -" accessed INTEGER NOT NULL,\n" -" must_revalidate INTEGER NOT NULL DEFAULT 0,\n" -" UNIQUE (url_template, pixel_ratio, z, x, y)\n" -");\n" -"CREATE TABLE regions (\n" -" id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n" -" definition TEXT NOT NULL,\n" -" description BLOB\n" -");\n" -"CREATE TABLE region_resources (\n" -" region_id INTEGER NOT NULL REFERENCES regions(id) ON DELETE CASCADE,\n" -" resource_id INTEGER NOT NULL REFERENCES resources(id),\n" -" UNIQUE (region_id, resource_id)\n" -");\n" -"CREATE TABLE region_tiles (\n" -" region_id INTEGER NOT NULL REFERENCES regions(id) ON DELETE CASCADE,\n" -" tile_id INTEGER NOT NULL REFERENCES tiles(id),\n" -" UNIQUE (region_id, tile_id)\n" -");\n" -"CREATE INDEX resources_accessed\n" -"ON resources (accessed);\n" -"CREATE INDEX tiles_accessed\n" -"ON tiles (accessed);\n" -"CREATE INDEX region_resources_resource_id\n" -"ON region_resources (resource_id);\n" -"CREATE INDEX region_tiles_tile_id\n" -"ON region_tiles (tile_id);\n" -; - -} // namespace mbgl diff --git a/platform/default/mbgl/storage/offline_schema.js b/platform/default/mbgl/storage/offline_schema.js deleted file mode 100644 index fdb7dc6405..0000000000 --- a/platform/default/mbgl/storage/offline_schema.js +++ /dev/null @@ -1,21 +0,0 @@ -var fs = require('fs'); -fs.writeFileSync('platform/default/mbgl/storage/offline_schema.hpp', `#pragma once - -// THIS IS A GENERATED FILE; EDIT offline_schema.sql INSTEAD -// To regenerate, run \`node platform/default/mbgl/storage/offline_schema.js\` - -namespace mbgl { - -static constexpr const char* offlineDatabaseSchema = -${fs.readFileSync('platform/default/mbgl/storage/offline_schema.sql', 'utf8') - .replace(/ *--.*/g, '') - .split('\n') - .filter(a => a) - .map(line => '"' + line + '\\n"') - .join('\n') -} -; - -} // namespace mbgl -`); - diff --git a/platform/default/mbgl/storage/offline_schema.sql b/platform/default/mbgl/storage/offline_schema.sql deleted file mode 100644 index 722b0e0451..0000000000 --- a/platform/default/mbgl/storage/offline_schema.sql +++ /dev/null @@ -1,64 +0,0 @@ -CREATE TABLE resources ( -- Generic table for style, source, sprite, and glyph resources. - id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, - url TEXT NOT NULL, - kind INTEGER NOT NULL, - expires INTEGER, - modified INTEGER, - etag TEXT, - data BLOB, - compressed INTEGER NOT NULL DEFAULT 0, - accessed INTEGER NOT NULL, - must_revalidate INTEGER NOT NULL DEFAULT 0, - UNIQUE (url) -); - -CREATE TABLE tiles ( - id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, - url_template TEXT NOT NULL, - pixel_ratio INTEGER NOT NULL, - z INTEGER NOT NULL, - x INTEGER NOT NULL, - y INTEGER NOT NULL, - expires INTEGER, - modified INTEGER, - etag TEXT, - data BLOB, - compressed INTEGER NOT NULL DEFAULT 0, - accessed INTEGER NOT NULL, - must_revalidate INTEGER NOT NULL DEFAULT 0, - UNIQUE (url_template, pixel_ratio, z, x, y) -); - -CREATE TABLE regions ( - id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, - definition TEXT NOT NULL, -- JSON formatted definition of region. Regions may be of variant types: - -- e.g. bbox and zoom range, route path, flyTo parameters, etc. Note that - -- the set of tiles required for a region may span multiple sources. - description BLOB -- User provided data in user-defined format -); - -CREATE TABLE region_resources ( - region_id INTEGER NOT NULL REFERENCES regions(id) ON DELETE CASCADE, - resource_id INTEGER NOT NULL REFERENCES resources(id), - UNIQUE (region_id, resource_id) -); - -CREATE TABLE region_tiles ( - region_id INTEGER NOT NULL REFERENCES regions(id) ON DELETE CASCADE, - tile_id INTEGER NOT NULL REFERENCES tiles(id), - UNIQUE (region_id, tile_id) -); - --- Indexes for efficient eviction queries - -CREATE INDEX resources_accessed -ON resources (accessed); - -CREATE INDEX tiles_accessed -ON tiles (accessed); - -CREATE INDEX region_resources_resource_id -ON region_resources (resource_id); - -CREATE INDEX region_tiles_tile_id -ON region_tiles (tile_id); diff --git a/platform/default/mbgl/test/main.cpp b/platform/default/mbgl/test/main.cpp deleted file mode 100644 index d01cf75ffc..0000000000 --- a/platform/default/mbgl/test/main.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include -#include -#include -#include - -#define xstr(s) str(s) -#define str(s) #s - -int main(int argc, char *argv[]) { -#ifdef WORK_DIRECTORY - const int result = chdir(xstr(WORK_DIRECTORY)); - if (result != 0) { - fprintf(stderr, "failed to change directory: %s\n", strerror(errno)); - return errno; - } -#endif - - return mbgl::runTests(argc, argv); -} diff --git a/platform/default/mbgl/util/default_styles.hpp b/platform/default/mbgl/util/default_styles.hpp deleted file mode 100644 index 13f08252a7..0000000000 --- a/platform/default/mbgl/util/default_styles.hpp +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -#include -#include - -namespace mbgl { -namespace util { -namespace default_styles { - -struct DefaultStyle { - const char* url; - const char* name; - const unsigned currentVersion; -}; - -constexpr const DefaultStyle streets = { "mapbox://styles/mapbox/streets-v10", "Streets", 10 }; -constexpr const DefaultStyle outdoors = { "mapbox://styles/mapbox/outdoors-v10", "Outdoors", 10 }; -constexpr const DefaultStyle light = { "mapbox://styles/mapbox/light-v9", "Light", 9 }; -constexpr const DefaultStyle dark = { "mapbox://styles/mapbox/dark-v9", "Dark", 9 }; -constexpr const DefaultStyle satellite = { "mapbox://styles/mapbox/satellite-v9", "Satellite", 9 }; -constexpr const DefaultStyle satelliteStreets = { "mapbox://styles/mapbox/satellite-streets-v10", "Satellite Streets", 10 }; - -const DefaultStyle orderedStyles[] = { - streets, outdoors, light, dark, satellite, satelliteStreets, -}; -const size_t numOrderedStyles = sizeof(orderedStyles) / sizeof(DefaultStyle); - -} // end namespace default_styles -} // end namespace util -} // end namespace mbgl diff --git a/platform/default/mbgl/util/default_thread_pool.cpp b/platform/default/mbgl/util/default_thread_pool.cpp deleted file mode 100644 index d3950bb8aa..0000000000 --- a/platform/default/mbgl/util/default_thread_pool.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include -#include -#include -#include - -namespace mbgl { - -ThreadPool::ThreadPool(std::size_t count) { - threads.reserve(count); - for (std::size_t i = 0; i < count; ++i) { - threads.emplace_back([this, i]() { - platform::setCurrentThreadName(std::string{ "Worker " } + util::toString(i + 1)); - - while (true) { - std::unique_lock lock(mutex); - - cv.wait(lock, [this] { - return !queue.empty() || terminate; - }); - - if (terminate) { - return; - } - - auto mailbox = queue.front(); - queue.pop(); - lock.unlock(); - - Mailbox::maybeReceive(mailbox); - } - }); - } -} - -ThreadPool::~ThreadPool() { - { - std::lock_guard lock(mutex); - terminate = true; - } - - cv.notify_all(); - - for (auto& thread : threads) { - thread.join(); - } -} - -void ThreadPool::schedule(std::weak_ptr mailbox) { - { - std::lock_guard lock(mutex); - queue.push(mailbox); - } - - cv.notify_one(); -} - -} // namespace mbgl diff --git a/platform/default/mbgl/util/default_thread_pool.hpp b/platform/default/mbgl/util/default_thread_pool.hpp deleted file mode 100644 index a14d16d771..0000000000 --- a/platform/default/mbgl/util/default_thread_pool.hpp +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -#include - -#include -#include -#include -#include - -namespace mbgl { - -class ThreadPool : public Scheduler { -public: - ThreadPool(std::size_t count); - ~ThreadPool() override; - - void schedule(std::weak_ptr) override; - -private: - std::vector threads; - std::queue> queue; - std::mutex mutex; - std::condition_variable cv; - bool terminate { false }; -}; - -} // namespace mbgl diff --git a/platform/default/mbgl/util/shared_thread_pool.cpp b/platform/default/mbgl/util/shared_thread_pool.cpp deleted file mode 100644 index 7a42df21de..0000000000 --- a/platform/default/mbgl/util/shared_thread_pool.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "shared_thread_pool.hpp" - -namespace mbgl { - -std::shared_ptr sharedThreadPool() { - static std::weak_ptr weak; - auto pool = weak.lock(); - if (!pool) { - weak = pool = std::make_shared(4); - } - return pool; -} - -} // namespace mbgl diff --git a/platform/default/mbgl/util/shared_thread_pool.hpp b/platform/default/mbgl/util/shared_thread_pool.hpp deleted file mode 100644 index 04a3cb58d5..0000000000 --- a/platform/default/mbgl/util/shared_thread_pool.hpp +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#include - -namespace mbgl { - -std::shared_ptr sharedThreadPool(); - -} // namespace mbgl diff --git a/platform/default/online_file_source.cpp b/platform/default/online_file_source.cpp deleted file mode 100644 index fce1c3e2b6..0000000000 --- a/platform/default/online_file_source.cpp +++ /dev/null @@ -1,488 +0,0 @@ -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -namespace mbgl { - -static uint32_t DEFAULT_MAXIMUM_CONCURRENT_REQUESTS = 20; - -class OnlineFileRequest : public AsyncRequest { -public: - using Callback = std::function; - - OnlineFileRequest(Resource, Callback, OnlineFileSource::Impl&); - ~OnlineFileRequest() override; - - void networkIsReachableAgain(); - void schedule(); - void schedule(optional expires); - void completed(Response); - - void setTransformedURL(const std::string&& url); - ActorRef actor(); - - OnlineFileSource::Impl& impl; - Resource resource; - std::unique_ptr request; - util::Timer timer; - Callback callback; - - std::shared_ptr mailbox; - - // Counts the number of times a response was already expired when received. We're using - // this to add a delay when making a new request so we don't keep retrying immediately - // in case of a server serving expired tiles. - uint32_t expiredRequests = 0; - - // Counts the number of subsequent failed requests. We're using this value for exponential - // backoff when retrying requests. - uint32_t failedRequests = 0; - Response::Error::Reason failedRequestReason = Response::Error::Reason::Success; - optional retryAfter; -}; - -class OnlineFileSource::Impl { -public: - Impl() { - NetworkStatus::Subscribe(&reachability); - setMaximumConcurrentRequests(DEFAULT_MAXIMUM_CONCURRENT_REQUESTS); - } - - ~Impl() { - NetworkStatus::Unsubscribe(&reachability); - } - - void add(OnlineFileRequest* request) { - allRequests.insert(request); - if (resourceTransform) { - // Request the ResourceTransform actor a new url and replace the resource url with the - // transformed one before proceeding to schedule the request. - resourceTransform->invoke(&ResourceTransform::transform, request->resource.kind, - std::move(request->resource.url), [ref = request->actor()](const std::string&& url) mutable { - ref.invoke(&OnlineFileRequest::setTransformedURL, std::move(url)); - }); - } else { - request->schedule(); - } - } - - void remove(OnlineFileRequest* request) { - allRequests.erase(request); - if (activeRequests.erase(request)) { - activatePendingRequest(); - } else { - pendingRequests.remove(request); - } - } - - void activateOrQueueRequest(OnlineFileRequest* request) { - assert(allRequests.find(request) != allRequests.end()); - assert(activeRequests.find(request) == activeRequests.end()); - assert(!request->request); - - if (activeRequests.size() >= getMaximumConcurrentRequests()) { - queueRequest(request); - } else { - activateRequest(request); - } - } - - void queueRequest(OnlineFileRequest* request) { - pendingRequests.insert(request); - } - - void activateRequest(OnlineFileRequest* request) { - auto callback = [=](Response response) { - activeRequests.erase(request); - request->request.reset(); - request->completed(response); - activatePendingRequest(); - }; - - activeRequests.insert(request); - - if (online) { - request->request = httpFileSource.request(request->resource, callback); - } else { - Response response; - response.error = std::make_unique(Response::Error::Reason::Connection, - "Online connectivity is disabled."); - callback(response); - } - - } - - void activatePendingRequest() { - - auto request = pendingRequests.pop(); - - if (request) { - activateRequest(*request); - } - } - - bool isPending(OnlineFileRequest* request) { - return pendingRequests.contains(request); - } - - bool isActive(OnlineFileRequest* request) { - return activeRequests.find(request) != activeRequests.end(); - } - - void setResourceTransform(optional>&& transform) { - resourceTransform = std::move(transform); - } - - void setOnlineStatus(const bool status) { - online = status; - networkIsReachableAgain(); - } - - uint32_t getMaximumConcurrentRequests() const { - return maximumConcurrentRequests; - } - - void setMaximumConcurrentRequests(uint32_t maximumConcurrentRequests_) { - maximumConcurrentRequests = maximumConcurrentRequests_; - } - -private: - - void networkIsReachableAgain() { - for (auto& request : allRequests) { - request->networkIsReachableAgain(); - } - } - - // Using Pending Requests as an priority queue which processes - // file requests in a FIFO manner but prefers regular requests - // over offline requests with a low priority such that low priority - // requests do not throttle regular requests. - // - // The order of a queue is therefore: - // - // hi0 -- hi1 -- hi2 -- hi3 -- lo0 -- lo1 --lo2 - // ^ - // firstLowPriorityRequest - - struct PendingRequests { - PendingRequests() : queue(), firstLowPriorityRequest(queue.begin()) {} - - std::list queue; - std::list::iterator firstLowPriorityRequest; - - void remove(const OnlineFileRequest* request) { - auto it = std::find(queue.begin(), queue.end(), request); - if (it != queue.end()) { - if (it == firstLowPriorityRequest) { - firstLowPriorityRequest++; - } - queue.erase(it); - } - } - - void insert(OnlineFileRequest* request) { - if (request->resource.priority == Resource::Priority::Regular) { - firstLowPriorityRequest = queue.insert(firstLowPriorityRequest, request); - firstLowPriorityRequest++; - } - else { - if (firstLowPriorityRequest == queue.end()) { - firstLowPriorityRequest = queue.insert(queue.end(), request); - } - else { - queue.insert(queue.end(), request); - } - } - } - - - optional pop() { - if (queue.empty()) { - return optional(); - } - - if (queue.begin() == firstLowPriorityRequest) { - firstLowPriorityRequest++; - } - - OnlineFileRequest* next = queue.front(); - queue.pop_front(); - return optional(next); - } - - bool contains(OnlineFileRequest* request) const { - return (std::find(queue.begin(), queue.end(), request) != queue.end()); - } - - }; - - optional> resourceTransform; - - /** - * The lifetime of a request is: - * - * 1. Waiting for timeout (revalidation or retry) - * 2. Pending (waiting for room in the active set) - * 3. Active (open network connection) - * 4. Back to #1 - * - * Requests in any state are in `allRequests`. Requests in the pending state are in - * `pendingRequests`. Requests in the active state are in `activeRequests`. - */ - std::unordered_set allRequests; - - PendingRequests pendingRequests; - - std::unordered_set activeRequests; - - bool online = true; - uint32_t maximumConcurrentRequests; - HTTPFileSource httpFileSource; - util::AsyncTask reachability { std::bind(&Impl::networkIsReachableAgain, this) }; -}; - -OnlineFileSource::OnlineFileSource() - : impl(std::make_unique()) { -} - -OnlineFileSource::~OnlineFileSource() = default; - -std::unique_ptr OnlineFileSource::request(const Resource& resource, Callback callback) { - Resource res = resource; - - switch (resource.kind) { - case Resource::Kind::Unknown: - case Resource::Kind::Image: - break; - - case Resource::Kind::Style: - res.url = mbgl::util::mapbox::normalizeStyleURL(apiBaseURL, resource.url, accessToken); - break; - - case Resource::Kind::Source: - res.url = util::mapbox::normalizeSourceURL(apiBaseURL, resource.url, accessToken); - break; - - case Resource::Kind::Glyphs: - res.url = util::mapbox::normalizeGlyphsURL(apiBaseURL, resource.url, accessToken); - break; - - case Resource::Kind::SpriteImage: - case Resource::Kind::SpriteJSON: - res.url = util::mapbox::normalizeSpriteURL(apiBaseURL, resource.url, accessToken); - break; - - case Resource::Kind::Tile: - res.url = util::mapbox::normalizeTileURL(apiBaseURL, resource.url, accessToken); - break; - } - - return std::make_unique(std::move(res), std::move(callback), *impl); -} - -void OnlineFileSource::setResourceTransform(optional>&& transform) { - impl->setResourceTransform(std::move(transform)); -} - -OnlineFileRequest::OnlineFileRequest(Resource resource_, Callback callback_, OnlineFileSource::Impl& impl_) - : impl(impl_), - resource(std::move(resource_)), - callback(std::move(callback_)) { - impl.add(this); -} - -void OnlineFileRequest::schedule() { - // Force an immediate first request if we don't have an expiration time. - if (resource.priorExpires) { - schedule(resource.priorExpires); - } else { - schedule(util::now()); - } -} - -OnlineFileRequest::~OnlineFileRequest() { - impl.remove(this); -} - -Timestamp interpolateExpiration(const Timestamp& current, - optional prior, - bool& expired) { - auto now = util::now(); - if (current > now) { - return current; - } - - if (!bool(prior)) { - expired = true; - return current; - } - - // Expiring date is going backwards, - // fallback to exponential backoff. - if (current < *prior) { - expired = true; - return current; - } - - auto delta = current - *prior; - - // Server is serving the same expired resource - // over and over, fallback to exponential backoff. - if (delta == Duration::zero()) { - expired = true; - return current; - } - - // Assume that either the client or server clock is wrong and - // try to interpolate a valid expiration date (from the client POV) - // observing a minimum timeout. - return now + std::max(delta, util::CLOCK_SKEW_RETRY_TIMEOUT); -} - -void OnlineFileRequest::schedule(optional expires) { - if (impl.isPending(this) || impl.isActive(this)) { - // There's already a request in progress; don't start another one. - return; - } - - // If we're not being asked for a forced refresh, calculate a timeout that depends on how many - // consecutive errors we've encountered, and on the expiration time, if present. - Duration timeout = std::min( - http::errorRetryTimeout(failedRequestReason, failedRequests, retryAfter), - http::expirationTimeout(expires, expiredRequests)); - - if (timeout == Duration::max()) { - return; - } - - // Emulate a Connection error when the Offline mode is forced with - // a really long timeout. The request will get re-triggered when - // the NetworkStatus is set back to Online. - if (NetworkStatus::Get() == NetworkStatus::Status::Offline) { - failedRequestReason = Response::Error::Reason::Connection; - failedRequests = 1; - timeout = Duration::max(); - } - - timer.start(timeout, Duration::zero(), [&] { - impl.activateOrQueueRequest(this); - }); -} - -void OnlineFileRequest::completed(Response response) { - // If we didn't get various caching headers in the response, continue using the - // previous values. Otherwise, update the previous values to the new values. - - if (!response.modified) { - response.modified = resource.priorModified; - } else { - resource.priorModified = response.modified; - } - - if (response.notModified && resource.priorData) { - // When the priorData field is set, it indicates that we had to revalidate the request and - // that the requestor hasn't gotten data yet. If we get a 304 response, this means that we - // have send the cached data to give the requestor a chance to actually obtain the data. - response.data = std::move(resource.priorData); - response.notModified = false; - } - - bool isExpired = false; - - if (response.expires) { - auto prior = resource.priorExpires; - resource.priorExpires = response.expires; - response.expires = interpolateExpiration(*response.expires, prior, isExpired); - } - - if (isExpired) { - expiredRequests++; - } else { - expiredRequests = 0; - } - - if (!response.etag) { - response.etag = resource.priorEtag; - } else { - resource.priorEtag = response.etag; - } - - if (response.error) { - failedRequests++; - failedRequestReason = response.error->reason; - retryAfter = response.error->retryAfter; - } else { - failedRequests = 0; - failedRequestReason = Response::Error::Reason::Success; - } - - schedule(response.expires); - - // Calling the callback may result in `this` being deleted. It needs to be done last, - // and needs to make a local copy of the callback to ensure that it remains valid for - // the duration of the call. - auto callback_ = callback; - callback_(response); -} - -void OnlineFileRequest::networkIsReachableAgain() { - // We need all requests to fail at least once before we are going to start retrying - // them, and we only immediately restart request that failed due to connection issues. - if (failedRequestReason == Response::Error::Reason::Connection) { - schedule(util::now()); - } -} - -void OnlineFileRequest::setTransformedURL(const std::string&& url) { - resource.url = std::move(url); - schedule(); -} - -ActorRef OnlineFileRequest::actor() { - if (!mailbox) { - // Lazy constructed because this can be costly and - // the ResourceTransform is not used by many apps. - mailbox = std::make_shared(*Scheduler::GetCurrent()); - } - - return ActorRef(*this, mailbox); -} - -void OnlineFileSource::setMaximumConcurrentRequests(uint32_t maximumConcurrentRequests_) { - impl->setMaximumConcurrentRequests(maximumConcurrentRequests_); -} - -uint32_t OnlineFileSource::getMaximumConcurrentRequests() const { - return impl->getMaximumConcurrentRequests(); -} - - -// For testing only: - -void OnlineFileSource::setOnlineStatus(const bool status) { - impl->setOnlineStatus(status); -} - -} // namespace mbgl diff --git a/platform/default/png_reader.cpp b/platform/default/png_reader.cpp deleted file mode 100644 index 4d4ee29d1f..0000000000 --- a/platform/default/png_reader.cpp +++ /dev/null @@ -1,142 +0,0 @@ -#include -#include -#include -#include - -#include -#include - -extern "C" -{ -#include -} - -template -static std::string sprintf(const char *msg, Args... args) { - char res[max]; - int len = snprintf(res, sizeof(res), msg, args...); - return std::string(res, len); -} - -const static bool png_version_check __attribute__((unused)) = []() { - const png_uint_32 version = png_access_version_number(); - if (version != PNG_LIBPNG_VER) { - throw std::runtime_error(sprintf<96>( - "libpng version mismatch: headers report %d.%d.%d, but library reports %d.%d.%d", - PNG_LIBPNG_VER / 10000, (PNG_LIBPNG_VER / 100) % 100, PNG_LIBPNG_VER % 100, - version / 10000, (version / 100) % 100, version % 100)); - } - return true; -}(); - -namespace mbgl { - -static void user_error_fn(png_structp, png_const_charp error_msg) { - throw std::runtime_error(std::string("failed to read invalid png: '") + error_msg + "'"); -} - -static void user_warning_fn(png_structp, png_const_charp warning_msg) { - Log::Warning(Event::Image, "ImageReader (PNG): %s", warning_msg); -} - -static void png_read_data(png_structp png_ptr, png_bytep data, png_size_t length) { - auto* fin = reinterpret_cast(png_get_io_ptr(png_ptr)); - fin->read(reinterpret_cast(data), length); - std::streamsize read_count = fin->gcount(); - if (read_count < 0 || static_cast(read_count) != length) - { - png_error(png_ptr, "Read Error"); - } -} - -struct png_struct_guard { - png_struct_guard(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr) - : p_(png_ptr_ptr), - i_(info_ptr_ptr) {} - - ~png_struct_guard() { - png_destroy_read_struct(p_,i_,nullptr); - } - - png_structpp p_; - png_infopp i_; -}; - -PremultipliedImage decodePNG(const uint8_t* data, size_t size) { - util::CharArrayBuffer dataBuffer { reinterpret_cast(data), size }; - std::istream stream(&dataBuffer); - - png_byte header[8] = { 0 }; - stream.read(reinterpret_cast(header), 8); - if (stream.gcount() != 8) - throw std::runtime_error("PNG reader: Could not read image"); - - int is_png = !png_sig_cmp(header, 0, 8); - if (!is_png) - throw std::runtime_error("File or stream is not a png"); - - png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr); - if (!png_ptr) - throw std::runtime_error("failed to allocate png_ptr"); - - // catch errors in a custom way to avoid the need for setjmp - png_set_error_fn(png_ptr, png_get_error_ptr(png_ptr), user_error_fn, user_warning_fn); - - png_infop info_ptr; - png_struct_guard sguard(&png_ptr, &info_ptr); - info_ptr = png_create_info_struct(png_ptr); - if (!info_ptr) - throw std::runtime_error("failed to create info_ptr"); - - png_set_read_fn(png_ptr, &stream, png_read_data); - png_set_sig_bytes(png_ptr, 8); - png_read_info(png_ptr, info_ptr); - - png_uint_32 width = 0; - png_uint_32 height = 0; - int bit_depth = 0; - int color_type = 0; - png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, nullptr, nullptr, nullptr); - - UnassociatedImage image({ static_cast(width), static_cast(height) }); - - if (color_type == PNG_COLOR_TYPE_PALETTE) - png_set_expand(png_ptr); - - if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) - png_set_expand(png_ptr); - - if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) - png_set_expand(png_ptr); - - if (bit_depth == 16) - png_set_strip_16(png_ptr); - - if (color_type == PNG_COLOR_TYPE_GRAY || - color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - png_set_gray_to_rgb(png_ptr); - - png_set_add_alpha(png_ptr, 0xff, PNG_FILLER_AFTER); - - if (png_get_interlace_type(png_ptr,info_ptr) == PNG_INTERLACE_ADAM7) { - png_set_interlace_handling(png_ptr); // FIXME: libpng bug? - // according to docs png_read_image - // "..automatically handles interlacing, - // so you don't need to call png_set_interlace_handling()" - } - - png_read_update_info(png_ptr, info_ptr); - - // we can read whole image at once - // alloc row pointers - const std::unique_ptr rows(new png_bytep[height]); - for (unsigned row = 0; row < height; ++row) - rows[row] = image.data.get() + row * width * 4; - png_read_image(png_ptr, rows.get()); - - png_read_end(png_ptr, nullptr); - - return util::premultiply(std::move(image)); -} - -} // namespace mbgl diff --git a/platform/default/png_writer.cpp b/platform/default/png_writer.cpp deleted file mode 100644 index b89e253f85..0000000000 --- a/platform/default/png_writer.cpp +++ /dev/null @@ -1,77 +0,0 @@ -#include -#include -#include - -#include - -#include -#include - -#define NETWORK_BYTE_UINT32(value) \ - char(value >> 24), char(value >> 16), char(value >> 8), char(value >> 0) - -namespace { - -void addChunk(std::string& png, const char* type, const char* data = "", const uint32_t size = 0) { - assert(strlen(type) == 4); - - // Checksum encompasses type + data - boost::crc_32_type checksum; - checksum.process_bytes(type, 4); - checksum.process_bytes(data, size); - - const char length[4] = { NETWORK_BYTE_UINT32(size) }; - const char crc[4] = { NETWORK_BYTE_UINT32(checksum.checksum()) }; - - png.reserve(png.size() + 4 /* length */ + 4 /* type */ + size + 4 /* CRC */); - png.append(length, 4); - png.append(type, 4); - png.append(data, size); - png.append(crc, 4); -} - -} // namespace - -namespace mbgl { - -// Encode PNGs without libpng. -std::string encodePNG(const PremultipliedImage& pre) { - // Make copy of the image so that we can unpremultiply it. - const auto src = util::unpremultiply(pre.clone()); - - // PNG magic bytes - const char preamble[8] = { char(0x89), 'P', 'N', 'G', '\r', '\n', 0x1a, '\n' }; - - // IHDR chunk for our RGBA image. - const char ihdr[13] = { - NETWORK_BYTE_UINT32(src.size.width), // width - NETWORK_BYTE_UINT32(src.size.height), // height - 8, // bit depth == 8 bits - 6, // color type == RGBA - 0, // compression method == deflate - 0, // filter method == default - 0, // interlace method == none - }; - - // Prepare the (compressed) data chunk. - const auto stride = src.stride(); - std::string idat; - for (uint32_t y = 0; y < src.size.height; y++) { - // Every scanline needs to be prefixed with one byte that indicates the filter type. - idat.append(1, 0); // filter type 0 - idat.append((const char*)(src.data.get() + y * stride), stride); - } - idat = util::compress(idat); - - // Assemble the PNG. - std::string png; - png.reserve((8 /* preamble */) + (12 + 13 /* IHDR */) + - (12 + idat.size() /* IDAT */) + (12 /* IEND */)); - png.append(preamble, 8); - addChunk(png, "IHDR", ihdr, 13); - addChunk(png, "IDAT", idat.data(), static_cast(idat.size())); - addChunk(png, "IEND"); - return png; -} - -} // namespace mbgl diff --git a/platform/default/run_loop.cpp b/platform/default/run_loop.cpp deleted file mode 100644 index 868ee72114..0000000000 --- a/platform/default/run_loop.cpp +++ /dev/null @@ -1,219 +0,0 @@ -#include -#include -#include -#include - -#include - -#include -#include -#include - -namespace { - -void dummyCallback(uv_async_t*) {} - -} // namespace - -namespace mbgl { -namespace util { - -struct Watch { - static void onEvent(uv_poll_t* poll, int, int event) { - auto watch = reinterpret_cast(poll->data); - - RunLoop::Event watchEvent = RunLoop::Event::None; - switch (event) { - case UV_READABLE: - watchEvent = RunLoop::Event::Read; - break; - case UV_WRITABLE: - watchEvent = RunLoop::Event::Write; - break; - case UV_READABLE | UV_WRITABLE: - watchEvent = RunLoop::Event::ReadWrite; - break; - } - - watch->eventCallback(watch->fd, watchEvent); - }; - - static void onClose(uv_handle_t *poll) { - auto watch = reinterpret_cast(poll->data); - watch->closeCallback(); - }; - - uv_poll_t poll; - int fd; - - std::function eventCallback; - std::function closeCallback; -}; - -RunLoop* RunLoop::Get() { - assert(static_cast(Scheduler::GetCurrent())); - return static_cast(Scheduler::GetCurrent()); -} - -class RunLoop::Impl { -public: - void closeHolder() { - uv_close(holderHandle(), [](uv_handle_t* h) { - delete reinterpret_cast(h); - }); - } - - uv_handle_t* holderHandle() { - return reinterpret_cast(holder); - } - - uv_loop_t *loop = nullptr; - uv_async_t* holder = new uv_async_t; - - RunLoop::Type type; - std::unique_ptr async; - - std::unordered_map> watchPoll; -}; - -RunLoop::RunLoop(Type type) : impl(std::make_unique()) { - switch (type) { - case Type::New: - impl->loop = new uv_loop_t; - if (uv_loop_init(impl->loop) != 0) { - throw std::runtime_error("Failed to initialize loop."); - } - break; - case Type::Default: - impl->loop = uv_default_loop(); - break; - } - - // Just for holding a ref to the main loop and keep - // it alive as required by libuv. - if (uv_async_init(impl->loop, impl->holder, dummyCallback) != 0) { - throw std::runtime_error("Failed to initialize async."); - } - - impl->type = type; - - Scheduler::SetCurrent(this); - impl->async = std::make_unique(std::bind(&RunLoop::process, this)); -} - -RunLoop::~RunLoop() { - Scheduler::SetCurrent(nullptr); - - // Close the dummy handle that we have - // just to keep the main loop alive. - impl->closeHolder(); - - if (impl->type == Type::Default) { - return; - } - - // Run the loop again to ensure that async - // close callbacks have been called. Not needed - // for the default main loop because it is only - // closed when the application exits. - impl->async.reset(); - runOnce(); - - if (uv_loop_close(impl->loop) == UV_EBUSY) { - assert(false && "Failed to close loop."); - } - delete impl->loop; -} - -LOOP_HANDLE RunLoop::getLoopHandle() { - return Get()->impl->loop; -} - -void RunLoop::wake() { - impl->async->send(); -} - -void RunLoop::run() { - MBGL_VERIFY_THREAD(tid); - - uv_ref(impl->holderHandle()); - uv_run(impl->loop, UV_RUN_DEFAULT); -} - -void RunLoop::runOnce() { - MBGL_VERIFY_THREAD(tid); - - uv_run(impl->loop, UV_RUN_NOWAIT); -} - -void RunLoop::stop() { - invoke([&] { uv_unref(impl->holderHandle()); }); -} - -void RunLoop::addWatch(int fd, Event event, std::function&& callback) { - MBGL_VERIFY_THREAD(tid); - - Watch *watch = nullptr; - auto watchPollIter = impl->watchPoll.find(fd); - - if (watchPollIter == impl->watchPoll.end()) { - std::unique_ptr watchPtr = std::make_unique(); - - watch = watchPtr.get(); - impl->watchPoll[fd] = std::move(watchPtr); - - if (uv_poll_init(impl->loop, &watch->poll, fd)) { - throw std::runtime_error("Failed to init poll on file descriptor."); - } - } else { - watch = watchPollIter->second.get(); - } - - watch->poll.data = watch; - watch->fd = fd; - watch->eventCallback = std::move(callback); - - int pollEvent = 0; - switch (event) { - case Event::Read: - pollEvent = UV_READABLE; - break; - case Event::Write: - pollEvent = UV_WRITABLE; - break; - case Event::ReadWrite: - pollEvent = UV_READABLE | UV_WRITABLE; - break; - default: - throw std::runtime_error("Unhandled event."); - } - - if (uv_poll_start(&watch->poll, pollEvent, &Watch::onEvent)) { - throw std::runtime_error("Failed to start poll on file descriptor."); - } -} - -void RunLoop::removeWatch(int fd) { - MBGL_VERIFY_THREAD(tid); - - auto watchPollIter = impl->watchPoll.find(fd); - if (watchPollIter == impl->watchPoll.end()) { - return; - } - - Watch* watch = watchPollIter->second.release(); - impl->watchPoll.erase(watchPollIter); - - watch->closeCallback = [watch] { - delete watch; - }; - - if (uv_poll_stop(&watch->poll)) { - throw std::runtime_error("Failed to stop poll on file descriptor."); - } - - uv_close(reinterpret_cast(&watch->poll), &Watch::onClose); -} - -} // namespace util -} // namespace mbgl diff --git a/platform/default/sqlite3.cpp b/platform/default/sqlite3.cpp deleted file mode 100644 index f8a7daefe6..0000000000 --- a/platform/default/sqlite3.cpp +++ /dev/null @@ -1,494 +0,0 @@ -#include "sqlite3.hpp" -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - -namespace mapbox { -namespace sqlite { - -static_assert(mbgl::underlying_type(ResultCode::OK) == SQLITE_OK, "error"); -static_assert(mbgl::underlying_type(ResultCode::Error) == SQLITE_ERROR, "error"); -static_assert(mbgl::underlying_type(ResultCode::Internal) == SQLITE_INTERNAL, "error"); -static_assert(mbgl::underlying_type(ResultCode::Perm) == SQLITE_PERM, "error"); -static_assert(mbgl::underlying_type(ResultCode::Abort) == SQLITE_ABORT, "error"); -static_assert(mbgl::underlying_type(ResultCode::Busy) == SQLITE_BUSY, "error"); -static_assert(mbgl::underlying_type(ResultCode::Locked) == SQLITE_LOCKED, "error"); -static_assert(mbgl::underlying_type(ResultCode::NoMem) == SQLITE_NOMEM, "error"); -static_assert(mbgl::underlying_type(ResultCode::ReadOnly) == SQLITE_READONLY, "error"); -static_assert(mbgl::underlying_type(ResultCode::Interrupt) == SQLITE_INTERRUPT, "error"); -static_assert(mbgl::underlying_type(ResultCode::IOErr) == SQLITE_IOERR, "error"); -static_assert(mbgl::underlying_type(ResultCode::Corrupt) == SQLITE_CORRUPT, "error"); -static_assert(mbgl::underlying_type(ResultCode::NotFound) == SQLITE_NOTFOUND, "error"); -static_assert(mbgl::underlying_type(ResultCode::Full) == SQLITE_FULL, "error"); -static_assert(mbgl::underlying_type(ResultCode::CantOpen) == SQLITE_CANTOPEN, "error"); -static_assert(mbgl::underlying_type(ResultCode::Protocol) == SQLITE_PROTOCOL, "error"); -static_assert(mbgl::underlying_type(ResultCode::Schema) == SQLITE_SCHEMA, "error"); -static_assert(mbgl::underlying_type(ResultCode::TooBig) == SQLITE_TOOBIG, "error"); -static_assert(mbgl::underlying_type(ResultCode::Constraint) == SQLITE_CONSTRAINT, "error"); -static_assert(mbgl::underlying_type(ResultCode::Mismatch) == SQLITE_MISMATCH, "error"); -static_assert(mbgl::underlying_type(ResultCode::Misuse) == SQLITE_MISUSE, "error"); -static_assert(mbgl::underlying_type(ResultCode::NoLFS) == SQLITE_NOLFS, "error"); -static_assert(mbgl::underlying_type(ResultCode::Auth) == SQLITE_AUTH, "error"); -static_assert(mbgl::underlying_type(ResultCode::Range) == SQLITE_RANGE, "error"); -static_assert(mbgl::underlying_type(ResultCode::NotADB) == SQLITE_NOTADB, "error"); - -void setTempPath(const std::string& path) { - sqlite3_temp_directory = sqlite3_mprintf("%s", path.c_str()); -} - -class DatabaseImpl { -public: - DatabaseImpl(sqlite3* db_) - : db(db_) - { - const int error = sqlite3_extended_result_codes(db, true); - if (error != SQLITE_OK) { - mbgl::Log::Warning(mbgl::Event::Database, error, "Failed to enable extended result codes: %s", sqlite3_errmsg(db)); - } - } - - ~DatabaseImpl() - { - const int error = sqlite3_close(db); - if (error != SQLITE_OK) { - mbgl::Log::Error(mbgl::Event::Database, error, "Failed to close database: %s", sqlite3_errmsg(db)); - } - } - - void setBusyTimeout(std::chrono::milliseconds timeout); - void exec(const std::string& sql); - - sqlite3* db; -}; - -class StatementImpl { -public: - StatementImpl(sqlite3* db, const char* sql) - { - const int error = sqlite3_prepare_v2(db, sql, -1, &stmt, nullptr); - if (error != SQLITE_OK) { - stmt = nullptr; - throw Exception { error, sqlite3_errmsg(db) }; - } - } - - ~StatementImpl() - { - if (!stmt) return; - - sqlite3_finalize(stmt); - } - - void check(int err) { - if (err != SQLITE_OK) { - throw Exception { err, sqlite3_errmsg(sqlite3_db_handle(stmt)) }; - } - } - - sqlite3_stmt* stmt = nullptr; - int64_t lastInsertRowId = 0; - int64_t changes = 0; -}; - -template -using optional = std::experimental::optional; - - -#ifndef NDEBUG -void logSqlMessage(void *, const int err, const char *msg) { - mbgl::Log::Record(mbgl::EventSeverity::Debug, mbgl::Event::Database, err, "%s", msg); -} -#endif - -__attribute__((constructor)) -static void initalize() { - if (sqlite3_libversion_number() / 1000000 != SQLITE_VERSION_NUMBER / 1000000) { - char message[96]; - snprintf(message, 96, - "sqlite3 libversion mismatch: headers report %d, but library reports %d", - SQLITE_VERSION_NUMBER, sqlite3_libversion_number()); - throw std::runtime_error(message); - } - -#ifndef NDEBUG - // Enable SQLite logging before initializing the database. - sqlite3_config(SQLITE_CONFIG_LOG, &logSqlMessage, nullptr); -#endif -} - -mapbox::util::variant Database::tryOpen(const std::string &filename, int flags) { - sqlite3* db = nullptr; - const int error = sqlite3_open_v2(filename.c_str(), &db, flags | SQLITE_OPEN_URI, nullptr); - if (error != SQLITE_OK) { - const auto message = sqlite3_errmsg(db); - return Exception { error, message }; - } - return Database(std::make_unique(db)); -} - -Database Database::open(const std::string &filename, int flags) { - auto result = tryOpen(filename, flags); - if (result.is()) { - throw result.get(); - } else { - return std::move(result.get()); - } -} - -Database::Database(std::unique_ptr impl_) - : impl(std::move(impl_)) -{} - -Database::Database(Database &&other) - : impl(std::move(other.impl)) {} - -Database &Database::operator=(Database &&other) { - std::swap(impl, other.impl); - return *this; -} - -Database::~Database() = default; - -void Database::setBusyTimeout(std::chrono::milliseconds timeout) { - assert(impl); - impl->setBusyTimeout(timeout); -} - -void DatabaseImpl::setBusyTimeout(std::chrono::milliseconds timeout) { - const int err = sqlite3_busy_timeout(db, - int(std::min(timeout.count(), std::numeric_limits::max()))); - if (err != SQLITE_OK) { - throw Exception { err, sqlite3_errmsg(db) }; - } -} - -void Database::exec(const std::string &sql) { - assert(impl); - impl->exec(sql); -} - -void DatabaseImpl::exec(const std::string& sql) { - char *msg = nullptr; - const int err = sqlite3_exec(db, sql.c_str(), nullptr, nullptr, &msg); - if (msg) { - const std::string message = msg; - sqlite3_free(msg); - throw Exception { err, message }; - } else if (err != SQLITE_OK) { - throw Exception { err, sqlite3_errmsg(db) }; - } -} - -Statement::Statement(Database& db, const char* sql) - : impl(std::make_unique(db.impl->db, sql)) { -} - -Statement::~Statement() { -#ifndef NDEBUG - // Crash if we're destructing this object while we know a Query object references this. - assert(!used); -#endif -} - -Query::Query(Statement& stmt_) : stmt(stmt_) { - assert(stmt.impl); - -#ifndef NDEBUG - assert(!stmt.used); - stmt.used = true; -#endif -} - -Query::~Query() { - reset(); - clearBindings(); - -#ifndef NDEBUG - stmt.used = false; -#endif -} - -template <> void Query::bind(int offset, std::nullptr_t) { - assert(stmt.impl); - stmt.impl->check(sqlite3_bind_null(stmt.impl->stmt, offset)); -} - -template <> void Query::bind(int offset, int8_t value) { - assert(stmt.impl); - stmt.impl->check(sqlite3_bind_int64(stmt.impl->stmt, offset, value)); -} - -template <> void Query::bind(int offset, int16_t value) { - assert(stmt.impl); - stmt.impl->check(sqlite3_bind_int64(stmt.impl->stmt, offset, value)); -} - -template <> void Query::bind(int offset, int32_t value) { - assert(stmt.impl); - stmt.impl->check(sqlite3_bind_int64(stmt.impl->stmt, offset, value)); -} - -template <> void Query::bind(int offset, int64_t value) { - assert(stmt.impl); - stmt.impl->check(sqlite3_bind_int64(stmt.impl->stmt, offset, value)); -} - -template <> void Query::bind(int offset, uint8_t value) { - assert(stmt.impl); - stmt.impl->check(sqlite3_bind_int64(stmt.impl->stmt, offset, value)); -} - -template <> void Query::bind(int offset, uint16_t value) { - assert(stmt.impl); - stmt.impl->check(sqlite3_bind_int64(stmt.impl->stmt, offset, value)); -} - -template <> void Query::bind(int offset, uint32_t value) { - assert(stmt.impl); - stmt.impl->check(sqlite3_bind_int64(stmt.impl->stmt, offset, value)); -} - -template <> void Query::bind(int offset, float value) { - assert(stmt.impl); - stmt.impl->check(sqlite3_bind_double(stmt.impl->stmt, offset, value)); -} - -template <> void Query::bind(int offset, double value) { - assert(stmt.impl); - stmt.impl->check(sqlite3_bind_double(stmt.impl->stmt, offset, value)); -} - -template <> void Query::bind(int offset, bool value) { - assert(stmt.impl); - stmt.impl->check(sqlite3_bind_int(stmt.impl->stmt, offset, value)); -} - -template <> void Query::bind(int offset, const char *value) { - assert(stmt.impl); - stmt.impl->check(sqlite3_bind_text(stmt.impl->stmt, offset, value, -1, SQLITE_STATIC)); -} - -// We currently cannot use sqlite3_bind_blob64 / sqlite3_bind_text64 because they -// were introduced in SQLite 3.8.7, and we need to support earlier versions: -// Android 11: 3.7 -// Android 21: 3.8 -// Android 24: 3.9 -// Per https://developer.android.com/reference/android/database/sqlite/package-summary. -// The first iOS version with 3.8.7+ was 9.0, with 3.8.8. - -void Query::bind(int offset, const char * value, std::size_t length, bool retain) { - assert(stmt.impl); - if (length > std::numeric_limits::max()) { - throw std::range_error("value too long for sqlite3_bind_text"); - } - stmt.impl->check(sqlite3_bind_text(stmt.impl->stmt, offset, value, int(length), - retain ? SQLITE_TRANSIENT : SQLITE_STATIC)); -} - -void Query::bind(int offset, const std::string& value, bool retain) { - bind(offset, value.data(), value.size(), retain); -} - -void Query::bindBlob(int offset, const void * value, std::size_t length, bool retain) { - assert(stmt.impl); - if (length > std::numeric_limits::max()) { - throw std::range_error("value too long for sqlite3_bind_text"); - } - stmt.impl->check(sqlite3_bind_blob(stmt.impl->stmt, offset, value, int(length), - retain ? SQLITE_TRANSIENT : SQLITE_STATIC)); -} - -void Query::bindBlob(int offset, const std::vector& value, bool retain) { - bindBlob(offset, value.data(), value.size(), retain); -} - -template <> -void Query::bind( - int offset, std::chrono::time_point value) { - assert(stmt.impl); - stmt.impl->check(sqlite3_bind_int64(stmt.impl->stmt, offset, std::chrono::system_clock::to_time_t(value))); -} - -template <> void Query::bind(int offset, optional value) { - if (!value) { - bind(offset, nullptr); - } else { - bind(offset, *value); - } -} - -template <> -void Query::bind( - int offset, - optional> value) { - if (!value) { - bind(offset, nullptr); - } else { - bind(offset, *value); - } -} - -bool Query::run() { - assert(stmt.impl); - const int err = sqlite3_step(stmt.impl->stmt); - stmt.impl->lastInsertRowId = sqlite3_last_insert_rowid(sqlite3_db_handle(stmt.impl->stmt)); - stmt.impl->changes = sqlite3_changes(sqlite3_db_handle(stmt.impl->stmt)); - if (err == SQLITE_DONE) { - return false; - } else if (err == SQLITE_ROW) { - return true; - } else if (err != SQLITE_OK) { - throw Exception { err, sqlite3_errmsg(sqlite3_db_handle(stmt.impl->stmt)) }; - } else { - return false; - } -} - -template <> bool Query::get(int offset) { - assert(stmt.impl); - return sqlite3_column_int(stmt.impl->stmt, offset); -} - -template <> int Query::get(int offset) { - assert(stmt.impl); - return sqlite3_column_int(stmt.impl->stmt, offset); -} - -template <> int64_t Query::get(int offset) { - assert(stmt.impl); - return sqlite3_column_int64(stmt.impl->stmt, offset); -} - -template <> double Query::get(int offset) { - assert(stmt.impl); - return sqlite3_column_double(stmt.impl->stmt, offset); -} - -template <> std::string Query::get(int offset) { - assert(stmt.impl); - return { - reinterpret_cast(sqlite3_column_blob(stmt.impl->stmt, offset)), - size_t(sqlite3_column_bytes(stmt.impl->stmt, offset)) - }; -} - -template <> std::vector Query::get(int offset) { - assert(stmt.impl); - const auto* begin = reinterpret_cast(sqlite3_column_blob(stmt.impl->stmt, offset)); - const uint8_t* end = begin + sqlite3_column_bytes(stmt.impl->stmt, offset); - return { begin, end }; -} - -template <> -std::chrono::time_point -Query::get(int offset) { - assert(stmt.impl); - return std::chrono::time_point_cast( - std::chrono::system_clock::from_time_t(sqlite3_column_int64(stmt.impl->stmt, offset))); -} - -template <> optional Query::get(int offset) { - assert(stmt.impl); - if (sqlite3_column_type(stmt.impl->stmt, offset) == SQLITE_NULL) { - return optional(); - } else { - return get(offset); - } -} - -template <> optional Query::get(int offset) { - assert(stmt.impl); - if (sqlite3_column_type(stmt.impl->stmt, offset) == SQLITE_NULL) { - return optional(); - } else { - return get(offset); - } -} - -template <> optional Query::get(int offset) { - assert(stmt.impl); - if (sqlite3_column_type(stmt.impl->stmt, offset) == SQLITE_NULL) { - return optional(); - } else { - return get(offset); - } -} - -template <> -optional> -Query::get(int offset) { - assert(stmt.impl); - if (sqlite3_column_type(stmt.impl->stmt, offset) == SQLITE_NULL) { - return {}; - } else { - return get>( - offset); - } -} - -void Query::reset() { - assert(stmt.impl); - sqlite3_reset(stmt.impl->stmt); -} - -void Query::clearBindings() { - assert(stmt.impl); - sqlite3_clear_bindings(stmt.impl->stmt); -} - -int64_t Query::lastInsertRowId() const { - assert(stmt.impl); - return stmt.impl->lastInsertRowId; -} - -uint64_t Query::changes() const { - assert(stmt.impl); - auto changes_ = stmt.impl->changes; - return (changes_ < 0 ? 0 : changes_); -} - -Transaction::Transaction(Database& db_, Mode mode) - : dbImpl(*db_.impl) { - switch (mode) { - case Deferred: - dbImpl.exec("BEGIN DEFERRED TRANSACTION"); - break; - case Immediate: - dbImpl.exec("BEGIN IMMEDIATE TRANSACTION"); - break; - case Exclusive: - dbImpl.exec("BEGIN EXCLUSIVE TRANSACTION"); - break; - } -} - -Transaction::~Transaction() { - if (needRollback) { - try { - rollback(); - } catch (...) { - // Ignore failed rollbacks in destructor. - } - } -} - -void Transaction::commit() { - needRollback = false; - dbImpl.exec("COMMIT TRANSACTION"); -} - -void Transaction::rollback() { - needRollback = false; - dbImpl.exec("ROLLBACK TRANSACTION"); -} - -} // namespace sqlite -} // namespace mapbox diff --git a/platform/default/sqlite3.hpp b/platform/default/sqlite3.hpp deleted file mode 100644 index 33f735d904..0000000000 --- a/platform/default/sqlite3.hpp +++ /dev/null @@ -1,181 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include - -namespace mapbox { -namespace sqlite { - -enum OpenFlag : int { - ReadOnly = 0b001, - ReadWriteCreate = 0b110, -}; - -enum class ResultCode : uint8_t { - OK = 0, - Error = 1, - Internal = 2, - Perm = 3, - Abort = 4, - Busy = 5, - Locked = 6, - NoMem = 7, - ReadOnly = 8, - Interrupt = 9, - IOErr = 10, - Corrupt = 11, - NotFound = 12, - Full = 13, - CantOpen = 14, - Protocol = 15, - Schema = 17, - TooBig = 18, - Constraint = 19, - Mismatch = 20, - Misuse = 21, - NoLFS = 22, - Auth = 23, - Range = 25, - NotADB = 26, -}; - -enum class ExtendedResultCode : uint8_t { - Unknown = 0, - ReadOnlyDBMoved = 4, -}; - -class Exception : public std::runtime_error { -public: - Exception(ResultCode err, const char* msg) : Exception(static_cast(err), msg) {} - Exception(int err, const char* msg) : Exception(err, std::string{ msg }) {} - Exception(int err, const std::string& msg) - : std::runtime_error(msg), - code(static_cast(err)), - extendedCode(static_cast(err >> 8)) { - } - const ResultCode code = ResultCode::OK; - const ExtendedResultCode extendedCode = ExtendedResultCode::Unknown; -}; - -class DatabaseImpl; -class Statement; -class StatementImpl; -class Query; -class Transaction; - -void setTempPath(const std::string&); - -class Database { -private: - Database(std::unique_ptr); - Database(const Database &) = delete; - Database &operator=(const Database &) = delete; - -public: - static mapbox::util::variant tryOpen(const std::string &filename, int flags = 0); - static Database open(const std::string &filename, int flags = 0); - - Database(Database &&); - ~Database(); - Database &operator=(Database &&); - - void setBusyTimeout(std::chrono::milliseconds); - void exec(const std::string &sql); - -private: - std::unique_ptr impl; - - friend class Statement; - friend class Transaction; -}; - -// A Statement object represents a prepared statement that can be run repeatedly run with a Query object. -class Statement { -public: - Statement(Database& db, const char* sql); - Statement(const Statement&) = delete; - Statement(Statement&&) = delete; - Statement& operator=(const Statement&) = delete; - Statement& operator=(Statement&&) = delete; - ~Statement(); - - friend class Query; - -private: - std::unique_ptr impl; - -#ifndef NDEBUG - // This flag stores whether there exists a Query object that uses this prepared statement. - // There may only be one Query object at a time. Statement objects must outlive Query objects. - // While a Query object exists, a Statement object may not be moved or deleted. - bool used = false; -#endif -}; - -// A Query object is used to run a database query with a prepared statement (stored in a Statement -// object). There may only exist one Query object per Statement object. Query objects are designed -// to be constructed and destroyed frequently. -class Query { -public: - Query(Statement&); - Query(const Query&) = delete; - Query(Query&&) = delete; - Query& operator=(const Query&) = delete; - Query& operator=(Query&&) = delete; - ~Query(); - - template - void bind(int offset, T value); - - // Text - void bind(int offset, const char*, std::size_t length, bool retain = true); - void bind(int offset, const std::string&, bool retain = true); - - // Blob - void bindBlob(int offset, const void*, std::size_t length, bool retain = true); - void bindBlob(int offset, const std::vector&, bool retain = true); - - template - T get(int offset); - - bool run(); - void reset(); - void clearBindings(); - - int64_t lastInsertRowId() const; - uint64_t changes() const; - -private: - Statement& stmt; -}; - -class Transaction { -private: - Transaction(const Transaction&) = delete; - Transaction(Transaction&&) = delete; - Transaction& operator=(const Transaction&) = delete; - -public: - enum Mode { - Deferred, - Immediate, - Exclusive - }; - - Transaction(Database&, Mode = Deferred); - ~Transaction(); - - void commit(); - void rollback(); - -private: - DatabaseImpl& dbImpl; - bool needRollback = true; -}; - -} -} diff --git a/platform/default/src/mbgl/gl/headless_backend.cpp b/platform/default/src/mbgl/gl/headless_backend.cpp new file mode 100644 index 0000000000..ba08aecab7 --- /dev/null +++ b/platform/default/src/mbgl/gl/headless_backend.cpp @@ -0,0 +1,85 @@ +#include +#include +#include + +#include +#include +#include + +namespace mbgl { + +class HeadlessBackend::View { +public: + View(gl::Context& context, Size size_) + : color(context.createRenderbuffer(size_)), + depthStencil(context.createRenderbuffer(size_)), + framebuffer(context.createFramebuffer(color, depthStencil)) { + } + + gl::Renderbuffer color; + gl::Renderbuffer depthStencil; + gl::Framebuffer framebuffer; +}; + +HeadlessBackend::HeadlessBackend(Size size_) + : size(size_) { +} + +HeadlessBackend::~HeadlessBackend() { + BackendScope guard { *this }; + view.reset(); + context.reset(); +} + +gl::ProcAddress HeadlessBackend::getExtensionFunctionPointer(const char* name) { + assert(impl); + return impl->getExtensionFunctionPointer(name); +} + +void HeadlessBackend::activate() { + active = true; + + if (!impl) { + createImpl(); + } + + assert(impl); + impl->activateContext(); +} + +void HeadlessBackend::deactivate() { + assert(impl); + impl->deactivateContext(); + active = false; +} + +void HeadlessBackend::bind() { + gl::Context& context_ = getContext(); + + if (!view) { + view = std::make_unique(context_, size); + } + + context_.bindFramebuffer = view->framebuffer.framebuffer; + context_.scissorTest = false; + context_.viewport = { 0, 0, size }; +} + +Size HeadlessBackend::getFramebufferSize() const { + return size; +} + +void HeadlessBackend::updateAssumedState() { + // no-op +} + +void HeadlessBackend::setSize(Size size_) { + size = size_; + view.reset(); +} + +PremultipliedImage HeadlessBackend::readStillImage() { + return getContext().readFramebuffer(size); +} + +} // namespace mbgl diff --git a/platform/default/src/mbgl/gl/headless_backend_osmesa.cpp b/platform/default/src/mbgl/gl/headless_backend_osmesa.cpp new file mode 100644 index 0000000000..0da1caf9af --- /dev/null +++ b/platform/default/src/mbgl/gl/headless_backend_osmesa.cpp @@ -0,0 +1,47 @@ +#include +#include + +#include + +#include + +namespace mbgl { + +class OSMesaBackendImpl : public HeadlessBackend::Impl { +public: + OSMesaBackendImpl() { +#if OSMESA_MAJOR_VERSION * 100 + OSMESA_MINOR_VERSION >= 305 + glContext = OSMesaCreateContextExt(OSMESA_RGBA, 16, 0, 0, nullptr); +#else + glContext = OSMesaCreateContext(OSMESA_RGBA, nullptr); +#endif + if (glContext == nullptr) { + throw std::runtime_error("Error creating GL context object."); + } + } + + ~OSMesaBackendImpl() final { + OSMesaDestroyContext(glContext); + } + + gl::ProcAddress getExtensionFunctionPointer(const char* name) final { + return OSMesaGetProcAddress(name); + } + + void activateContext() final { + if (!OSMesaMakeCurrent(glContext, &fakeBuffer, GL_UNSIGNED_BYTE, 1, 1)) { + throw std::runtime_error("Switching OpenGL context failed.\n"); + } + } + +private: + OSMesaContext glContext = nullptr; + GLubyte fakeBuffer = 0; +}; + +void HeadlessBackend::createImpl() { + assert(!impl); + impl = std::make_unique(); +} + +} // namespace mbgl diff --git a/platform/default/src/mbgl/gl/headless_frontend.cpp b/platform/default/src/mbgl/gl/headless_frontend.cpp new file mode 100644 index 0000000000..37b0f91f32 --- /dev/null +++ b/platform/default/src/mbgl/gl/headless_frontend.cpp @@ -0,0 +1,144 @@ +#include +#include +#include +#include +#include +#include +#include + +namespace mbgl { + +HeadlessFrontend::HeadlessFrontend(float pixelRatio_, FileSource& fileSource, Scheduler& scheduler, const optional programCacheDir, GLContextMode mode, const optional localFontFamily) + : HeadlessFrontend({ 256, 256 }, pixelRatio_, fileSource, scheduler, programCacheDir, mode, localFontFamily) { +} + +HeadlessFrontend::HeadlessFrontend(Size size_, float pixelRatio_, FileSource& fileSource, Scheduler& scheduler, const optional programCacheDir, GLContextMode mode, const optional localFontFamily) + : size(size_), + pixelRatio(pixelRatio_), + backend({ static_cast(size.width * pixelRatio), + static_cast(size.height * pixelRatio) }), + asyncInvalidate([this] { + if (renderer && updateParameters) { + mbgl::BackendScope guard { backend }; + renderer->render(*updateParameters); + } + }), + renderer(std::make_unique(backend, pixelRatio, fileSource, scheduler, mode, programCacheDir, localFontFamily)) { +} + +HeadlessFrontend::~HeadlessFrontend() = default; + +void HeadlessFrontend::reset() { + assert(renderer); + renderer.reset(); +} + +void HeadlessFrontend::update(std::shared_ptr updateParameters_) { + updateParameters = updateParameters_; + asyncInvalidate.send(); +} + +void HeadlessFrontend::setObserver(RendererObserver& observer_) { + assert(renderer); + renderer->setObserver(&observer_); +} + +Size HeadlessFrontend::getSize() const { + return size; +} + +Renderer* HeadlessFrontend::getRenderer() { + assert(renderer); + return renderer.get(); +} + +RendererBackend* HeadlessFrontend::getBackend() { + return &backend; +} + +CameraOptions HeadlessFrontend::getCameraOptions() { + if (updateParameters) + return RendererState::getCameraOptions(*updateParameters); + + static CameraOptions nullCamera; + return nullCamera; +} + +bool HeadlessFrontend::hasImage(const std::string& id) { + if (updateParameters) { + return RendererState::hasImage(*updateParameters, id); + } + + return false; +} + +bool HeadlessFrontend::hasLayer(const std::string& id) { + if (updateParameters) { + return RendererState::hasLayer(*updateParameters, id); + } + + return false; +} + +bool HeadlessFrontend::hasSource(const std::string& id) { + if (updateParameters) { + return RendererState::hasSource(*updateParameters, id); + } + + return false; +} +ScreenCoordinate HeadlessFrontend::pixelForLatLng(const LatLng& coordinate) { + if (updateParameters) { + return RendererState::pixelForLatLng(*updateParameters, coordinate); + } + + return ScreenCoordinate {}; +} + +LatLng HeadlessFrontend::latLngForPixel(const ScreenCoordinate& point) { + if (updateParameters) { + return RendererState::latLngForPixel(*updateParameters, point); + } + + return LatLng {}; +} + +void HeadlessFrontend::setSize(Size size_) { + if (size != size_) { + size = size_; + backend.setSize({ static_cast(size_.width * pixelRatio), + static_cast(size_.height * pixelRatio) }); + } +} + +PremultipliedImage HeadlessFrontend::readStillImage() { + return backend.readStillImage(); +} + +PremultipliedImage HeadlessFrontend::render(Map& map) { + PremultipliedImage result; + + map.renderStill([&](std::exception_ptr error) { + if (error) { + std::rethrow_exception(error); + } else { + result = backend.readStillImage(); + } + }); + + while (!result.valid()) { + util::RunLoop::Get()->runOnce(); + } + + return result; +} + +optional HeadlessFrontend::getTransformState() const { + if (updateParameters) { + return updateParameters->transformState; + } else { + return {}; + } +} + +} // namespace mbgl diff --git a/platform/default/src/mbgl/layermanager/layer_manager.cpp b/platform/default/src/mbgl/layermanager/layer_manager.cpp new file mode 100644 index 0000000000..05d0f4d1ae --- /dev/null +++ b/platform/default/src/mbgl/layermanager/layer_manager.cpp @@ -0,0 +1,79 @@ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace mbgl { + +class LayerManagerDefault final : public LayerManager { +public: + LayerManagerDefault(); + +private: + void addLayerType(std::unique_ptr); + // LayerManager overrides. + LayerFactory* getFactory(const std::string& type) noexcept final; + LayerFactory* getFactory(const style::LayerTypeInfo*) noexcept final; + + std::vector> factories; + std::map typeToFactory; +}; + +LayerManagerDefault::LayerManagerDefault() { + addLayerType(std::make_unique()); + addLayerType(std::make_unique()); + addLayerType(std::make_unique()); + addLayerType(std::make_unique()); + addLayerType(std::make_unique()); + addLayerType(std::make_unique()); + addLayerType(std::make_unique()); + addLayerType(std::make_unique()); + addLayerType(std::make_unique()); + addLayerType(std::make_unique()); +} + +void LayerManagerDefault::addLayerType(std::unique_ptr factory) { + std::string type{factory->getTypeInfo()->type}; + if (!type.empty()) { + typeToFactory.emplace(std::make_pair(std::move(type), factory.get())); + } + factories.emplace_back(std::move(factory)); +} + +LayerFactory* LayerManagerDefault::getFactory(const mbgl::style::LayerTypeInfo* typeInfo) noexcept { + assert(typeInfo); + for (const auto& factory: factories) { + if (factory->getTypeInfo() == typeInfo) { + return factory.get(); + } + } + assert(false); + return nullptr; +} + +LayerFactory* LayerManagerDefault::getFactory(const std::string& type) noexcept { + auto search = typeToFactory.find(type); + return (search != typeToFactory.end()) ? search->second : nullptr; +} + +// static +LayerManager* LayerManager::get() noexcept { + static LayerManagerDefault instance; + return &instance; +} + +const bool LayerManager::annotationsEnabled = true; + +} // namespace mbgl diff --git a/platform/default/src/mbgl/map/map_snapshotter.cpp b/platform/default/src/mbgl/map/map_snapshotter.cpp new file mode 100644 index 0000000000..ae14b20721 --- /dev/null +++ b/platform/default/src/mbgl/map/map_snapshotter.cpp @@ -0,0 +1,224 @@ +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace mbgl { + +class MapSnapshotter::Impl { +public: + Impl(FileSource*, + std::shared_ptr, + const std::pair style, + const Size&, + const float pixelRatio, + const optional cameraOptions, + const optional region, + const optional programCacheDir, + const optional localFontFamily = {}); + + void setStyleURL(std::string styleURL); + std::string getStyleURL() const; + + void setStyleJSON(std::string styleJSON); + std::string getStyleJSON() const; + + void setSize(Size); + Size getSize() const; + + void setCameraOptions(CameraOptions); + CameraOptions getCameraOptions() const; + + void setRegion(LatLngBounds); + LatLngBounds getRegion() const; + + void snapshot(ActorRef); + +private: + std::shared_ptr scheduler; + HeadlessFrontend frontend; + Map map; +}; + +MapSnapshotter::Impl::Impl(FileSource* fileSource, + std::shared_ptr scheduler_, + const std::pair style, + const Size& size, + const float pixelRatio, + const optional cameraOptions, + const optional region, + const optional programCacheDir, + const optional localFontFamily) + : scheduler(std::move(scheduler_)) + , frontend(size, pixelRatio, *fileSource, *scheduler, programCacheDir, GLContextMode::Unique, localFontFamily) + , map(frontend, MapObserver::nullObserver(), size, pixelRatio, *fileSource, *scheduler, MapMode::Static) { + + if (style.first) { + map.getStyle().loadJSON(style.second); + } else{ + map.getStyle().loadURL(style.second); + } + + if (cameraOptions) { + map.jumpTo(*cameraOptions); + } + + // Set region, if specified + if (region) { + this->setRegion(*region); + } +} + +void MapSnapshotter::Impl::snapshot(ActorRef callback) { + map.renderStill([this, callback = std::move(callback)] (std::exception_ptr error) mutable { + + // Create lambda that captures the current transform state + // and can be used to translate for geographic to screen + // coordinates + assert (frontend.getTransformState()); + PointForFn pointForFn { [=, center=map.getLatLng(), transformState = *frontend.getTransformState()] (const LatLng& latLng) { + LatLng unwrappedLatLng = latLng.wrapped(); + unwrappedLatLng.unwrapForShortestPath(center); + Transform transform { transformState }; + return transform.latLngToScreenCoordinate(unwrappedLatLng); + }}; + + // Create lambda that captures the current transform state + // and can be used to translate for geographic to screen + // coordinates + assert (frontend.getTransformState()); + LatLngForFn latLngForFn { [=, transformState = *frontend.getTransformState()] (const ScreenCoordinate& screenCoordinate) { + Transform transform { transformState }; + return transform.screenCoordinateToLatLng(screenCoordinate); + }}; + + // Collect all source attributions + std::vector attributions; + for (auto source : map.getStyle().getSources()) { + auto attribution = source->getAttribution(); + if (attribution) { + attributions.push_back(*attribution); + } + } + + // Invoke callback + callback.invoke( + &MapSnapshotter::Callback::operator(), + error, + error ? PremultipliedImage() : frontend.readStillImage(), + std::move(attributions), + std::move(pointForFn), + std::move(latLngForFn) + ); + }); +} + +void MapSnapshotter::Impl::setStyleURL(std::string styleURL) { + map.getStyle().loadURL(styleURL); +} + +std::string MapSnapshotter::Impl::getStyleURL() const { + return map.getStyle().getURL(); +} + +void MapSnapshotter::Impl::setStyleJSON(std::string styleJSON) { + map.getStyle().loadJSON(styleJSON); +} + +std::string MapSnapshotter::Impl::getStyleJSON() const { + return map.getStyle().getJSON(); +} + +void MapSnapshotter::Impl::setSize(Size size) { + map.setSize(size); + frontend.setSize(size); +} + +Size MapSnapshotter::Impl::getSize() const { + return map.getSize(); +} + +void MapSnapshotter::Impl::setCameraOptions(CameraOptions cameraOptions) { + map.jumpTo(cameraOptions); +} + +CameraOptions MapSnapshotter::Impl::getCameraOptions() const { + EdgeInsets insets; + return map.getCameraOptions(insets); +} + +void MapSnapshotter::Impl::setRegion(LatLngBounds region) { + mbgl::EdgeInsets insets = { 0, 0, 0, 0 }; + std::vector latLngs = { region.southwest(), region.northeast() }; + map.jumpTo(map.cameraForLatLngs(latLngs, insets)); +} + +LatLngBounds MapSnapshotter::Impl::getRegion() const { + return map.latLngBoundsForCamera(getCameraOptions()); +} + +MapSnapshotter::MapSnapshotter(FileSource* fileSource, + std::shared_ptr scheduler, + const std::pair style, + const Size& size, + const float pixelRatio, + const optional cameraOptions, + const optional region, + const optional programCacheDir, + const optional localFontFamily) + : impl(std::make_unique>("Map Snapshotter", fileSource, std::move(scheduler), style, size, pixelRatio, cameraOptions, region, programCacheDir, localFontFamily)) { +} + +MapSnapshotter::~MapSnapshotter() = default; + +void MapSnapshotter::snapshot(ActorRef callback) { + impl->actor().invoke(&Impl::snapshot, std::move(callback)); +} + +void MapSnapshotter::setStyleURL(const std::string& styleURL) { + impl->actor().invoke(&Impl::setStyleURL, styleURL); +} + +std::string MapSnapshotter::getStyleURL() const { + return impl->actor().ask(&Impl::getStyleURL).get(); +} + +void MapSnapshotter::setStyleJSON(const std::string& styleJSON) { + impl->actor().invoke(&Impl::setStyleJSON, styleJSON); +} + +std::string MapSnapshotter::getStyleJSON() const { + return impl->actor().ask(&Impl::getStyleJSON).get(); +} + +void MapSnapshotter::setSize(const Size& size) { + impl->actor().invoke(&Impl::setSize, size); +} + +Size MapSnapshotter::getSize() const { + return impl->actor().ask(&Impl::getSize).get(); +} + +void MapSnapshotter::setCameraOptions(const CameraOptions& options) { + impl->actor().invoke(&Impl::setCameraOptions, options); +} + +CameraOptions MapSnapshotter::getCameraOptions() const { + return impl->actor().ask(&Impl::getCameraOptions).get(); +} + +void MapSnapshotter::setRegion(const LatLngBounds& bounds) { + impl->actor().invoke(&Impl::setRegion, std::move(bounds)); +} + +LatLngBounds MapSnapshotter::getRegion() const { + return impl->actor().ask(&Impl::getRegion).get(); +} + +} // namespace mbgl diff --git a/platform/default/src/mbgl/storage/asset_file_source.cpp b/platform/default/src/mbgl/storage/asset_file_source.cpp new file mode 100644 index 0000000000..7988654ae5 --- /dev/null +++ b/platform/default/src/mbgl/storage/asset_file_source.cpp @@ -0,0 +1,81 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace { + +const std::string assetProtocol = "asset://"; + +} // namespace + +namespace mbgl { + +class AssetFileSource::Impl { +public: + Impl(ActorRef, std::string root_) + : root(std::move(root_)) { + } + + void request(const std::string& url, ActorRef req) { + Response response; + + if (!acceptsURL(url)) { + response.error = std::make_unique(Response::Error::Reason::Other, + "Invalid asset URL"); + req.invoke(&FileSourceRequest::setResponse, response); + return; + } + + // Cut off the protocol and prefix with path. + const auto path = root + "/" + mbgl::util::percentDecode(url.substr(assetProtocol.size())); + struct stat buf; + int result = stat(path.c_str(), &buf); + + if (result == 0 && (S_IFDIR & buf.st_mode)) { + response.error = std::make_unique(Response::Error::Reason::NotFound); + } else if (result == -1 && errno == ENOENT) { + response.error = std::make_unique(Response::Error::Reason::NotFound); + } else { + try { + response.data = std::make_shared(util::read_file(path)); + } catch (...) { + response.error = std::make_unique( + Response::Error::Reason::Other, + util::toString(std::current_exception())); + } + } + + req.invoke(&FileSourceRequest::setResponse, response); + } + +private: + std::string root; +}; + +AssetFileSource::AssetFileSource(const std::string& root) + : impl(std::make_unique>("AssetFileSource", root)) { +} + +AssetFileSource::~AssetFileSource() = default; + +std::unique_ptr AssetFileSource::request(const Resource& resource, Callback callback) { + auto req = std::make_unique(std::move(callback)); + + impl->actor().invoke(&Impl::request, resource.url, req->actor()); + + return std::move(req); +} + +bool AssetFileSource::acceptsURL(const std::string& url) { + return 0 == url.rfind(assetProtocol, 0); +} + +} // namespace mbgl diff --git a/platform/default/src/mbgl/storage/default_file_source.cpp b/platform/default/src/mbgl/storage/default_file_source.cpp new file mode 100644 index 0000000000..cad68e7de9 --- /dev/null +++ b/platform/default/src/mbgl/storage/default_file_source.cpp @@ -0,0 +1,316 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +namespace mbgl { + +class DefaultFileSource::Impl { +public: + Impl(std::shared_ptr assetFileSource_, std::string cachePath, uint64_t maximumCacheSize) + : assetFileSource(assetFileSource_) + , localFileSource(std::make_unique()) + , offlineDatabase(std::make_unique(cachePath, maximumCacheSize)) { + } + + void setAPIBaseURL(const std::string& url) { + onlineFileSource.setAPIBaseURL(url); + } + + std::string getAPIBaseURL() const{ + return onlineFileSource.getAPIBaseURL(); + } + + void setAccessToken(const std::string& accessToken) { + onlineFileSource.setAccessToken(accessToken); + } + + std::string getAccessToken() const { + return onlineFileSource.getAccessToken(); + } + + void setResourceTransform(optional>&& transform) { + onlineFileSource.setResourceTransform(std::move(transform)); + } + + void listRegions(std::function)> callback) { + callback(offlineDatabase->listRegions()); + } + + void createRegion(const OfflineRegionDefinition& definition, + const OfflineRegionMetadata& metadata, + std::function)> callback) { + callback(offlineDatabase->createRegion(definition, metadata)); + } + + void mergeOfflineRegions(const std::string& sideDatabasePath, + std::function)> callback) { + callback(offlineDatabase->mergeDatabase(sideDatabasePath)); + } + + void updateMetadata(const int64_t regionID, + const OfflineRegionMetadata& metadata, + std::function)> callback) { + callback(offlineDatabase->updateMetadata(regionID, metadata)); + } + + void getRegionStatus(int64_t regionID, std::function)> callback) { + if (auto download = getDownload(regionID)) { + callback(download.value()->getStatus()); + } else { + callback(unexpected(download.error())); + } + } + + void deleteRegion(OfflineRegion&& region, std::function callback) { + downloads.erase(region.getID()); + callback(offlineDatabase->deleteRegion(std::move(region))); + } + + void setRegionObserver(int64_t regionID, std::unique_ptr observer) { + if (auto download = getDownload(regionID)) { + download.value()->setObserver(std::move(observer)); + } + } + + void setRegionDownloadState(int64_t regionID, OfflineRegionDownloadState state) { + if (auto download = getDownload(regionID)) { + download.value()->setState(state); + } + } + + void request(AsyncRequest* req, Resource resource, ActorRef ref) { + auto callback = [ref] (const Response& res) mutable { + ref.invoke(&FileSourceRequest::setResponse, res); + }; + + if (AssetFileSource::acceptsURL(resource.url)) { + //Asset request + tasks[req] = assetFileSource->request(resource, callback); + } else if (LocalFileSource::acceptsURL(resource.url)) { + //Local file request + tasks[req] = localFileSource->request(resource, callback); + } else { + // Try the offline database + if (resource.hasLoadingMethod(Resource::LoadingMethod::Cache)) { + auto offlineResponse = offlineDatabase->get(resource); + + if (resource.loadingMethod == Resource::LoadingMethod::CacheOnly) { + if (!offlineResponse) { + // Ensure there's always a response that we can send, so the caller knows that + // there's no optional data available in the cache, when it's the only place + // we're supposed to load from. + offlineResponse.emplace(); + offlineResponse->noContent = true; + offlineResponse->error = std::make_unique( + Response::Error::Reason::NotFound, "Not found in offline database"); + } else if (!offlineResponse->isUsable()) { + // Don't return resources the server requested not to show when they're stale. + // Even if we can't directly use the response, we may still use it to send a + // conditional HTTP request, which is why we're saving it above. + offlineResponse->error = std::make_unique( + Response::Error::Reason::NotFound, "Cached resource is unusable"); + } + callback(*offlineResponse); + } else if (offlineResponse) { + // Copy over the fields so that we can use them when making a refresh request. + resource.priorModified = offlineResponse->modified; + resource.priorExpires = offlineResponse->expires; + resource.priorEtag = offlineResponse->etag; + resource.priorData = offlineResponse->data; + + if (offlineResponse->isUsable()) { + callback(*offlineResponse); + } + } + } + + // Get from the online file source + if (resource.hasLoadingMethod(Resource::LoadingMethod::Network)) { + MBGL_TIMING_START(watch); + tasks[req] = onlineFileSource.request(resource, [=] (Response onlineResponse) mutable { + this->offlineDatabase->put(resource, onlineResponse); + if (resource.kind == Resource::Kind::Tile) { + // onlineResponse.data will be null if data not modified + MBGL_TIMING_FINISH(watch, + " Action: " << "Requesting," << + " URL: " << resource.url.c_str() << + " Size: " << (onlineResponse.data != nullptr ? onlineResponse.data->size() : 0) << "B," << + " Time") + } + callback(onlineResponse); + }); + } + } + } + + void cancel(AsyncRequest* req) { + tasks.erase(req); + } + + void setOfflineMapboxTileCountLimit(uint64_t limit) { + offlineDatabase->setOfflineMapboxTileCountLimit(limit); + } + + void setOnlineStatus(const bool status) { + onlineFileSource.setOnlineStatus(status); + } + + void put(const Resource& resource, const Response& response) { + offlineDatabase->put(resource, response); + } + +private: + expected getDownload(int64_t regionID) { + auto it = downloads.find(regionID); + if (it != downloads.end()) { + return it->second.get(); + } + auto definition = offlineDatabase->getRegionDefinition(regionID); + if (!definition) { + return unexpected(definition.error()); + } + auto download = std::make_unique(regionID, std::move(definition.value()), + *offlineDatabase, onlineFileSource); + return downloads.emplace(regionID, std::move(download)).first->second.get(); + } + + // shared so that destruction is done on the creating thread + const std::shared_ptr assetFileSource; + const std::unique_ptr localFileSource; + std::unique_ptr offlineDatabase; + OnlineFileSource onlineFileSource; + std::unordered_map> tasks; + std::unordered_map> downloads; +}; + +DefaultFileSource::DefaultFileSource(const std::string& cachePath, + const std::string& assetRoot, + uint64_t maximumCacheSize) + : DefaultFileSource(cachePath, std::make_unique(assetRoot), maximumCacheSize) { +} + +DefaultFileSource::DefaultFileSource(const std::string& cachePath, + std::unique_ptr&& assetFileSource_, + uint64_t maximumCacheSize) + : assetFileSource(std::move(assetFileSource_)) + , impl(std::make_unique>("DefaultFileSource", assetFileSource, cachePath, maximumCacheSize)) { +} + +DefaultFileSource::~DefaultFileSource() = default; + +void DefaultFileSource::setAPIBaseURL(const std::string& baseURL) { + impl->actor().invoke(&Impl::setAPIBaseURL, baseURL); + + { + std::lock_guard lock(cachedBaseURLMutex); + cachedBaseURL = baseURL; + } +} + +std::string DefaultFileSource::getAPIBaseURL() { + std::lock_guard lock(cachedBaseURLMutex); + return cachedBaseURL; +} + +void DefaultFileSource::setAccessToken(const std::string& accessToken) { + impl->actor().invoke(&Impl::setAccessToken, accessToken); + + { + std::lock_guard lock(cachedAccessTokenMutex); + cachedAccessToken = accessToken; + } +} + +std::string DefaultFileSource::getAccessToken() { + std::lock_guard lock(cachedAccessTokenMutex); + return cachedAccessToken; +} + +void DefaultFileSource::setResourceTransform(optional>&& transform) { + impl->actor().invoke(&Impl::setResourceTransform, std::move(transform)); +} + +std::unique_ptr DefaultFileSource::request(const Resource& resource, Callback callback) { + auto req = std::make_unique(std::move(callback)); + + req->onCancel([fs = impl->actor(), req = req.get()] () mutable { fs.invoke(&Impl::cancel, req); }); + + impl->actor().invoke(&Impl::request, req.get(), resource, req->actor()); + + return std::move(req); +} + +void DefaultFileSource::listOfflineRegions(std::function)> callback) { + impl->actor().invoke(&Impl::listRegions, callback); +} + +void DefaultFileSource::createOfflineRegion(const OfflineRegionDefinition& definition, + const OfflineRegionMetadata& metadata, + std::function)> callback) { + impl->actor().invoke(&Impl::createRegion, definition, metadata, callback); +} + +void DefaultFileSource::mergeOfflineRegions(const std::string& sideDatabasePath, + std::function)> callback) { + impl->actor().invoke(&Impl::mergeOfflineRegions, sideDatabasePath, callback); +} + +void DefaultFileSource::updateOfflineMetadata(const int64_t regionID, + const OfflineRegionMetadata& metadata, + std::function)> callback) { + impl->actor().invoke(&Impl::updateMetadata, regionID, metadata, callback); +} + +void DefaultFileSource::deleteOfflineRegion(OfflineRegion&& region, std::function callback) { + impl->actor().invoke(&Impl::deleteRegion, std::move(region), callback); +} + +void DefaultFileSource::setOfflineRegionObserver(OfflineRegion& region, std::unique_ptr observer) { + impl->actor().invoke(&Impl::setRegionObserver, region.getID(), std::move(observer)); +} + +void DefaultFileSource::setOfflineRegionDownloadState(OfflineRegion& region, OfflineRegionDownloadState state) { + impl->actor().invoke(&Impl::setRegionDownloadState, region.getID(), state); +} + +void DefaultFileSource::getOfflineRegionStatus(OfflineRegion& region, std::function)> callback) const { + impl->actor().invoke(&Impl::getRegionStatus, region.getID(), callback); +} + +void DefaultFileSource::setOfflineMapboxTileCountLimit(uint64_t limit) const { + impl->actor().invoke(&Impl::setOfflineMapboxTileCountLimit, limit); +} + +void DefaultFileSource::pause() { + impl->pause(); +} + +void DefaultFileSource::resume() { + impl->resume(); +} + +void DefaultFileSource::put(const Resource& resource, const Response& response) { + impl->actor().invoke(&Impl::put, resource, response); +} + +// For testing only: + +void DefaultFileSource::setOnlineStatus(const bool status) { + impl->actor().invoke(&Impl::setOnlineStatus, status); +} + +} // namespace mbgl diff --git a/platform/default/src/mbgl/storage/file_source_request.cpp b/platform/default/src/mbgl/storage/file_source_request.cpp new file mode 100644 index 0000000000..09ea8cc32a --- /dev/null +++ b/platform/default/src/mbgl/storage/file_source_request.cpp @@ -0,0 +1,37 @@ +#include + +#include +#include + +namespace mbgl { + +FileSourceRequest::FileSourceRequest(FileSource::Callback&& callback) + : responseCallback(callback) + , mailbox(std::make_shared(*Scheduler::GetCurrent())) { +} + +FileSourceRequest::~FileSourceRequest() { + if (cancelCallback) { + cancelCallback(); + } + + mailbox->close(); +} + +void FileSourceRequest::onCancel(std::function&& callback) { + cancelCallback = std::move(callback); +} + +void FileSourceRequest::setResponse(const Response& response) { + // Copy, because calling the callback will sometimes self + // destroy this object. We cannot move because this method + // can be called more than one. + auto callback = responseCallback; + callback(response); +} + +ActorRef FileSourceRequest::actor() { + return ActorRef(*this, mailbox); +} + +} // namespace mbgl diff --git a/platform/default/src/mbgl/storage/http_file_source.cpp b/platform/default/src/mbgl/storage/http_file_source.cpp new file mode 100644 index 0000000000..213b53de98 --- /dev/null +++ b/platform/default/src/mbgl/storage/http_file_source.cpp @@ -0,0 +1,495 @@ +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +// Dynamically load all cURL functions. Debian-derived systems upgraded the OpenSSL version linked +// to in https://salsa.debian.org/debian/curl/commit/95c94957bb7e89e36e78b995fed468c42f64d18d +// They state: +// Rename libcurl3 to libcurl4, because libcurl exposes an SSL_CTX via +// CURLOPT_SSL_CTX_FUNCTION, and this object changes incompatibly between +// openssl 1.0 and openssl 1.1. +// Since we are not accessing the underlying OpenSSL context, we don't care whether we're linking +// against libcurl3 or libcurl4; both use the ABI version 4 which hasn't changed since 2006 +// (see https://curl.haxx.se/libcurl/abi.html). In fact, cURL's ABI compatibility is very good as +// shown on https://abi-laboratory.pro/tracker/timeline/curl/ +// Therefore, we're dynamically loading the cURL symbols we need to avoid linking against versioned +// symbols. +#include + +namespace curl { + +#define CURL_FUNCTIONS \ + X(global_init) \ + X(getdate) \ + X(easy_strerror) \ + X(easy_init) \ + X(easy_setopt) \ + X(easy_cleanup) \ + X(easy_getinfo) \ + X(easy_reset) \ + X(multi_init) \ + X(multi_add_handle) \ + X(multi_remove_handle) \ + X(multi_cleanup) \ + X(multi_info_read) \ + X(multi_strerror) \ + X(multi_socket_action) \ + X(multi_setopt) \ + X(share_init) \ + X(share_cleanup) \ + X(slist_append) \ + X(slist_free_all) + +#define X(name) static decltype(&curl_ ## name) name = nullptr; +CURL_FUNCTIONS +#undef X + +static void* handle = nullptr; + +static void* load(const char* name) { + void* symbol = dlsym(handle, name); + if (const char* error = dlerror()) { + fprintf(stderr, "Cannot load symbol '%s': %s\n", name, error); + dlclose(handle); + handle = nullptr; + abort(); + } + return symbol; +} + +__attribute__((constructor)) +static void load() { + assert(!handle); + handle = dlopen("libcurl.so.4", RTLD_LAZY | RTLD_LOCAL); + if (!handle) { + fprintf(stderr, "Could not open shared library '%s'\n", "libcurl.so.4"); + abort(); + } + + #define X(name) name = (decltype(&curl_ ## name))load("curl_" #name); + CURL_FUNCTIONS + #undef X +} + +__attribute__((constructor)) +static void unload() { + if (handle) { + dlclose(handle); + } +} + +} // namespace curl + + +#include +#include +#include +#include +#include + +static void handleError(CURLMcode code) { + if (code != CURLM_OK) { + throw std::runtime_error(std::string("CURL multi error: ") + curl::multi_strerror(code)); + } +} + +static void handleError(CURLcode code) { + if (code != CURLE_OK) { + throw std::runtime_error(std::string("CURL easy error: ") + curl::easy_strerror(code)); + } +} + +namespace mbgl { + +class HTTPFileSource::Impl { +public: + Impl(); + ~Impl(); + + static int handleSocket(CURL *handle, curl_socket_t s, int action, void *userp, void *socketp); + static int startTimeout(CURLM *multi, long timeout_ms, void *userp); + static void onTimeout(HTTPFileSource::Impl *context); + + void perform(curl_socket_t s, util::RunLoop::Event event); + CURL *getHandle(); + void returnHandle(CURL *handle); + void checkMultiInfo(); + + // Used as the CURL timer function to periodically check for socket updates. + util::Timer timeout; + + // CURL multi handle that we use to request multiple URLs at the same time, without having to + // block and spawn threads. + CURLM *multi = nullptr; + + // CURL share handles are used for sharing session state (e.g.) + CURLSH *share = nullptr; + + // A queue that we use for storing resuable CURL easy handles to avoid creating and destroying + // them all the time. + std::queue handles; +}; + +class HTTPRequest : public AsyncRequest { +public: + HTTPRequest(HTTPFileSource::Impl*, Resource, FileSource::Callback); + ~HTTPRequest() override; + + void handleResult(CURLcode code); + +private: + static size_t headerCallback(char *const buffer, const size_t size, const size_t nmemb, void *userp); + static size_t writeCallback(void *const contents, const size_t size, const size_t nmemb, void *userp); + + HTTPFileSource::Impl* context = nullptr; + Resource resource; + FileSource::Callback callback; + + // Will store the current response. + std::shared_ptr data; + std::unique_ptr response; + + optional retryAfter; + optional xRateLimitReset; + + CURL *handle = nullptr; + curl_slist *headers = nullptr; + + char error[CURL_ERROR_SIZE] = { 0 }; +}; + +HTTPFileSource::Impl::Impl() { + if (curl::global_init(CURL_GLOBAL_ALL)) { + throw std::runtime_error("Could not init cURL"); + } + + share = curl::share_init(); + + multi = curl::multi_init(); + handleError(curl::multi_setopt(multi, CURLMOPT_SOCKETFUNCTION, handleSocket)); + handleError(curl::multi_setopt(multi, CURLMOPT_SOCKETDATA, this)); + handleError(curl::multi_setopt(multi, CURLMOPT_TIMERFUNCTION, startTimeout)); + handleError(curl::multi_setopt(multi, CURLMOPT_TIMERDATA, this)); +} + +HTTPFileSource::Impl::~Impl() { + while (!handles.empty()) { + curl::easy_cleanup(handles.front()); + handles.pop(); + } + + curl::multi_cleanup(multi); + multi = nullptr; + + curl::share_cleanup(share); + share = nullptr; + + timeout.stop(); +} + +CURL *HTTPFileSource::Impl::getHandle() { + if (!handles.empty()) { + auto handle = handles.front(); + handles.pop(); + return handle; + } else { + return curl::easy_init(); + } +} + +void HTTPFileSource::Impl::returnHandle(CURL *handle) { + curl::easy_reset(handle); + handles.push(handle); +} + +void HTTPFileSource::Impl::checkMultiInfo() { + CURLMsg *message = nullptr; + int pending = 0; + + while ((message = curl::multi_info_read(multi, &pending))) { + switch (message->msg) { + case CURLMSG_DONE: { + HTTPRequest *baton = nullptr; + curl::easy_getinfo(message->easy_handle, CURLINFO_PRIVATE, (char *)&baton); + assert(baton); + baton->handleResult(message->data.result); + } break; + + default: + // This should never happen, because there are no other message types. + throw std::runtime_error("CURLMsg returned unknown message type"); + } + } +} + +void HTTPFileSource::Impl::perform(curl_socket_t s, util::RunLoop::Event events) { + int flags = 0; + + if (events == util::RunLoop::Event::Read) { + flags |= CURL_CSELECT_IN; + } + if (events == util::RunLoop::Event::Write) { + flags |= CURL_CSELECT_OUT; + } + + + int running_handles = 0; + curl::multi_socket_action(multi, s, flags, &running_handles); + checkMultiInfo(); +} + +int HTTPFileSource::Impl::handleSocket(CURL * /* handle */, curl_socket_t s, int action, void *userp, + void * /* socketp */) { + assert(userp); + auto context = reinterpret_cast(userp); + + switch (action) { + case CURL_POLL_IN: { + using namespace std::placeholders; + util::RunLoop::Get()->addWatch(s, util::RunLoop::Event::Read, + std::bind(&Impl::perform, context, _1, _2)); + break; + } + case CURL_POLL_OUT: { + using namespace std::placeholders; + util::RunLoop::Get()->addWatch(s, util::RunLoop::Event::Write, + std::bind(&Impl::perform, context, _1, _2)); + break; + } + case CURL_POLL_REMOVE: + util::RunLoop::Get()->removeWatch(s); + break; + default: + throw std::runtime_error("Unhandled CURL socket action"); + } + + return 0; +} + +void HTTPFileSource::Impl::onTimeout(Impl *context) { + int running_handles; + CURLMcode error = curl::multi_socket_action(context->multi, CURL_SOCKET_TIMEOUT, 0, &running_handles); + if (error != CURLM_OK) { + throw std::runtime_error(std::string("CURL multi error: ") + curl::multi_strerror(error)); + } + context->checkMultiInfo(); +} + +int HTTPFileSource::Impl::startTimeout(CURLM * /* multi */, long timeout_ms, void *userp) { + assert(userp); + auto context = reinterpret_cast(userp); + + if (timeout_ms < 0) { + // A timeout of 0 ms means that the timer will invoked in the next loop iteration. + timeout_ms = 0; + } + + context->timeout.stop(); + context->timeout.start(mbgl::Milliseconds(timeout_ms), Duration::zero(), + std::bind(&Impl::onTimeout, context)); + + return 0; +} + +HTTPRequest::HTTPRequest(HTTPFileSource::Impl* context_, Resource resource_, FileSource::Callback callback_) + : context(context_), + resource(std::move(resource_)), + callback(std::move(callback_)), + handle(context->getHandle()) { + + // If there's already a response, set the correct etags/modified headers to make sure we are + // getting a 304 response if possible. This avoids redownloading unchanged data. + if (resource.priorEtag) { + const std::string header = std::string("If-None-Match: ") + *resource.priorEtag; + headers = curl::slist_append(headers, header.c_str()); + } else if (resource.priorModified) { + const std::string time = + std::string("If-Modified-Since: ") + util::rfc1123(*resource.priorModified); + headers = curl::slist_append(headers, time.c_str()); + } + + if (headers) { + curl::easy_setopt(handle, CURLOPT_HTTPHEADER, headers); + } + + handleError(curl::easy_setopt(handle, CURLOPT_PRIVATE, this)); + handleError(curl::easy_setopt(handle, CURLOPT_ERRORBUFFER, error)); + handleError(curl::easy_setopt(handle, CURLOPT_CAINFO, "ca-bundle.crt")); + handleError(curl::easy_setopt(handle, CURLOPT_FOLLOWLOCATION, 1)); + handleError(curl::easy_setopt(handle, CURLOPT_URL, resource.url.c_str())); + handleError(curl::easy_setopt(handle, CURLOPT_WRITEFUNCTION, writeCallback)); + handleError(curl::easy_setopt(handle, CURLOPT_WRITEDATA, this)); + handleError(curl::easy_setopt(handle, CURLOPT_HEADERFUNCTION, headerCallback)); + handleError(curl::easy_setopt(handle, CURLOPT_HEADERDATA, this)); +#if LIBCURL_VERSION_NUM >= ((7) << 16 | (21) << 8 | 6) // Renamed in 7.21.6 + handleError(curl::easy_setopt(handle, CURLOPT_ACCEPT_ENCODING, "gzip, deflate")); +#else + handleError(curl::easy_setopt(handle, CURLOPT_ENCODING, "gzip, deflate")); +#endif + handleError(curl::easy_setopt(handle, CURLOPT_USERAGENT, "MapboxGL/1.0")); + handleError(curl::easy_setopt(handle, CURLOPT_SHARE, context->share)); + + // Start requesting the information. + handleError(curl::multi_add_handle(context->multi, handle)); +} + +HTTPRequest::~HTTPRequest() { + handleError(curl::multi_remove_handle(context->multi, handle)); + context->returnHandle(handle); + handle = nullptr; + + if (headers) { + curl::slist_free_all(headers); + headers = nullptr; + } +} + +// This function is called when we have new data for a request. We just append it to the string +// containing the previous data. +size_t HTTPRequest::writeCallback(void *const contents, const size_t size, const size_t nmemb, void *userp) { + assert(userp); + auto impl = reinterpret_cast(userp); + + if (!impl->data) { + impl->data = std::make_shared(); + } + + impl->data->append((char *)contents, size * nmemb); + return size * nmemb; +} + +// Compares the beginning of the (non-zero-terminated!) data buffer with the (zero-terminated!) +// header string. If the data buffer contains the header string at the beginning, it returns +// the length of the header string == begin of the value, otherwise it returns npos. +// The comparison of the header is ASCII-case-insensitive. +size_t headerMatches(const char *const header, const char *const buffer, const size_t length) { + const size_t headerLength = strlen(header); + if (length < headerLength) { + return std::string::npos; + } + size_t i = 0; + while (i < length && i < headerLength && std::tolower(buffer[i]) == std::tolower(header[i])) { + i++; + } + return i == headerLength ? i : std::string::npos; +} + +size_t HTTPRequest::headerCallback(char *const buffer, const size_t size, const size_t nmemb, void *userp) { + assert(userp); + auto baton = reinterpret_cast(userp); + + if (!baton->response) { + baton->response = std::make_unique(); + } + + const size_t length = size * nmemb; + size_t begin = std::string::npos; + if ((begin = headerMatches("last-modified: ", buffer, length)) != std::string::npos) { + // Always overwrite the modification date; We might already have a value here from the + // Date header, but this one is more accurate. + const std::string value { buffer + begin, length - begin - 2 }; // remove \r\n + baton->response->modified = Timestamp{ Seconds(curl::getdate(value.c_str(), nullptr)) }; + } else if ((begin = headerMatches("etag: ", buffer, length)) != std::string::npos) { + baton->response->etag = std::string(buffer + begin, length - begin - 2); // remove \r\n + } else if ((begin = headerMatches("cache-control: ", buffer, length)) != std::string::npos) { + const std::string value { buffer + begin, length - begin - 2 }; // remove \r\n + const auto cc = http::CacheControl::parse(value.c_str()); + baton->response->expires = cc.toTimePoint(); + baton->response->mustRevalidate = cc.mustRevalidate; + } else if ((begin = headerMatches("expires: ", buffer, length)) != std::string::npos) { + const std::string value { buffer + begin, length - begin - 2 }; // remove \r\n + baton->response->expires = Timestamp{ Seconds(curl::getdate(value.c_str(), nullptr)) }; + } else if ((begin = headerMatches("retry-after: ", buffer, length)) != std::string::npos) { + baton->retryAfter = std::string(buffer + begin, length - begin - 2); // remove \r\n + } else if ((begin = headerMatches("x-rate-limit-reset: ", buffer, length)) != std::string::npos) { + baton->xRateLimitReset = std::string(buffer + begin, length - begin - 2); // remove \r\n + } + + return length; +} + +void HTTPRequest::handleResult(CURLcode code) { + // Make sure a response object exists in case we haven't got any headers or content. + if (!response) { + response = std::make_unique(); + } + + using Error = Response::Error; + + // Add human-readable error code + if (code != CURLE_OK) { + switch (code) { + case CURLE_COULDNT_RESOLVE_PROXY: + case CURLE_COULDNT_RESOLVE_HOST: + case CURLE_COULDNT_CONNECT: + case CURLE_OPERATION_TIMEDOUT: + + response->error = std::make_unique( + Error::Reason::Connection, std::string{ curl::easy_strerror(code) } + ": " + error); + break; + + default: + response->error = std::make_unique( + Error::Reason::Other, std::string{ curl::easy_strerror(code) } + ": " + error); + break; + } + } else { + long responseCode = 0; + curl::easy_getinfo(handle, CURLINFO_RESPONSE_CODE, &responseCode); + + if (responseCode == 200) { + if (data) { + response->data = std::move(data); + } else { + response->data = std::make_shared(); + } + } else if (responseCode == 204 || (responseCode == 404 && resource.kind == Resource::Kind::Tile)) { + response->noContent = true; + } else if (responseCode == 304) { + response->notModified = true; + } else if (responseCode == 404) { + response->error = + std::make_unique(Error::Reason::NotFound, "HTTP status code 404"); + } else if (responseCode == 429) { + response->error = + std::make_unique(Error::Reason::RateLimit, "HTTP status code 429", + http::parseRetryHeaders(retryAfter, xRateLimitReset)); + } else if (responseCode >= 500 && responseCode < 600) { + response->error = + std::make_unique(Error::Reason::Server, std::string{ "HTTP status code " } + + util::toString(responseCode)); + } else { + response->error = + std::make_unique(Error::Reason::Other, std::string{ "HTTP status code " } + + util::toString(responseCode)); + } + } + + // Calling `callback` may result in deleting `this`. Copy data to temporaries first. + auto callback_ = callback; + auto response_ = *response; + callback_(response_); +} + +HTTPFileSource::HTTPFileSource() + : impl(std::make_unique()) { +} + +HTTPFileSource::~HTTPFileSource() = default; + +std::unique_ptr HTTPFileSource::request(const Resource& resource, Callback callback) { + return std::make_unique(impl.get(), resource, callback); +} + +} // namespace mbgl diff --git a/platform/default/src/mbgl/storage/local_file_source.cpp b/platform/default/src/mbgl/storage/local_file_source.cpp new file mode 100644 index 0000000000..1b7b7b9278 --- /dev/null +++ b/platform/default/src/mbgl/storage/local_file_source.cpp @@ -0,0 +1,81 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#if defined(_WINDOWS) && !defined(S_ISDIR) +#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +#endif + +namespace { + +const std::string fileProtocol = "file://"; + +} // namespace + +namespace mbgl { + +class LocalFileSource::Impl { +public: + Impl(ActorRef) {} + + void request(const std::string& url, ActorRef req) { + Response response; + + if (!acceptsURL(url)) { + response.error = std::make_unique(Response::Error::Reason::Other, + "Invalid file URL"); + req.invoke(&FileSourceRequest::setResponse, response); + return; + } + + // Cut off the protocol and prefix with path. + const auto path = mbgl::util::percentDecode(url.substr(fileProtocol.size())); + struct stat buf; + int result = stat(path.c_str(), &buf); + + if (result == 0 && S_ISDIR(buf.st_mode)) { + response.error = std::make_unique(Response::Error::Reason::NotFound); + } else if (result == -1 && errno == ENOENT) { + response.error = std::make_unique(Response::Error::Reason::NotFound); + } else { + try { + response.data = std::make_shared(util::read_file(path)); + } catch (...) { + response.error = std::make_unique( + Response::Error::Reason::Other, + util::toString(std::current_exception())); + } + } + + req.invoke(&FileSourceRequest::setResponse, response); + } + +}; + +LocalFileSource::LocalFileSource() + : impl(std::make_unique>("LocalFileSource")) { +} + +LocalFileSource::~LocalFileSource() = default; + +std::unique_ptr LocalFileSource::request(const Resource& resource, Callback callback) { + auto req = std::make_unique(std::move(callback)); + + impl->actor().invoke(&Impl::request, resource.url, req->actor()); + + return std::move(req); +} + +bool LocalFileSource::acceptsURL(const std::string& url) { + return 0 == url.rfind(fileProtocol, 0); +} + +} // namespace mbgl diff --git a/platform/default/src/mbgl/storage/offline.cpp b/platform/default/src/mbgl/storage/offline.cpp new file mode 100644 index 0000000000..e1ec0acb31 --- /dev/null +++ b/platform/default/src/mbgl/storage/offline.cpp @@ -0,0 +1,158 @@ +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include + +namespace mbgl { + +// OfflineTilePyramidRegionDefinition + +OfflineTilePyramidRegionDefinition::OfflineTilePyramidRegionDefinition( + std::string styleURL_, LatLngBounds bounds_, double minZoom_, double maxZoom_, float pixelRatio_) + : styleURL(std::move(styleURL_)), + bounds(std::move(bounds_)), + minZoom(minZoom_), + maxZoom(maxZoom_), + pixelRatio(pixelRatio_) { + if (minZoom < 0 || maxZoom < 0 || maxZoom < minZoom || pixelRatio < 0 || + !std::isfinite(minZoom) || std::isnan(maxZoom) || !std::isfinite(pixelRatio)) { + throw std::invalid_argument("Invalid offline region definition"); + } +} + + +// OfflineGeometryRegionDefinition + +OfflineGeometryRegionDefinition::OfflineGeometryRegionDefinition(std::string styleURL_, Geometry geometry_, double minZoom_, double maxZoom_, float pixelRatio_) + : styleURL(styleURL_) + , geometry(std::move(geometry_)) + , minZoom(minZoom_) + , maxZoom(maxZoom_) + , pixelRatio(pixelRatio_) { + if (minZoom < 0 || maxZoom < 0 || maxZoom < minZoom || pixelRatio < 0 || + !std::isfinite(minZoom) || std::isnan(maxZoom) || !std::isfinite(pixelRatio)) { + throw std::invalid_argument("Invalid offline region definition"); + } +} + +OfflineRegionDefinition decodeOfflineRegionDefinition(const std::string& region) { + rapidjson::GenericDocument, rapidjson::CrtAllocator> doc; + doc.Parse<0>(region.c_str()); + + // validation + + auto hasValidBounds = [&] { + return doc.HasMember("bounds") && doc["bounds"].IsArray() && doc["bounds"].Size() == 4 + && doc["bounds"][0].IsDouble() && doc["bounds"][1].IsDouble() + && doc["bounds"][2].IsDouble() && doc["bounds"][3].IsDouble(); + }; + + auto hasValidGeometry = [&] { + return doc.HasMember("geometry") && doc["geometry"].IsObject(); + }; + + if (doc.HasParseError() + || !doc.HasMember("style_url") || !doc["style_url"].IsString() + || !(hasValidBounds() || hasValidGeometry()) + || !doc.HasMember("min_zoom") || !doc["min_zoom"].IsDouble() + || (doc.HasMember("max_zoom") && !doc["max_zoom"].IsDouble()) + || !doc.HasMember("pixel_ratio") || !doc["pixel_ratio"].IsDouble()) { + throw std::runtime_error("Malformed offline region definition"); + } + + // Common properties + + std::string styleURL { doc["style_url"].GetString(), doc["style_url"].GetStringLength() }; + double minZoom = doc["min_zoom"].GetDouble(); + double maxZoom = doc.HasMember("max_zoom") ? doc["max_zoom"].GetDouble() : INFINITY; + float pixelRatio = doc["pixel_ratio"].GetDouble(); + + if (doc.HasMember("bounds")) { + return OfflineTilePyramidRegionDefinition{ + styleURL, + LatLngBounds::hull( + LatLng(doc["bounds"][0].GetDouble(), doc["bounds"][1].GetDouble()), + LatLng(doc["bounds"][2].GetDouble(), doc["bounds"][3].GetDouble())), + minZoom, maxZoom, pixelRatio }; + } else { + return OfflineGeometryRegionDefinition{ + styleURL, + mapbox::geojson::convert>(doc["geometry"].GetObject()), + minZoom, maxZoom, pixelRatio }; + }; + +} + +std::string encodeOfflineRegionDefinition(const OfflineRegionDefinition& region) { + rapidjson::GenericDocument, rapidjson::CrtAllocator> doc; + doc.SetObject(); + + // Encode common properties + region.match([&](auto& _region) { + doc.AddMember("style_url", rapidjson::StringRef(_region.styleURL.data(), _region.styleURL.length()), doc.GetAllocator()); + doc.AddMember("min_zoom", _region.minZoom, doc.GetAllocator()); + if (std::isfinite(_region.maxZoom)) { + doc.AddMember("max_zoom", _region.maxZoom, doc.GetAllocator()); + } + + doc.AddMember("pixel_ratio", _region.pixelRatio, doc.GetAllocator()); + }); + + // Encode specific properties + region.match( + [&] (const OfflineTilePyramidRegionDefinition& _region) { + rapidjson::GenericValue, rapidjson::CrtAllocator> bounds(rapidjson::kArrayType); + bounds.PushBack(_region.bounds.south(), doc.GetAllocator()); + bounds.PushBack(_region.bounds.west(), doc.GetAllocator()); + bounds.PushBack(_region.bounds.north(), doc.GetAllocator()); + bounds.PushBack(_region.bounds.east(), doc.GetAllocator()); + doc.AddMember("bounds", bounds, doc.GetAllocator()); + + }, + [&] (const OfflineGeometryRegionDefinition& _region) { + doc.AddMember("geometry", mapbox::geojson::convert(_region.geometry, doc.GetAllocator()), doc.GetAllocator()); + + } + ); + + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + doc.Accept(writer); + + return buffer.GetString(); +} + + +// OfflineRegion + +OfflineRegion::OfflineRegion(int64_t id_, + OfflineRegionDefinition definition_, + OfflineRegionMetadata metadata_) + : id(id_), + definition(std::move(definition_)), + metadata(std::move(metadata_)) { +} + +OfflineRegion::OfflineRegion(OfflineRegion&&) = default; +OfflineRegion::~OfflineRegion() = default; + +const OfflineRegionDefinition& OfflineRegion::getDefinition() const { + return definition; +} + +const OfflineRegionMetadata& OfflineRegion::getMetadata() const { + return metadata; +} + +int64_t OfflineRegion::getID() const { + return id; +} +} // namespace mbgl diff --git a/platform/default/src/mbgl/storage/offline_database.cpp b/platform/default/src/mbgl/storage/offline_database.cpp new file mode 100644 index 0000000000..7732076991 --- /dev/null +++ b/platform/default/src/mbgl/storage/offline_database.cpp @@ -0,0 +1,1129 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + +namespace mbgl { + +OfflineDatabase::OfflineDatabase(std::string path_, uint64_t maximumCacheSize_) + : path(std::move(path_)), + maximumCacheSize(maximumCacheSize_) { + try { + initialize(); + } catch (const util::IOException& ex) { + handleError(ex, "open database"); + } catch (const mapbox::sqlite::Exception& ex) { + handleError(ex, "open database"); + } + // Assume that we can't open the database right now and work with an empty database object. +} + +OfflineDatabase::~OfflineDatabase() { + // Deleting these SQLite objects may result in exceptions, but we're in a destructor, so we + // can't throw anything. + try { + statements.clear(); + db.reset(); + } catch (const util::IOException& ex) { + handleError(ex, "close database"); + } catch (const mapbox::sqlite::Exception& ex) { + handleError(ex, "close database"); + } +} + +void OfflineDatabase::initialize() { + assert(!db); + assert(statements.empty()); + + db = std::make_unique( + mapbox::sqlite::Database::open(path, mapbox::sqlite::ReadWriteCreate)); + db->setBusyTimeout(Milliseconds::max()); + db->exec("PRAGMA foreign_keys = ON"); + + const auto userVersion = getPragma("PRAGMA user_version"); + switch (userVersion) { + case 0: + case 1: + // Newly created database, or old cache-only database; remove old table if it exists. + removeOldCacheTable(); + createSchema(); + return; + case 2: + migrateToVersion3(); + // fall through + case 3: + // Removed migration, see below. + // fall through + case 4: + migrateToVersion5(); + // fall through + case 5: + migrateToVersion6(); + // fall through + case 6: + // Happy path; we're done + return; + default: + // Downgrade: delete the database and try to reinitialize. + removeExisting(); + initialize(); + } +} + +void OfflineDatabase::handleError(const mapbox::sqlite::Exception& ex, const char* action) { + if (ex.code == mapbox::sqlite::ResultCode::NotADB || + ex.code == mapbox::sqlite::ResultCode::Corrupt || + (ex.code == mapbox::sqlite::ResultCode::ReadOnly && + ex.extendedCode == mapbox::sqlite::ExtendedResultCode::ReadOnlyDBMoved)) { + // The database was corruped, moved away, or deleted. We're going to start fresh with a + // clean slate for the next operation. + Log::Error(Event::Database, static_cast(ex.code), "Can't %s: %s", action, ex.what()); + try { + removeExisting(); + } catch (const util::IOException& ioEx) { + handleError(ioEx, action); + } + } else { + // We treat the error as temporary, and pretend we have an inaccessible DB. + Log::Warning(Event::Database, static_cast(ex.code), "Can't %s: %s", action, ex.what()); + } +} + +void OfflineDatabase::handleError(const util::IOException& ex, const char* action) { + // We failed to delete the database file. + Log::Error(Event::Database, ex.code, "Can't %s: %s", action, ex.what()); +} + +void OfflineDatabase::removeExisting() { + Log::Warning(Event::Database, "Removing existing incompatible offline database"); + + statements.clear(); + db.reset(); + + util::deleteFile(path); +} + +void OfflineDatabase::removeOldCacheTable() { + assert(db); + db->exec("DROP TABLE IF EXISTS http_cache"); + db->exec("VACUUM"); +} + +void OfflineDatabase::createSchema() { + assert(db); + db->exec("PRAGMA auto_vacuum = INCREMENTAL"); + db->exec("PRAGMA journal_mode = DELETE"); + db->exec("PRAGMA synchronous = FULL"); + mapbox::sqlite::Transaction transaction(*db); + db->exec(offlineDatabaseSchema); + db->exec("PRAGMA user_version = 6"); + transaction.commit(); +} + +void OfflineDatabase::migrateToVersion3() { + assert(db); + db->exec("PRAGMA auto_vacuum = INCREMENTAL"); + db->exec("VACUUM"); + db->exec("PRAGMA user_version = 3"); +} + +// Schema version 4 was WAL journal + NORMAL sync. It was reverted during pre- +// release development and the migration was removed entirely to avoid potential +// conflicts from quickly (and needlessly) switching journal and sync modes. +// +// See: https://github.com/mapbox/mapbox-gl-native/pull/6320 + +void OfflineDatabase::migrateToVersion5() { + assert(db); + db->exec("PRAGMA journal_mode = DELETE"); + db->exec("PRAGMA synchronous = FULL"); + db->exec("PRAGMA user_version = 5"); +} + +void OfflineDatabase::migrateToVersion6() { + assert(db); + mapbox::sqlite::Transaction transaction(*db); + db->exec("ALTER TABLE resources ADD COLUMN must_revalidate INTEGER NOT NULL DEFAULT 0"); + db->exec("ALTER TABLE tiles ADD COLUMN must_revalidate INTEGER NOT NULL DEFAULT 0"); + db->exec("PRAGMA user_version = 6"); + transaction.commit(); +} + +mapbox::sqlite::Statement& OfflineDatabase::getStatement(const char* sql) { + if (!db) { + initialize(); + } + auto it = statements.find(sql); + if (it == statements.end()) { + it = statements.emplace(sql, std::make_unique(*db, sql)).first; + } + return *it->second; +} + +optional OfflineDatabase::get(const Resource& resource) try { + auto result = getInternal(resource); + return result ? optional{ result->first } : nullopt; +} catch (const util::IOException& ex) { + handleError(ex, "read resource"); + return nullopt; +} catch (const mapbox::sqlite::Exception& ex) { + handleError(ex, "read resource"); + return nullopt; +} + +optional> OfflineDatabase::getInternal(const Resource& resource) { + if (resource.kind == Resource::Kind::Tile) { + assert(resource.tileData); + return getTile(*resource.tileData); + } else { + return getResource(resource); + } +} + +optional OfflineDatabase::hasInternal(const Resource& resource) { + if (resource.kind == Resource::Kind::Tile) { + assert(resource.tileData); + return hasTile(*resource.tileData); + } else { + return hasResource(resource); + } +} + +std::pair OfflineDatabase::put(const Resource& resource, const Response& response) try { + if (!db) { + initialize(); + } + mapbox::sqlite::Transaction transaction(*db, mapbox::sqlite::Transaction::Immediate); + auto result = putInternal(resource, response, true); + transaction.commit(); + return result; +} catch (const mapbox::sqlite::Exception& ex) { + handleError(ex, "write resource"); + return { false, 0 }; +} + +std::pair OfflineDatabase::putInternal(const Resource& resource, const Response& response, bool evict_) { + if (response.error) { + return { false, 0 }; + } + + std::string compressedData; + bool compressed = false; + uint64_t size = 0; + + if (response.data) { + compressedData = util::compress(*response.data); + compressed = compressedData.size() < response.data->size(); + size = compressed ? compressedData.size() : response.data->size(); + } + + if (evict_ && !evict(size)) { + Log::Info(Event::Database, "Unable to make space for entry"); + return { false, 0 }; + } + + bool inserted; + + if (resource.kind == Resource::Kind::Tile) { + assert(resource.tileData); + inserted = putTile(*resource.tileData, response, + compressed ? compressedData : response.data ? *response.data : "", + compressed); + } else { + inserted = putResource(resource, response, + compressed ? compressedData : response.data ? *response.data : "", + compressed); + } + + return { inserted, size }; +} + +optional> OfflineDatabase::getResource(const Resource& resource) { + // Update accessed timestamp used for LRU eviction. + try { + mapbox::sqlite::Query accessedQuery{ getStatement("UPDATE resources SET accessed = ?1 WHERE url = ?2") }; + accessedQuery.bind(1, util::now()); + accessedQuery.bind(2, resource.url); + accessedQuery.run(); + } catch (const mapbox::sqlite::Exception& ex) { + if (ex.code == mapbox::sqlite::ResultCode::NotADB || + ex.code == mapbox::sqlite::ResultCode::Corrupt) { + throw; + } + + // If we don't have any indication that the database is corrupt, continue as usual. + Log::Warning(Event::Database, static_cast(ex.code), "Can't update timestamp: %s", ex.what()); + } + + // clang-format off + mapbox::sqlite::Query query{ getStatement( + // 0 1 2 3 4 5 + "SELECT etag, expires, must_revalidate, modified, data, compressed " + "FROM resources " + "WHERE url = ?") }; + // clang-format on + + query.bind(1, resource.url); + + if (!query.run()) { + return nullopt; + } + + Response response; + uint64_t size = 0; + + response.etag = query.get>(0); + response.expires = query.get>(1); + response.mustRevalidate = query.get(2); + response.modified = query.get>(3); + + auto data = query.get>(4); + if (!data) { + response.noContent = true; + } else if (query.get(5)) { + response.data = std::make_shared(util::decompress(*data)); + size = data->length(); + } else { + response.data = std::make_shared(*data); + size = data->length(); + } + + return std::make_pair(response, size); +} + +optional OfflineDatabase::hasResource(const Resource& resource) { + mapbox::sqlite::Query query{ getStatement("SELECT length(data) FROM resources WHERE url = ?") }; + query.bind(1, resource.url); + if (!query.run()) { + return nullopt; + } + + return query.get>(0); +} + +bool OfflineDatabase::putResource(const Resource& resource, + const Response& response, + const std::string& data, + bool compressed) { + if (response.notModified) { + // clang-format off + mapbox::sqlite::Query notModifiedQuery{ getStatement( + "UPDATE resources " + "SET accessed = ?1, " + " expires = ?2, " + " must_revalidate = ?3 " + "WHERE url = ?4 ") }; + // clang-format on + + notModifiedQuery.bind(1, util::now()); + notModifiedQuery.bind(2, response.expires); + notModifiedQuery.bind(3, response.mustRevalidate); + notModifiedQuery.bind(4, resource.url); + notModifiedQuery.run(); + return false; + } + + // We can't use REPLACE because it would change the id value. + // clang-format off + mapbox::sqlite::Query updateQuery{ getStatement( + "UPDATE resources " + "SET kind = ?1, " + " etag = ?2, " + " expires = ?3, " + " must_revalidate = ?4, " + " modified = ?5, " + " accessed = ?6, " + " data = ?7, " + " compressed = ?8 " + "WHERE url = ?9 ") }; + // clang-format on + + updateQuery.bind(1, int(resource.kind)); + updateQuery.bind(2, response.etag); + updateQuery.bind(3, response.expires); + updateQuery.bind(4, response.mustRevalidate); + updateQuery.bind(5, response.modified); + updateQuery.bind(6, util::now()); + updateQuery.bind(9, resource.url); + + if (response.noContent) { + updateQuery.bind(7, nullptr); + updateQuery.bind(8, false); + } else { + updateQuery.bindBlob(7, data.data(), data.size(), false); + updateQuery.bind(8, compressed); + } + + updateQuery.run(); + if (updateQuery.changes() != 0) { + return false; + } + + // clang-format off + mapbox::sqlite::Query insertQuery{ getStatement( + "INSERT INTO resources (url, kind, etag, expires, must_revalidate, modified, accessed, data, compressed) " + "VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9) ") }; + // clang-format on + + insertQuery.bind(1, resource.url); + insertQuery.bind(2, int(resource.kind)); + insertQuery.bind(3, response.etag); + insertQuery.bind(4, response.expires); + insertQuery.bind(5, response.mustRevalidate); + insertQuery.bind(6, response.modified); + insertQuery.bind(7, util::now()); + + if (response.noContent) { + insertQuery.bind(8, nullptr); + insertQuery.bind(9, false); + } else { + insertQuery.bindBlob(8, data.data(), data.size(), false); + insertQuery.bind(9, compressed); + } + + insertQuery.run(); + + return true; +} + +optional> OfflineDatabase::getTile(const Resource::TileData& tile) { + // Update accessed timestamp used for LRU eviction. + try { + // clang-format off + mapbox::sqlite::Query accessedQuery{ getStatement( + "UPDATE tiles " + "SET accessed = ?1 " + "WHERE url_template = ?2 " + " AND pixel_ratio = ?3 " + " AND x = ?4 " + " AND y = ?5 " + " AND z = ?6 ") }; + // clang-format on + + accessedQuery.bind(1, util::now()); + accessedQuery.bind(2, tile.urlTemplate); + accessedQuery.bind(3, tile.pixelRatio); + accessedQuery.bind(4, tile.x); + accessedQuery.bind(5, tile.y); + accessedQuery.bind(6, tile.z); + accessedQuery.run(); + } catch (const mapbox::sqlite::Exception& ex) { + if (ex.code == mapbox::sqlite::ResultCode::NotADB || ex.code == mapbox::sqlite::ResultCode::Corrupt) { + throw; + } + + // If we don't have any indication that the database is corrupt, continue as usual. + Log::Warning(Event::Database, static_cast(ex.code), "Can't update timestamp: %s", ex.what()); + } + + // clang-format off + mapbox::sqlite::Query query{ getStatement( + // 0 1 2, 3, 4, 5 + "SELECT etag, expires, must_revalidate, modified, data, compressed " + "FROM tiles " + "WHERE url_template = ?1 " + " AND pixel_ratio = ?2 " + " AND x = ?3 " + " AND y = ?4 " + " AND z = ?5 ") }; + // clang-format on + + query.bind(1, tile.urlTemplate); + query.bind(2, tile.pixelRatio); + query.bind(3, tile.x); + query.bind(4, tile.y); + query.bind(5, tile.z); + + if (!query.run()) { + return nullopt; + } + + Response response; + uint64_t size = 0; + + response.etag = query.get>(0); + response.expires = query.get>(1); + response.mustRevalidate = query.get(2); + response.modified = query.get>(3); + + optional data = query.get>(4); + if (!data) { + response.noContent = true; + } else if (query.get(5)) { + response.data = std::make_shared(util::decompress(*data)); + size = data->length(); + } else { + response.data = std::make_shared(*data); + size = data->length(); + } + + return std::make_pair(response, size); +} + +optional OfflineDatabase::hasTile(const Resource::TileData& tile) { + // clang-format off + mapbox::sqlite::Query size{ getStatement( + "SELECT length(data) " + "FROM tiles " + "WHERE url_template = ?1 " + " AND pixel_ratio = ?2 " + " AND x = ?3 " + " AND y = ?4 " + " AND z = ?5 ") }; + // clang-format on + + size.bind(1, tile.urlTemplate); + size.bind(2, tile.pixelRatio); + size.bind(3, tile.x); + size.bind(4, tile.y); + size.bind(5, tile.z); + + if (!size.run()) { + return nullopt; + } + + return size.get>(0); +} + +bool OfflineDatabase::putTile(const Resource::TileData& tile, + const Response& response, + const std::string& data, + bool compressed) { + if (response.notModified) { + // clang-format off + mapbox::sqlite::Query notModifiedQuery{ getStatement( + "UPDATE tiles " + "SET accessed = ?1, " + " expires = ?2, " + " must_revalidate = ?3 " + "WHERE url_template = ?4 " + " AND pixel_ratio = ?5 " + " AND x = ?6 " + " AND y = ?7 " + " AND z = ?8 ") }; + // clang-format on + + notModifiedQuery.bind(1, util::now()); + notModifiedQuery.bind(2, response.expires); + notModifiedQuery.bind(3, response.mustRevalidate); + notModifiedQuery.bind(4, tile.urlTemplate); + notModifiedQuery.bind(5, tile.pixelRatio); + notModifiedQuery.bind(6, tile.x); + notModifiedQuery.bind(7, tile.y); + notModifiedQuery.bind(8, tile.z); + notModifiedQuery.run(); + return false; + } + + // We can't use REPLACE because it would change the id value. + + // clang-format off + mapbox::sqlite::Query updateQuery{ getStatement( + "UPDATE tiles " + "SET modified = ?1, " + " etag = ?2, " + " expires = ?3, " + " must_revalidate = ?4, " + " accessed = ?5, " + " data = ?6, " + " compressed = ?7 " + "WHERE url_template = ?8 " + " AND pixel_ratio = ?9 " + " AND x = ?10 " + " AND y = ?11 " + " AND z = ?12 ") }; + // clang-format on + + updateQuery.bind(1, response.modified); + updateQuery.bind(2, response.etag); + updateQuery.bind(3, response.expires); + updateQuery.bind(4, response.mustRevalidate); + updateQuery.bind(5, util::now()); + updateQuery.bind(8, tile.urlTemplate); + updateQuery.bind(9, tile.pixelRatio); + updateQuery.bind(10, tile.x); + updateQuery.bind(11, tile.y); + updateQuery.bind(12, tile.z); + + if (response.noContent) { + updateQuery.bind(6, nullptr); + updateQuery.bind(7, false); + } else { + updateQuery.bindBlob(6, data.data(), data.size(), false); + updateQuery.bind(7, compressed); + } + + updateQuery.run(); + if (updateQuery.changes() != 0) { + return false; + } + + // clang-format off + mapbox::sqlite::Query insertQuery{ getStatement( + "INSERT INTO tiles (url_template, pixel_ratio, x, y, z, modified, must_revalidate, etag, expires, accessed, data, compressed) " + "VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12)") }; + // clang-format on + + insertQuery.bind(1, tile.urlTemplate); + insertQuery.bind(2, tile.pixelRatio); + insertQuery.bind(3, tile.x); + insertQuery.bind(4, tile.y); + insertQuery.bind(5, tile.z); + insertQuery.bind(6, response.modified); + insertQuery.bind(7, response.mustRevalidate); + insertQuery.bind(8, response.etag); + insertQuery.bind(9, response.expires); + insertQuery.bind(10, util::now()); + + if (response.noContent) { + insertQuery.bind(11, nullptr); + insertQuery.bind(12, false); + } else { + insertQuery.bindBlob(11, data.data(), data.size(), false); + insertQuery.bind(12, compressed); + } + + insertQuery.run(); + + return true; +} + +expected OfflineDatabase::listRegions() try { + mapbox::sqlite::Query query{ getStatement("SELECT id, definition, description FROM regions") }; + OfflineRegions result; + while (query.run()) { + const auto id = query.get(0); + const auto definition = query.get(1); + const auto description = query.get>(2); + try { + // Construct, then move because this constructor is private. + OfflineRegion region(id, decodeOfflineRegionDefinition(definition), description); + result.emplace_back(std::move(region)); + } catch (const std::exception& ex) { + // Catch errors from malformed offline region definitions + // and skip them. + Log::Error(Event::General, "%s", ex.what()); + } + } + // Explicit move to avoid triggering the copy constructor. + return { std::move(result) }; +} catch (const mapbox::sqlite::Exception& ex) { + handleError(ex, "list regions"); + return unexpected(std::current_exception()); +} + +expected +OfflineDatabase::createRegion(const OfflineRegionDefinition& definition, + const OfflineRegionMetadata& metadata) try { + // clang-format off + mapbox::sqlite::Query query{ getStatement( + "INSERT INTO regions (definition, description) " + "VALUES (?1, ?2) ") }; + // clang-format on + + query.bind(1, encodeOfflineRegionDefinition(definition)); + query.bindBlob(2, metadata); + query.run(); + return OfflineRegion(query.lastInsertRowId(), definition, metadata); +} catch (const mapbox::sqlite::Exception& ex) { + handleError(ex, "create region"); + return unexpected(std::current_exception()); +} + +expected +OfflineDatabase::mergeDatabase(const std::string& sideDatabasePath) { + try { + // clang-format off + mapbox::sqlite::Query query{ getStatement("ATTACH DATABASE ?1 AS side") }; + // clang-format on + + query.bind(1, sideDatabasePath); + query.run(); + } catch (const mapbox::sqlite::Exception& ex) { + Log::Error(Event::Database, static_cast(ex.code), "Can't attach database (%s) for merge: %s", sideDatabasePath.c_str(), ex.what()); + return unexpected(std::current_exception()); + } + try { + // Support sideloaded databases at user_version = 6. Future schema version + // changes will need to implement migration paths for sideloaded databases at + // version 6. + auto sideUserVersion = static_cast(getPragma("PRAGMA side.user_version")); + const auto mainUserVersion = getPragma("PRAGMA user_version"); + if (sideUserVersion < 6 || sideUserVersion != mainUserVersion) { + throw std::runtime_error("Merge database has incorrect user_version"); + } + + auto currentTileCount = getOfflineMapboxTileCount(); + // clang-format off + mapbox::sqlite::Query queryTiles{ getStatement( + "SELECT COUNT(DISTINCT st.id) " + "FROM side.tiles st " + //only consider region tiles, and not ambient tiles. + "JOIN side.region_tiles srt ON srt.tile_id = st.id " + "LEFT JOIN tiles t ON st.url_template = t.url_template AND " + "st.pixel_ratio = t.pixel_ratio AND " + "st.z = t.z AND " + "st.x = t.x AND " + "st.y = t.y " + "WHERE t.id IS NULL " + "AND st.url_template LIKE 'mapbox://%' ") }; + // clang-format on + queryTiles.run(); + auto countOfTilesToMerge = queryTiles.get(0); + if ((countOfTilesToMerge + currentTileCount) > offlineMapboxTileCountLimit) { + throw MapboxTileLimitExceededException(); + } + queryTiles.reset(); + + mapbox::sqlite::Transaction transaction(*db); + db->exec(mergeSideloadedDatabaseSQL); + transaction.commit(); + + // clang-format off + mapbox::sqlite::Query queryRegions{ getStatement( + "SELECT DISTINCT r.id, r.definition, r.description " + "FROM side.regions sr " + "JOIN regions r ON sr.definition = r.definition AND sr.description IS r.description") }; + // clang-format on + + OfflineRegions result; + while (queryRegions.run()) { + // Construct, then move because this constructor is private. + OfflineRegion region(queryRegions.get(0), + decodeOfflineRegionDefinition(queryRegions.get(1)), + queryRegions.get>(2)); + result.emplace_back(std::move(region)); + } + db->exec("DETACH DATABASE side"); + // Explicit move to avoid triggering the copy constructor. + return { std::move(result) }; + } catch (const std::runtime_error& ex) { + db->exec("DETACH DATABASE side"); + Log::Error(Event::Database, "%s", ex.what()); + + return unexpected(std::current_exception()); + } + return {}; +} + +expected +OfflineDatabase::updateMetadata(const int64_t regionID, const OfflineRegionMetadata& metadata) try { + // clang-format off + mapbox::sqlite::Query query{ getStatement( + "UPDATE regions SET description = ?1 " + "WHERE id = ?2") }; + // clang-format on + query.bindBlob(1, metadata); + query.bind(2, regionID); + query.run(); + + return metadata; +} catch (const mapbox::sqlite::Exception& ex) { + handleError(ex, "update region metadata"); + return unexpected(std::current_exception()); +} + +std::exception_ptr OfflineDatabase::deleteRegion(OfflineRegion&& region) try { + { + mapbox::sqlite::Query query{ getStatement("DELETE FROM regions WHERE id = ?") }; + query.bind(1, region.getID()); + query.run(); + } + + evict(0); + assert(db); + db->exec("PRAGMA incremental_vacuum"); + + // Ensure that the cached offlineTileCount value is recalculated. + offlineMapboxTileCount = {}; + return nullptr; +} catch (const mapbox::sqlite::Exception& ex) { + handleError(ex, "delete region"); + return std::current_exception(); +} + +optional> OfflineDatabase::getRegionResource(int64_t regionID, const Resource& resource) try { + auto response = getInternal(resource); + + if (response) { + markUsed(regionID, resource); + } + + return response; +} catch (const mapbox::sqlite::Exception& ex) { + handleError(ex, "read region resource"); + return nullopt; +} + +optional OfflineDatabase::hasRegionResource(int64_t regionID, const Resource& resource) try { + auto response = hasInternal(resource); + + if (response) { + markUsed(regionID, resource); + } + + return response; +} catch (const mapbox::sqlite::Exception& ex) { + handleError(ex, "query region resource"); + return nullopt; +} + +uint64_t OfflineDatabase::putRegionResource(int64_t regionID, + const Resource& resource, + const Response& response) try { + if (!db) { + initialize(); + } + mapbox::sqlite::Transaction transaction(*db); + auto size = putRegionResourceInternal(regionID, resource, response); + transaction.commit(); + return size; +} catch (const mapbox::sqlite::Exception& ex) { + handleError(ex, "write region resource"); + return 0; +} + +void OfflineDatabase::putRegionResources(int64_t regionID, + const std::list>& resources, + OfflineRegionStatus& status) try { + if (!db) { + initialize(); + } + mapbox::sqlite::Transaction transaction(*db); + + // Accumulate all statistics locally first before adding them to the OfflineRegionStatus object + // to ensure correctness when the transaction fails. + uint64_t completedResourceCount = 0; + uint64_t completedResourceSize = 0; + uint64_t completedTileCount = 0; + uint64_t completedTileSize = 0; + + for (const auto& elem : resources) { + const auto& resource = std::get<0>(elem); + const auto& response = std::get<1>(elem); + + try { + uint64_t resourceSize = putRegionResourceInternal(regionID, resource, response); + completedResourceCount++; + completedResourceSize += resourceSize; + if (resource.kind == Resource::Kind::Tile) { + completedTileCount += 1; + completedTileSize += resourceSize; + } + } catch (const MapboxTileLimitExceededException&) { + // Commit the rest of the batch and rethrow + transaction.commit(); + throw; + } + } + + // Commit the completed batch + transaction.commit(); + + status.completedResourceCount += completedResourceCount; + status.completedResourceSize += completedResourceSize; + status.completedTileCount += completedTileCount; + status.completedTileSize += completedTileSize; +} catch (const mapbox::sqlite::Exception& ex) { + handleError(ex, "write region resources"); +} + +uint64_t OfflineDatabase::putRegionResourceInternal(int64_t regionID, const Resource& resource, const Response& response) { + if (exceedsOfflineMapboxTileCountLimit(resource)) { + throw MapboxTileLimitExceededException(); + } + + uint64_t size = putInternal(resource, response, false).second; + bool previouslyUnused = markUsed(regionID, resource); + + if (offlineMapboxTileCount + && resource.kind == Resource::Kind::Tile + && util::mapbox::isMapboxURL(resource.url) + && previouslyUnused) { + *offlineMapboxTileCount += 1; + } + + return size; +} + +bool OfflineDatabase::markUsed(int64_t regionID, const Resource& resource) { + if (resource.kind == Resource::Kind::Tile) { + // clang-format off + mapbox::sqlite::Query insertQuery{ getStatement( + "INSERT OR IGNORE INTO region_tiles (region_id, tile_id) " + "SELECT ?1, tiles.id " + "FROM tiles " + "WHERE url_template = ?2 " + " AND pixel_ratio = ?3 " + " AND x = ?4 " + " AND y = ?5 " + " AND z = ?6 ") }; + // clang-format on + + const Resource::TileData& tile = *resource.tileData; + insertQuery.bind(1, regionID); + insertQuery.bind(2, tile.urlTemplate); + insertQuery.bind(3, tile.pixelRatio); + insertQuery.bind(4, tile.x); + insertQuery.bind(5, tile.y); + insertQuery.bind(6, tile.z); + insertQuery.run(); + + if (insertQuery.changes() == 0) { + return false; + } + + // clang-format off + mapbox::sqlite::Query selectQuery{ getStatement( + "SELECT region_id " + "FROM region_tiles, tiles " + "WHERE region_id != ?1 " + " AND url_template = ?2 " + " AND pixel_ratio = ?3 " + " AND x = ?4 " + " AND y = ?5 " + " AND z = ?6 " + "LIMIT 1 ") }; + // clang-format on + + selectQuery.bind(1, regionID); + selectQuery.bind(2, tile.urlTemplate); + selectQuery.bind(3, tile.pixelRatio); + selectQuery.bind(4, tile.x); + selectQuery.bind(5, tile.y); + selectQuery.bind(6, tile.z); + return !selectQuery.run(); + } else { + // clang-format off + mapbox::sqlite::Query insertQuery{ getStatement( + "INSERT OR IGNORE INTO region_resources (region_id, resource_id) " + "SELECT ?1, resources.id " + "FROM resources " + "WHERE resources.url = ?2 ") }; + // clang-format on + + insertQuery.bind(1, regionID); + insertQuery.bind(2, resource.url); + insertQuery.run(); + + if (insertQuery.changes() == 0) { + return false; + } + + // clang-format off + mapbox::sqlite::Query selectQuery{ getStatement( + "SELECT region_id " + "FROM region_resources, resources " + "WHERE region_id != ?1 " + " AND resources.url = ?2 " + "LIMIT 1 ") }; + // clang-format on + + selectQuery.bind(1, regionID); + selectQuery.bind(2, resource.url); + return !selectQuery.run(); + } +} + +expected OfflineDatabase::getRegionDefinition(int64_t regionID) try { + mapbox::sqlite::Query query{ getStatement("SELECT definition FROM regions WHERE id = ?1") }; + query.bind(1, regionID); + query.run(); + + return decodeOfflineRegionDefinition(query.get(0)); +} catch (const mapbox::sqlite::Exception& ex) { + handleError(ex, "load region"); + return unexpected(std::current_exception()); +} + +expected OfflineDatabase::getRegionCompletedStatus(int64_t regionID) try { + OfflineRegionStatus result; + + std::tie(result.completedResourceCount, result.completedResourceSize) + = getCompletedResourceCountAndSize(regionID); + std::tie(result.completedTileCount, result.completedTileSize) + = getCompletedTileCountAndSize(regionID); + + result.completedResourceCount += result.completedTileCount; + result.completedResourceSize += result.completedTileSize; + + return result; +} catch (const mapbox::sqlite::Exception& ex) { + handleError(ex, "get region status"); + return unexpected(std::current_exception()); +} + +std::pair OfflineDatabase::getCompletedResourceCountAndSize(int64_t regionID) { + // clang-format off + mapbox::sqlite::Query query{ getStatement( + "SELECT COUNT(*), SUM(LENGTH(data)) " + "FROM region_resources, resources " + "WHERE region_id = ?1 " + "AND resource_id = resources.id ") }; + // clang-format on + query.bind(1, regionID); + query.run(); + return { query.get(0), query.get(1) }; +} + +std::pair OfflineDatabase::getCompletedTileCountAndSize(int64_t regionID) { + // clang-format off + mapbox::sqlite::Query query{ getStatement( + "SELECT COUNT(*), SUM(LENGTH(data)) " + "FROM region_tiles, tiles " + "WHERE region_id = ?1 " + "AND tile_id = tiles.id ") }; + // clang-format on + query.bind(1, regionID); + query.run(); + return { query.get(0), query.get(1) }; +} + +template +T OfflineDatabase::getPragma(const char* sql) { + mapbox::sqlite::Query query{ getStatement(sql) }; + query.run(); + return query.get(0); +} + +// Remove least-recently used resources and tiles until the used database size, +// as calculated by multiplying the number of in-use pages by the page size, is +// less than the maximum cache size. Returns false if this condition cannot be +// satisfied. +// +// SQLite database never shrinks in size unless we call VACCUM. We here +// are monitoring the soft limit (i.e. number of free pages in the file) +// and as it approaches to the hard limit (i.e. the actual file size) we +// delete an arbitrary number of old cache entries. The free pages approach saves +// us from calling VACCUM or keeping a running total, which can be costly. +bool OfflineDatabase::evict(uint64_t neededFreeSize) { + uint64_t pageSize = getPragma("PRAGMA page_size"); + uint64_t pageCount = getPragma("PRAGMA page_count"); + + auto usedSize = [&] { + return pageSize * (pageCount - getPragma("PRAGMA freelist_count")); + }; + + // The addition of pageSize is a fudge factor to account for non `data` column + // size, and because pages can get fragmented on the database. + while (usedSize() + neededFreeSize + pageSize > maximumCacheSize) { + // clang-format off + mapbox::sqlite::Query accessedQuery{ getStatement( + "SELECT max(accessed) " + "FROM ( " + " SELECT accessed " + " FROM resources " + " LEFT JOIN region_resources " + " ON resource_id = resources.id " + " WHERE resource_id IS NULL " + " UNION ALL " + " SELECT accessed " + " FROM tiles " + " LEFT JOIN region_tiles " + " ON tile_id = tiles.id " + " WHERE tile_id IS NULL " + " ORDER BY accessed ASC LIMIT ?1 " + ") " + ) }; + accessedQuery.bind(1, 50); + // clang-format on + if (!accessedQuery.run()) { + return false; + } + Timestamp accessed = accessedQuery.get(0); + + // clang-format off + mapbox::sqlite::Query resourceQuery{ getStatement( + "DELETE FROM resources " + "WHERE id IN ( " + " SELECT id FROM resources " + " LEFT JOIN region_resources " + " ON resource_id = resources.id " + " WHERE resource_id IS NULL " + " AND accessed <= ?1 " + ") ") }; + // clang-format on + resourceQuery.bind(1, accessed); + resourceQuery.run(); + const uint64_t resourceChanges = resourceQuery.changes(); + + // clang-format off + mapbox::sqlite::Query tileQuery{ getStatement( + "DELETE FROM tiles " + "WHERE id IN ( " + " SELECT id FROM tiles " + " LEFT JOIN region_tiles " + " ON tile_id = tiles.id " + " WHERE tile_id IS NULL " + " AND accessed <= ?1 " + ") ") }; + // clang-format on + tileQuery.bind(1, accessed); + tileQuery.run(); + const uint64_t tileChanges = tileQuery.changes(); + + // The cached value of offlineTileCount does not need to be updated + // here because only non-offline tiles can be removed by eviction. + + if (resourceChanges == 0 && tileChanges == 0) { + return false; + } + } + + return true; +} + +void OfflineDatabase::setOfflineMapboxTileCountLimit(uint64_t limit) { + offlineMapboxTileCountLimit = limit; +} + +uint64_t OfflineDatabase::getOfflineMapboxTileCountLimit() { + return offlineMapboxTileCountLimit; +} + +bool OfflineDatabase::offlineMapboxTileCountLimitExceeded() { + return getOfflineMapboxTileCount() >= offlineMapboxTileCountLimit; +} + +uint64_t OfflineDatabase::getOfflineMapboxTileCount() try { + // Calculating this on every call would be much simpler than caching and + // manually updating the value, but it would make offline downloads an O(n²) + // operation, because the database query below involves an index scan of + // region_tiles. + + if (offlineMapboxTileCount) { + return *offlineMapboxTileCount; + } + + // clang-format off + mapbox::sqlite::Query query{ getStatement( + "SELECT COUNT(DISTINCT id) " + "FROM region_tiles, tiles " + "WHERE tile_id = tiles.id " + "AND url_template LIKE 'mapbox://%' ") }; + // clang-format on + + query.run(); + + offlineMapboxTileCount = query.get(0); + return *offlineMapboxTileCount; +} catch (const mapbox::sqlite::Exception& ex) { + handleError(ex, "get offline Mapbox tile count"); + return std::numeric_limits::max(); +} + +bool OfflineDatabase::exceedsOfflineMapboxTileCountLimit(const Resource& resource) { + return resource.kind == Resource::Kind::Tile + && util::mapbox::isMapboxURL(resource.url) + && offlineMapboxTileCountLimitExceeded(); +} + +} // namespace mbgl diff --git a/platform/default/src/mbgl/storage/offline_download.cpp b/platform/default/src/mbgl/storage/offline_download.cpp new file mode 100644 index 0000000000..c97797a5a2 --- /dev/null +++ b/platform/default/src/mbgl/storage/offline_download.cpp @@ -0,0 +1,453 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace mbgl { + +using namespace style; + +// Generic functions + +template +Range coveringZoomRange(const RegionDefinition& definition, + style::SourceType type, uint16_t tileSize, const Range& zoomRange) { + double minZ = std::max(util::coveringZoomLevel(definition.minZoom, type, tileSize), zoomRange.min); + double maxZ = std::min(util::coveringZoomLevel(definition.maxZoom, type, tileSize), zoomRange.max); + + assert(minZ >= 0); + assert(maxZ >= 0); + assert(minZ < std::numeric_limits::max()); + assert(maxZ < std::numeric_limits::max()); + return { static_cast(minZ), static_cast(maxZ) }; +} + +template +void tileCover(const Geometry& geometry, uint8_t z, Fn&& fn) { + util::TileCover cover(geometry, z); + while (cover.hasNext()) { + fn(cover.next()->canonical); + } +} + + +template +void tileCover(const OfflineRegionDefinition& definition, style::SourceType type, + uint16_t tileSize, const Range& zoomRange, Fn&& fn) { + const Range clampedZoomRange = + definition.match([&](auto& reg) { return coveringZoomRange(reg, type, tileSize, zoomRange); }); + + for (uint8_t z = clampedZoomRange.min; z <= clampedZoomRange.max; z++) { + definition.match( + [&](const OfflineTilePyramidRegionDefinition& reg){ tileCover(reg.bounds, z, fn); }, + [&](const OfflineGeometryRegionDefinition& reg){ tileCover(reg.geometry, z, fn); } + ); + } +} + +uint64_t tileCount(const OfflineRegionDefinition& definition, style::SourceType type, + uint16_t tileSize, const Range& zoomRange) { + + const Range clampedZoomRange = + definition.match([&](auto& reg) { return coveringZoomRange(reg, type, tileSize, zoomRange); }); + + unsigned long result = 0;; + for (uint8_t z = clampedZoomRange.min; z <= clampedZoomRange.max; z++) { + result += definition.match( + [&](const OfflineTilePyramidRegionDefinition& reg){ return util::tileCount(reg.bounds, z); }, + [&](const OfflineGeometryRegionDefinition& reg){ return util::tileCount(reg.geometry, z); } + ); + } + + return result; +} + +// OfflineDownload + +OfflineDownload::OfflineDownload(int64_t id_, + OfflineRegionDefinition&& definition_, + OfflineDatabase& offlineDatabase_, + OnlineFileSource& onlineFileSource_) + : id(id_), + definition(definition_), + offlineDatabase(offlineDatabase_), + onlineFileSource(onlineFileSource_) { + setObserver(nullptr); +} + +OfflineDownload::~OfflineDownload() = default; + +void OfflineDownload::setObserver(std::unique_ptr observer_) { + observer = observer_ ? std::move(observer_) : std::make_unique(); +} + +void OfflineDownload::setState(OfflineRegionDownloadState state) { + if (status.downloadState == state) { + return; + } + + status.downloadState = state; + + if (status.downloadState == OfflineRegionDownloadState::Active) { + activateDownload(); + } else { + deactivateDownload(); + } + + observer->statusChanged(status); +} + +OfflineRegionStatus OfflineDownload::getStatus() const { + if (status.downloadState == OfflineRegionDownloadState::Active) { + return status; + } + + auto result = offlineDatabase.getRegionCompletedStatus(id); + if (!result) { + // We can't find this offline region because the database is unavailable, or the download + // does not exist. + return {}; + } + + result->requiredResourceCount++; + optional styleResponse = + offlineDatabase.get(Resource::style(definition.match([](auto& reg){ return reg.styleURL; }))); + if (!styleResponse) { + return *result; + } + + style::Parser parser; + parser.parse(*styleResponse->data); + + result->requiredResourceCountIsPrecise = true; + + for (const auto& source : parser.sources) { + SourceType type = source->getType(); + + auto handleTiledSource = [&] (const variant& urlOrTileset, const uint16_t tileSize) { + if (urlOrTileset.is()) { + result->requiredResourceCount += + tileCount(definition, type, tileSize, urlOrTileset.get().zoomRange); + } else { + result->requiredResourceCount += 1; + const auto& url = urlOrTileset.get(); + optional sourceResponse = offlineDatabase.get(Resource::source(url)); + if (sourceResponse) { + style::conversion::Error error; + optional tileset = style::conversion::convertJSON(*sourceResponse->data, error); + if (tileset) { + result->requiredResourceCount += + tileCount(definition, type, tileSize, (*tileset).zoomRange); + } + } else { + result->requiredResourceCountIsPrecise = false; + } + } + }; + + switch (type) { + case SourceType::Vector: { + const auto& vectorSource = *source->as(); + handleTiledSource(vectorSource.getURLOrTileset(), util::tileSize); + break; + } + + case SourceType::Raster: { + const auto& rasterSource = *source->as(); + handleTiledSource(rasterSource.getURLOrTileset(), rasterSource.getTileSize()); + break; + } + + case SourceType::RasterDEM: { + const auto& rasterDEMSource = *source->as(); + handleTiledSource(rasterDEMSource.getURLOrTileset(), rasterDEMSource.getTileSize()); + break; + } + + case SourceType::GeoJSON: { + const auto& geojsonSource = *source->as(); + if (geojsonSource.getURL()) { + result->requiredResourceCount += 1; + } + break; + } + + case SourceType::Image: { + const auto& imageSource = *source->as(); + if (imageSource.getURL()) { + result->requiredResourceCount += 1; + } + break; + } + + case SourceType::Video: + case SourceType::Annotations: + case SourceType::CustomVector: + break; + } + } + + if (!parser.glyphURL.empty()) { + result->requiredResourceCount += parser.fontStacks().size() * GLYPH_RANGES_PER_FONT_STACK; + } + + if (!parser.spriteURL.empty()) { + result->requiredResourceCount += 4; + } + + return *result; +} + +void OfflineDownload::activateDownload() { + status = OfflineRegionStatus(); + status.downloadState = OfflineRegionDownloadState::Active; + status.requiredResourceCount++; + ensureResource(Resource::style(definition.match([](auto& reg){ return reg.styleURL; }), Resource::Priority::Low), + [&](Response styleResponse) { + status.requiredResourceCountIsPrecise = true; + + style::Parser parser; + parser.parse(*styleResponse.data); + + for (const auto& source : parser.sources) { + SourceType type = source->getType(); + + auto handleTiledSource = [&] (const variant& urlOrTileset, const uint16_t tileSize) { + if (urlOrTileset.is()) { + queueTiles(type, tileSize, urlOrTileset.get()); + } else { + const auto& url = urlOrTileset.get(); + status.requiredResourceCountIsPrecise = false; + status.requiredResourceCount++; + requiredSourceURLs.insert(url); + + ensureResource(Resource::source(url, Resource::Priority::Low), [=](Response sourceResponse) { + style::conversion::Error error; + optional tileset = style::conversion::convertJSON(*sourceResponse.data, error); + if (tileset) { + util::mapbox::canonicalizeTileset(*tileset, url, type, tileSize); + queueTiles(type, tileSize, *tileset); + + requiredSourceURLs.erase(url); + if (requiredSourceURLs.empty()) { + status.requiredResourceCountIsPrecise = true; + } + } + }); + } + }; + + switch (type) { + case SourceType::Vector: { + const auto& vectorSource = *source->as(); + handleTiledSource(vectorSource.getURLOrTileset(), util::tileSize); + break; + } + + case SourceType::Raster: { + const auto& rasterSource = *source->as(); + handleTiledSource(rasterSource.getURLOrTileset(), rasterSource.getTileSize()); + break; + } + + case SourceType::RasterDEM: { + const auto& rasterDEMSource = *source->as(); + handleTiledSource(rasterDEMSource.getURLOrTileset(), rasterDEMSource.getTileSize()); + break; + } + + case SourceType::GeoJSON: { + const auto& geojsonSource = *source->as(); + if (geojsonSource.getURL()) { + queueResource(Resource::source(*geojsonSource.getURL())); + } + break; + } + + case SourceType::Image: { + const auto& imageSource = *source->as(); + auto imageUrl = imageSource.getURL(); + if (imageUrl && !imageUrl->empty()) { + queueResource(Resource::image(*imageUrl)); + } + break; + } + + case SourceType::Video: + case SourceType::Annotations: + case SourceType::CustomVector: + break; + } + } + + if (!parser.glyphURL.empty()) { + for (const auto& fontStack : parser.fontStacks()) { + for (char16_t i = 0; i < GLYPH_RANGES_PER_FONT_STACK; i++) { + queueResource(Resource::glyphs(parser.glyphURL, fontStack, getGlyphRange(i * GLYPHS_PER_GLYPH_RANGE))); + } + } + } + + if (!parser.spriteURL.empty()) { + // Always request 1x and @2x sprite images for portability. + queueResource(Resource::spriteImage(parser.spriteURL, 1)); + queueResource(Resource::spriteImage(parser.spriteURL, 2)); + queueResource(Resource::spriteJSON(parser.spriteURL, 1)); + queueResource(Resource::spriteJSON(parser.spriteURL, 2)); + } + + continueDownload(); + }); +} + +/* + Fill up our own request queue by requesting the next few resources. This is called + when activating the download, or when a request completes successfully. + + Note "successfully"; it's not called when a requests receives an error. A request + that errors will be retried after some delay. So in that sense it's still "active" + and consuming resources, notably the request object, its timer, and network resources + when the timer fires. + + We could try to squeeze in subsequent requests while we wait for the errored request + to retry. But that risks overloading the upstream request queue -- defeating our own + metering -- if there are a lot of errored requests that all come up for retry at the + same time. And many times, the cause of a request error will apply to many requests + of the same type. For instance if a server is unreachable, all the requests to that + host are going to error. In that case, continuing to try subsequent resources after + the first few errors is fruitless anyway. +*/ +void OfflineDownload::continueDownload() { + if (resourcesRemaining.empty() && status.complete()) { + setState(OfflineRegionDownloadState::Inactive); + return; + } + + while (!resourcesRemaining.empty() && requests.size() < onlineFileSource.getMaximumConcurrentRequests()) { + ensureResource(resourcesRemaining.front()); + resourcesRemaining.pop_front(); + } +} + +void OfflineDownload::deactivateDownload() { + requiredSourceURLs.clear(); + resourcesRemaining.clear(); + requests.clear(); +} + +void OfflineDownload::queueResource(Resource resource) { + resource.setPriority(Resource::Priority::Low); + status.requiredResourceCount++; + resourcesRemaining.push_front(std::move(resource)); +} + +void OfflineDownload::queueTiles(SourceType type, uint16_t tileSize, const Tileset& tileset) { + tileCover(definition, type, tileSize, tileset.zoomRange, [&](const auto& tile) { + status.requiredResourceCount++; + resourcesRemaining.push_back(Resource::tile( + tileset.tiles[0], definition.match([](auto& def) { return def.pixelRatio; }), tile.x, + tile.y, tile.z, tileset.scheme, Resource::Priority::Low)); + }); +} + +void OfflineDownload::ensureResource(const Resource& resource, + std::function callback) { + assert(resource.priority == Resource::Priority::Low); + + auto workRequestsIt = requests.insert(requests.begin(), nullptr); + *workRequestsIt = util::RunLoop::Get()->invokeCancellable([=]() { + requests.erase(workRequestsIt); + + auto getResourceSizeInDatabase = [&] () -> optional { + if (!callback) { + return offlineDatabase.hasRegionResource(id, resource); + } + optional> response = offlineDatabase.getRegionResource(id, resource); + if (!response) { + return {}; + } + callback(response->first); + return response->second; + }; + + optional offlineResponse = getResourceSizeInDatabase(); + if (offlineResponse) { + status.completedResourceCount++; + status.completedResourceSize += *offlineResponse; + if (resource.kind == Resource::Kind::Tile) { + status.completedTileCount += 1; + status.completedTileSize += *offlineResponse; + } + + observer->statusChanged(status); + continueDownload(); + return; + } + + if (offlineDatabase.exceedsOfflineMapboxTileCountLimit(resource)) { + onMapboxTileCountLimitExceeded(); + return; + } + + auto fileRequestsIt = requests.insert(requests.begin(), nullptr); + *fileRequestsIt = onlineFileSource.request(resource, [=](Response onlineResponse) { + if (onlineResponse.error) { + observer->responseError(*onlineResponse.error); + return; + } + + requests.erase(fileRequestsIt); + + if (callback) { + callback(onlineResponse); + } + + // Queue up for batched insertion + buffer.emplace_back(resource, onlineResponse); + + // Flush buffer periodically + if (buffer.size() == 64 || resourcesRemaining.size() == 0) { + try { + offlineDatabase.putRegionResources(id, buffer, status); + } catch (const MapboxTileLimitExceededException&) { + onMapboxTileCountLimitExceeded(); + return; + } + + buffer.clear(); + observer->statusChanged(status); + } + + if (offlineDatabase.exceedsOfflineMapboxTileCountLimit(resource)) { + onMapboxTileCountLimitExceeded(); + return; + } + + continueDownload(); + }); + }); +} + +void OfflineDownload::onMapboxTileCountLimitExceeded() { + observer->mapboxTileCountLimitExceeded(offlineDatabase.getOfflineMapboxTileCountLimit()); + setState(OfflineRegionDownloadState::Inactive); +} + +} // namespace mbgl diff --git a/platform/default/src/mbgl/storage/online_file_source.cpp b/platform/default/src/mbgl/storage/online_file_source.cpp new file mode 100644 index 0000000000..fce1c3e2b6 --- /dev/null +++ b/platform/default/src/mbgl/storage/online_file_source.cpp @@ -0,0 +1,488 @@ +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace mbgl { + +static uint32_t DEFAULT_MAXIMUM_CONCURRENT_REQUESTS = 20; + +class OnlineFileRequest : public AsyncRequest { +public: + using Callback = std::function; + + OnlineFileRequest(Resource, Callback, OnlineFileSource::Impl&); + ~OnlineFileRequest() override; + + void networkIsReachableAgain(); + void schedule(); + void schedule(optional expires); + void completed(Response); + + void setTransformedURL(const std::string&& url); + ActorRef actor(); + + OnlineFileSource::Impl& impl; + Resource resource; + std::unique_ptr request; + util::Timer timer; + Callback callback; + + std::shared_ptr mailbox; + + // Counts the number of times a response was already expired when received. We're using + // this to add a delay when making a new request so we don't keep retrying immediately + // in case of a server serving expired tiles. + uint32_t expiredRequests = 0; + + // Counts the number of subsequent failed requests. We're using this value for exponential + // backoff when retrying requests. + uint32_t failedRequests = 0; + Response::Error::Reason failedRequestReason = Response::Error::Reason::Success; + optional retryAfter; +}; + +class OnlineFileSource::Impl { +public: + Impl() { + NetworkStatus::Subscribe(&reachability); + setMaximumConcurrentRequests(DEFAULT_MAXIMUM_CONCURRENT_REQUESTS); + } + + ~Impl() { + NetworkStatus::Unsubscribe(&reachability); + } + + void add(OnlineFileRequest* request) { + allRequests.insert(request); + if (resourceTransform) { + // Request the ResourceTransform actor a new url and replace the resource url with the + // transformed one before proceeding to schedule the request. + resourceTransform->invoke(&ResourceTransform::transform, request->resource.kind, + std::move(request->resource.url), [ref = request->actor()](const std::string&& url) mutable { + ref.invoke(&OnlineFileRequest::setTransformedURL, std::move(url)); + }); + } else { + request->schedule(); + } + } + + void remove(OnlineFileRequest* request) { + allRequests.erase(request); + if (activeRequests.erase(request)) { + activatePendingRequest(); + } else { + pendingRequests.remove(request); + } + } + + void activateOrQueueRequest(OnlineFileRequest* request) { + assert(allRequests.find(request) != allRequests.end()); + assert(activeRequests.find(request) == activeRequests.end()); + assert(!request->request); + + if (activeRequests.size() >= getMaximumConcurrentRequests()) { + queueRequest(request); + } else { + activateRequest(request); + } + } + + void queueRequest(OnlineFileRequest* request) { + pendingRequests.insert(request); + } + + void activateRequest(OnlineFileRequest* request) { + auto callback = [=](Response response) { + activeRequests.erase(request); + request->request.reset(); + request->completed(response); + activatePendingRequest(); + }; + + activeRequests.insert(request); + + if (online) { + request->request = httpFileSource.request(request->resource, callback); + } else { + Response response; + response.error = std::make_unique(Response::Error::Reason::Connection, + "Online connectivity is disabled."); + callback(response); + } + + } + + void activatePendingRequest() { + + auto request = pendingRequests.pop(); + + if (request) { + activateRequest(*request); + } + } + + bool isPending(OnlineFileRequest* request) { + return pendingRequests.contains(request); + } + + bool isActive(OnlineFileRequest* request) { + return activeRequests.find(request) != activeRequests.end(); + } + + void setResourceTransform(optional>&& transform) { + resourceTransform = std::move(transform); + } + + void setOnlineStatus(const bool status) { + online = status; + networkIsReachableAgain(); + } + + uint32_t getMaximumConcurrentRequests() const { + return maximumConcurrentRequests; + } + + void setMaximumConcurrentRequests(uint32_t maximumConcurrentRequests_) { + maximumConcurrentRequests = maximumConcurrentRequests_; + } + +private: + + void networkIsReachableAgain() { + for (auto& request : allRequests) { + request->networkIsReachableAgain(); + } + } + + // Using Pending Requests as an priority queue which processes + // file requests in a FIFO manner but prefers regular requests + // over offline requests with a low priority such that low priority + // requests do not throttle regular requests. + // + // The order of a queue is therefore: + // + // hi0 -- hi1 -- hi2 -- hi3 -- lo0 -- lo1 --lo2 + // ^ + // firstLowPriorityRequest + + struct PendingRequests { + PendingRequests() : queue(), firstLowPriorityRequest(queue.begin()) {} + + std::list queue; + std::list::iterator firstLowPriorityRequest; + + void remove(const OnlineFileRequest* request) { + auto it = std::find(queue.begin(), queue.end(), request); + if (it != queue.end()) { + if (it == firstLowPriorityRequest) { + firstLowPriorityRequest++; + } + queue.erase(it); + } + } + + void insert(OnlineFileRequest* request) { + if (request->resource.priority == Resource::Priority::Regular) { + firstLowPriorityRequest = queue.insert(firstLowPriorityRequest, request); + firstLowPriorityRequest++; + } + else { + if (firstLowPriorityRequest == queue.end()) { + firstLowPriorityRequest = queue.insert(queue.end(), request); + } + else { + queue.insert(queue.end(), request); + } + } + } + + + optional pop() { + if (queue.empty()) { + return optional(); + } + + if (queue.begin() == firstLowPriorityRequest) { + firstLowPriorityRequest++; + } + + OnlineFileRequest* next = queue.front(); + queue.pop_front(); + return optional(next); + } + + bool contains(OnlineFileRequest* request) const { + return (std::find(queue.begin(), queue.end(), request) != queue.end()); + } + + }; + + optional> resourceTransform; + + /** + * The lifetime of a request is: + * + * 1. Waiting for timeout (revalidation or retry) + * 2. Pending (waiting for room in the active set) + * 3. Active (open network connection) + * 4. Back to #1 + * + * Requests in any state are in `allRequests`. Requests in the pending state are in + * `pendingRequests`. Requests in the active state are in `activeRequests`. + */ + std::unordered_set allRequests; + + PendingRequests pendingRequests; + + std::unordered_set activeRequests; + + bool online = true; + uint32_t maximumConcurrentRequests; + HTTPFileSource httpFileSource; + util::AsyncTask reachability { std::bind(&Impl::networkIsReachableAgain, this) }; +}; + +OnlineFileSource::OnlineFileSource() + : impl(std::make_unique()) { +} + +OnlineFileSource::~OnlineFileSource() = default; + +std::unique_ptr OnlineFileSource::request(const Resource& resource, Callback callback) { + Resource res = resource; + + switch (resource.kind) { + case Resource::Kind::Unknown: + case Resource::Kind::Image: + break; + + case Resource::Kind::Style: + res.url = mbgl::util::mapbox::normalizeStyleURL(apiBaseURL, resource.url, accessToken); + break; + + case Resource::Kind::Source: + res.url = util::mapbox::normalizeSourceURL(apiBaseURL, resource.url, accessToken); + break; + + case Resource::Kind::Glyphs: + res.url = util::mapbox::normalizeGlyphsURL(apiBaseURL, resource.url, accessToken); + break; + + case Resource::Kind::SpriteImage: + case Resource::Kind::SpriteJSON: + res.url = util::mapbox::normalizeSpriteURL(apiBaseURL, resource.url, accessToken); + break; + + case Resource::Kind::Tile: + res.url = util::mapbox::normalizeTileURL(apiBaseURL, resource.url, accessToken); + break; + } + + return std::make_unique(std::move(res), std::move(callback), *impl); +} + +void OnlineFileSource::setResourceTransform(optional>&& transform) { + impl->setResourceTransform(std::move(transform)); +} + +OnlineFileRequest::OnlineFileRequest(Resource resource_, Callback callback_, OnlineFileSource::Impl& impl_) + : impl(impl_), + resource(std::move(resource_)), + callback(std::move(callback_)) { + impl.add(this); +} + +void OnlineFileRequest::schedule() { + // Force an immediate first request if we don't have an expiration time. + if (resource.priorExpires) { + schedule(resource.priorExpires); + } else { + schedule(util::now()); + } +} + +OnlineFileRequest::~OnlineFileRequest() { + impl.remove(this); +} + +Timestamp interpolateExpiration(const Timestamp& current, + optional prior, + bool& expired) { + auto now = util::now(); + if (current > now) { + return current; + } + + if (!bool(prior)) { + expired = true; + return current; + } + + // Expiring date is going backwards, + // fallback to exponential backoff. + if (current < *prior) { + expired = true; + return current; + } + + auto delta = current - *prior; + + // Server is serving the same expired resource + // over and over, fallback to exponential backoff. + if (delta == Duration::zero()) { + expired = true; + return current; + } + + // Assume that either the client or server clock is wrong and + // try to interpolate a valid expiration date (from the client POV) + // observing a minimum timeout. + return now + std::max(delta, util::CLOCK_SKEW_RETRY_TIMEOUT); +} + +void OnlineFileRequest::schedule(optional expires) { + if (impl.isPending(this) || impl.isActive(this)) { + // There's already a request in progress; don't start another one. + return; + } + + // If we're not being asked for a forced refresh, calculate a timeout that depends on how many + // consecutive errors we've encountered, and on the expiration time, if present. + Duration timeout = std::min( + http::errorRetryTimeout(failedRequestReason, failedRequests, retryAfter), + http::expirationTimeout(expires, expiredRequests)); + + if (timeout == Duration::max()) { + return; + } + + // Emulate a Connection error when the Offline mode is forced with + // a really long timeout. The request will get re-triggered when + // the NetworkStatus is set back to Online. + if (NetworkStatus::Get() == NetworkStatus::Status::Offline) { + failedRequestReason = Response::Error::Reason::Connection; + failedRequests = 1; + timeout = Duration::max(); + } + + timer.start(timeout, Duration::zero(), [&] { + impl.activateOrQueueRequest(this); + }); +} + +void OnlineFileRequest::completed(Response response) { + // If we didn't get various caching headers in the response, continue using the + // previous values. Otherwise, update the previous values to the new values. + + if (!response.modified) { + response.modified = resource.priorModified; + } else { + resource.priorModified = response.modified; + } + + if (response.notModified && resource.priorData) { + // When the priorData field is set, it indicates that we had to revalidate the request and + // that the requestor hasn't gotten data yet. If we get a 304 response, this means that we + // have send the cached data to give the requestor a chance to actually obtain the data. + response.data = std::move(resource.priorData); + response.notModified = false; + } + + bool isExpired = false; + + if (response.expires) { + auto prior = resource.priorExpires; + resource.priorExpires = response.expires; + response.expires = interpolateExpiration(*response.expires, prior, isExpired); + } + + if (isExpired) { + expiredRequests++; + } else { + expiredRequests = 0; + } + + if (!response.etag) { + response.etag = resource.priorEtag; + } else { + resource.priorEtag = response.etag; + } + + if (response.error) { + failedRequests++; + failedRequestReason = response.error->reason; + retryAfter = response.error->retryAfter; + } else { + failedRequests = 0; + failedRequestReason = Response::Error::Reason::Success; + } + + schedule(response.expires); + + // Calling the callback may result in `this` being deleted. It needs to be done last, + // and needs to make a local copy of the callback to ensure that it remains valid for + // the duration of the call. + auto callback_ = callback; + callback_(response); +} + +void OnlineFileRequest::networkIsReachableAgain() { + // We need all requests to fail at least once before we are going to start retrying + // them, and we only immediately restart request that failed due to connection issues. + if (failedRequestReason == Response::Error::Reason::Connection) { + schedule(util::now()); + } +} + +void OnlineFileRequest::setTransformedURL(const std::string&& url) { + resource.url = std::move(url); + schedule(); +} + +ActorRef OnlineFileRequest::actor() { + if (!mailbox) { + // Lazy constructed because this can be costly and + // the ResourceTransform is not used by many apps. + mailbox = std::make_shared(*Scheduler::GetCurrent()); + } + + return ActorRef(*this, mailbox); +} + +void OnlineFileSource::setMaximumConcurrentRequests(uint32_t maximumConcurrentRequests_) { + impl->setMaximumConcurrentRequests(maximumConcurrentRequests_); +} + +uint32_t OnlineFileSource::getMaximumConcurrentRequests() const { + return impl->getMaximumConcurrentRequests(); +} + + +// For testing only: + +void OnlineFileSource::setOnlineStatus(const bool status) { + impl->setOnlineStatus(status); +} + +} // namespace mbgl diff --git a/platform/default/src/mbgl/storage/sqlite3.cpp b/platform/default/src/mbgl/storage/sqlite3.cpp new file mode 100644 index 0000000000..0017dc45db --- /dev/null +++ b/platform/default/src/mbgl/storage/sqlite3.cpp @@ -0,0 +1,494 @@ +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace mapbox { +namespace sqlite { + +static_assert(mbgl::underlying_type(ResultCode::OK) == SQLITE_OK, "error"); +static_assert(mbgl::underlying_type(ResultCode::Error) == SQLITE_ERROR, "error"); +static_assert(mbgl::underlying_type(ResultCode::Internal) == SQLITE_INTERNAL, "error"); +static_assert(mbgl::underlying_type(ResultCode::Perm) == SQLITE_PERM, "error"); +static_assert(mbgl::underlying_type(ResultCode::Abort) == SQLITE_ABORT, "error"); +static_assert(mbgl::underlying_type(ResultCode::Busy) == SQLITE_BUSY, "error"); +static_assert(mbgl::underlying_type(ResultCode::Locked) == SQLITE_LOCKED, "error"); +static_assert(mbgl::underlying_type(ResultCode::NoMem) == SQLITE_NOMEM, "error"); +static_assert(mbgl::underlying_type(ResultCode::ReadOnly) == SQLITE_READONLY, "error"); +static_assert(mbgl::underlying_type(ResultCode::Interrupt) == SQLITE_INTERRUPT, "error"); +static_assert(mbgl::underlying_type(ResultCode::IOErr) == SQLITE_IOERR, "error"); +static_assert(mbgl::underlying_type(ResultCode::Corrupt) == SQLITE_CORRUPT, "error"); +static_assert(mbgl::underlying_type(ResultCode::NotFound) == SQLITE_NOTFOUND, "error"); +static_assert(mbgl::underlying_type(ResultCode::Full) == SQLITE_FULL, "error"); +static_assert(mbgl::underlying_type(ResultCode::CantOpen) == SQLITE_CANTOPEN, "error"); +static_assert(mbgl::underlying_type(ResultCode::Protocol) == SQLITE_PROTOCOL, "error"); +static_assert(mbgl::underlying_type(ResultCode::Schema) == SQLITE_SCHEMA, "error"); +static_assert(mbgl::underlying_type(ResultCode::TooBig) == SQLITE_TOOBIG, "error"); +static_assert(mbgl::underlying_type(ResultCode::Constraint) == SQLITE_CONSTRAINT, "error"); +static_assert(mbgl::underlying_type(ResultCode::Mismatch) == SQLITE_MISMATCH, "error"); +static_assert(mbgl::underlying_type(ResultCode::Misuse) == SQLITE_MISUSE, "error"); +static_assert(mbgl::underlying_type(ResultCode::NoLFS) == SQLITE_NOLFS, "error"); +static_assert(mbgl::underlying_type(ResultCode::Auth) == SQLITE_AUTH, "error"); +static_assert(mbgl::underlying_type(ResultCode::Range) == SQLITE_RANGE, "error"); +static_assert(mbgl::underlying_type(ResultCode::NotADB) == SQLITE_NOTADB, "error"); + +void setTempPath(const std::string& path) { + sqlite3_temp_directory = sqlite3_mprintf("%s", path.c_str()); +} + +class DatabaseImpl { +public: + DatabaseImpl(sqlite3* db_) + : db(db_) + { + const int error = sqlite3_extended_result_codes(db, true); + if (error != SQLITE_OK) { + mbgl::Log::Warning(mbgl::Event::Database, error, "Failed to enable extended result codes: %s", sqlite3_errmsg(db)); + } + } + + ~DatabaseImpl() + { + const int error = sqlite3_close(db); + if (error != SQLITE_OK) { + mbgl::Log::Error(mbgl::Event::Database, error, "Failed to close database: %s", sqlite3_errmsg(db)); + } + } + + void setBusyTimeout(std::chrono::milliseconds timeout); + void exec(const std::string& sql); + + sqlite3* db; +}; + +class StatementImpl { +public: + StatementImpl(sqlite3* db, const char* sql) + { + const int error = sqlite3_prepare_v2(db, sql, -1, &stmt, nullptr); + if (error != SQLITE_OK) { + stmt = nullptr; + throw Exception { error, sqlite3_errmsg(db) }; + } + } + + ~StatementImpl() + { + if (!stmt) return; + + sqlite3_finalize(stmt); + } + + void check(int err) { + if (err != SQLITE_OK) { + throw Exception { err, sqlite3_errmsg(sqlite3_db_handle(stmt)) }; + } + } + + sqlite3_stmt* stmt = nullptr; + int64_t lastInsertRowId = 0; + int64_t changes = 0; +}; + +template +using optional = std::experimental::optional; + + +#ifndef NDEBUG +void logSqlMessage(void *, const int err, const char *msg) { + mbgl::Log::Record(mbgl::EventSeverity::Debug, mbgl::Event::Database, err, "%s", msg); +} +#endif + +__attribute__((constructor)) +static void initalize() { + if (sqlite3_libversion_number() / 1000000 != SQLITE_VERSION_NUMBER / 1000000) { + char message[96]; + snprintf(message, 96, + "sqlite3 libversion mismatch: headers report %d, but library reports %d", + SQLITE_VERSION_NUMBER, sqlite3_libversion_number()); + throw std::runtime_error(message); + } + +#ifndef NDEBUG + // Enable SQLite logging before initializing the database. + sqlite3_config(SQLITE_CONFIG_LOG, &logSqlMessage, nullptr); +#endif +} + +mapbox::util::variant Database::tryOpen(const std::string &filename, int flags) { + sqlite3* db = nullptr; + const int error = sqlite3_open_v2(filename.c_str(), &db, flags | SQLITE_OPEN_URI, nullptr); + if (error != SQLITE_OK) { + const auto message = sqlite3_errmsg(db); + return Exception { error, message }; + } + return Database(std::make_unique(db)); +} + +Database Database::open(const std::string &filename, int flags) { + auto result = tryOpen(filename, flags); + if (result.is()) { + throw result.get(); + } else { + return std::move(result.get()); + } +} + +Database::Database(std::unique_ptr impl_) + : impl(std::move(impl_)) +{} + +Database::Database(Database &&other) + : impl(std::move(other.impl)) {} + +Database &Database::operator=(Database &&other) { + std::swap(impl, other.impl); + return *this; +} + +Database::~Database() = default; + +void Database::setBusyTimeout(std::chrono::milliseconds timeout) { + assert(impl); + impl->setBusyTimeout(timeout); +} + +void DatabaseImpl::setBusyTimeout(std::chrono::milliseconds timeout) { + const int err = sqlite3_busy_timeout(db, + int(std::min(timeout.count(), std::numeric_limits::max()))); + if (err != SQLITE_OK) { + throw Exception { err, sqlite3_errmsg(db) }; + } +} + +void Database::exec(const std::string &sql) { + assert(impl); + impl->exec(sql); +} + +void DatabaseImpl::exec(const std::string& sql) { + char *msg = nullptr; + const int err = sqlite3_exec(db, sql.c_str(), nullptr, nullptr, &msg); + if (msg) { + const std::string message = msg; + sqlite3_free(msg); + throw Exception { err, message }; + } else if (err != SQLITE_OK) { + throw Exception { err, sqlite3_errmsg(db) }; + } +} + +Statement::Statement(Database& db, const char* sql) + : impl(std::make_unique(db.impl->db, sql)) { +} + +Statement::~Statement() { +#ifndef NDEBUG + // Crash if we're destructing this object while we know a Query object references this. + assert(!used); +#endif +} + +Query::Query(Statement& stmt_) : stmt(stmt_) { + assert(stmt.impl); + +#ifndef NDEBUG + assert(!stmt.used); + stmt.used = true; +#endif +} + +Query::~Query() { + reset(); + clearBindings(); + +#ifndef NDEBUG + stmt.used = false; +#endif +} + +template <> void Query::bind(int offset, std::nullptr_t) { + assert(stmt.impl); + stmt.impl->check(sqlite3_bind_null(stmt.impl->stmt, offset)); +} + +template <> void Query::bind(int offset, int8_t value) { + assert(stmt.impl); + stmt.impl->check(sqlite3_bind_int64(stmt.impl->stmt, offset, value)); +} + +template <> void Query::bind(int offset, int16_t value) { + assert(stmt.impl); + stmt.impl->check(sqlite3_bind_int64(stmt.impl->stmt, offset, value)); +} + +template <> void Query::bind(int offset, int32_t value) { + assert(stmt.impl); + stmt.impl->check(sqlite3_bind_int64(stmt.impl->stmt, offset, value)); +} + +template <> void Query::bind(int offset, int64_t value) { + assert(stmt.impl); + stmt.impl->check(sqlite3_bind_int64(stmt.impl->stmt, offset, value)); +} + +template <> void Query::bind(int offset, uint8_t value) { + assert(stmt.impl); + stmt.impl->check(sqlite3_bind_int64(stmt.impl->stmt, offset, value)); +} + +template <> void Query::bind(int offset, uint16_t value) { + assert(stmt.impl); + stmt.impl->check(sqlite3_bind_int64(stmt.impl->stmt, offset, value)); +} + +template <> void Query::bind(int offset, uint32_t value) { + assert(stmt.impl); + stmt.impl->check(sqlite3_bind_int64(stmt.impl->stmt, offset, value)); +} + +template <> void Query::bind(int offset, float value) { + assert(stmt.impl); + stmt.impl->check(sqlite3_bind_double(stmt.impl->stmt, offset, value)); +} + +template <> void Query::bind(int offset, double value) { + assert(stmt.impl); + stmt.impl->check(sqlite3_bind_double(stmt.impl->stmt, offset, value)); +} + +template <> void Query::bind(int offset, bool value) { + assert(stmt.impl); + stmt.impl->check(sqlite3_bind_int(stmt.impl->stmt, offset, value)); +} + +template <> void Query::bind(int offset, const char *value) { + assert(stmt.impl); + stmt.impl->check(sqlite3_bind_text(stmt.impl->stmt, offset, value, -1, SQLITE_STATIC)); +} + +// We currently cannot use sqlite3_bind_blob64 / sqlite3_bind_text64 because they +// were introduced in SQLite 3.8.7, and we need to support earlier versions: +// Android 11: 3.7 +// Android 21: 3.8 +// Android 24: 3.9 +// Per https://developer.android.com/reference/android/database/sqlite/package-summary. +// The first iOS version with 3.8.7+ was 9.0, with 3.8.8. + +void Query::bind(int offset, const char * value, std::size_t length, bool retain) { + assert(stmt.impl); + if (length > std::numeric_limits::max()) { + throw std::range_error("value too long for sqlite3_bind_text"); + } + stmt.impl->check(sqlite3_bind_text(stmt.impl->stmt, offset, value, int(length), + retain ? SQLITE_TRANSIENT : SQLITE_STATIC)); +} + +void Query::bind(int offset, const std::string& value, bool retain) { + bind(offset, value.data(), value.size(), retain); +} + +void Query::bindBlob(int offset, const void * value, std::size_t length, bool retain) { + assert(stmt.impl); + if (length > std::numeric_limits::max()) { + throw std::range_error("value too long for sqlite3_bind_text"); + } + stmt.impl->check(sqlite3_bind_blob(stmt.impl->stmt, offset, value, int(length), + retain ? SQLITE_TRANSIENT : SQLITE_STATIC)); +} + +void Query::bindBlob(int offset, const std::vector& value, bool retain) { + bindBlob(offset, value.data(), value.size(), retain); +} + +template <> +void Query::bind( + int offset, std::chrono::time_point value) { + assert(stmt.impl); + stmt.impl->check(sqlite3_bind_int64(stmt.impl->stmt, offset, std::chrono::system_clock::to_time_t(value))); +} + +template <> void Query::bind(int offset, optional value) { + if (!value) { + bind(offset, nullptr); + } else { + bind(offset, *value); + } +} + +template <> +void Query::bind( + int offset, + optional> value) { + if (!value) { + bind(offset, nullptr); + } else { + bind(offset, *value); + } +} + +bool Query::run() { + assert(stmt.impl); + const int err = sqlite3_step(stmt.impl->stmt); + stmt.impl->lastInsertRowId = sqlite3_last_insert_rowid(sqlite3_db_handle(stmt.impl->stmt)); + stmt.impl->changes = sqlite3_changes(sqlite3_db_handle(stmt.impl->stmt)); + if (err == SQLITE_DONE) { + return false; + } else if (err == SQLITE_ROW) { + return true; + } else if (err != SQLITE_OK) { + throw Exception { err, sqlite3_errmsg(sqlite3_db_handle(stmt.impl->stmt)) }; + } else { + return false; + } +} + +template <> bool Query::get(int offset) { + assert(stmt.impl); + return sqlite3_column_int(stmt.impl->stmt, offset); +} + +template <> int Query::get(int offset) { + assert(stmt.impl); + return sqlite3_column_int(stmt.impl->stmt, offset); +} + +template <> int64_t Query::get(int offset) { + assert(stmt.impl); + return sqlite3_column_int64(stmt.impl->stmt, offset); +} + +template <> double Query::get(int offset) { + assert(stmt.impl); + return sqlite3_column_double(stmt.impl->stmt, offset); +} + +template <> std::string Query::get(int offset) { + assert(stmt.impl); + return { + reinterpret_cast(sqlite3_column_blob(stmt.impl->stmt, offset)), + size_t(sqlite3_column_bytes(stmt.impl->stmt, offset)) + }; +} + +template <> std::vector Query::get(int offset) { + assert(stmt.impl); + const auto* begin = reinterpret_cast(sqlite3_column_blob(stmt.impl->stmt, offset)); + const uint8_t* end = begin + sqlite3_column_bytes(stmt.impl->stmt, offset); + return { begin, end }; +} + +template <> +std::chrono::time_point +Query::get(int offset) { + assert(stmt.impl); + return std::chrono::time_point_cast( + std::chrono::system_clock::from_time_t(sqlite3_column_int64(stmt.impl->stmt, offset))); +} + +template <> optional Query::get(int offset) { + assert(stmt.impl); + if (sqlite3_column_type(stmt.impl->stmt, offset) == SQLITE_NULL) { + return optional(); + } else { + return get(offset); + } +} + +template <> optional Query::get(int offset) { + assert(stmt.impl); + if (sqlite3_column_type(stmt.impl->stmt, offset) == SQLITE_NULL) { + return optional(); + } else { + return get(offset); + } +} + +template <> optional Query::get(int offset) { + assert(stmt.impl); + if (sqlite3_column_type(stmt.impl->stmt, offset) == SQLITE_NULL) { + return optional(); + } else { + return get(offset); + } +} + +template <> +optional> +Query::get(int offset) { + assert(stmt.impl); + if (sqlite3_column_type(stmt.impl->stmt, offset) == SQLITE_NULL) { + return {}; + } else { + return get>( + offset); + } +} + +void Query::reset() { + assert(stmt.impl); + sqlite3_reset(stmt.impl->stmt); +} + +void Query::clearBindings() { + assert(stmt.impl); + sqlite3_clear_bindings(stmt.impl->stmt); +} + +int64_t Query::lastInsertRowId() const { + assert(stmt.impl); + return stmt.impl->lastInsertRowId; +} + +uint64_t Query::changes() const { + assert(stmt.impl); + auto changes_ = stmt.impl->changes; + return (changes_ < 0 ? 0 : changes_); +} + +Transaction::Transaction(Database& db_, Mode mode) + : dbImpl(*db_.impl) { + switch (mode) { + case Deferred: + dbImpl.exec("BEGIN DEFERRED TRANSACTION"); + break; + case Immediate: + dbImpl.exec("BEGIN IMMEDIATE TRANSACTION"); + break; + case Exclusive: + dbImpl.exec("BEGIN EXCLUSIVE TRANSACTION"); + break; + } +} + +Transaction::~Transaction() { + if (needRollback) { + try { + rollback(); + } catch (...) { + // Ignore failed rollbacks in destructor. + } + } +} + +void Transaction::commit() { + needRollback = false; + dbImpl.exec("COMMIT TRANSACTION"); +} + +void Transaction::rollback() { + needRollback = false; + dbImpl.exec("ROLLBACK TRANSACTION"); +} + +} // namespace sqlite +} // namespace mapbox diff --git a/platform/default/src/mbgl/test/main.cpp b/platform/default/src/mbgl/test/main.cpp new file mode 100644 index 0000000000..d01cf75ffc --- /dev/null +++ b/platform/default/src/mbgl/test/main.cpp @@ -0,0 +1,20 @@ +#include +#include +#include +#include +#include + +#define xstr(s) str(s) +#define str(s) #s + +int main(int argc, char *argv[]) { +#ifdef WORK_DIRECTORY + const int result = chdir(xstr(WORK_DIRECTORY)); + if (result != 0) { + fprintf(stderr, "failed to change directory: %s\n", strerror(errno)); + return errno; + } +#endif + + return mbgl::runTests(argc, argv); +} diff --git a/platform/default/src/mbgl/text/bidi.cpp b/platform/default/src/mbgl/text/bidi.cpp new file mode 100644 index 0000000000..32a3dc23ef --- /dev/null +++ b/platform/default/src/mbgl/text/bidi.cpp @@ -0,0 +1,239 @@ +#include +#include + +#include +#include + +#include + +namespace mbgl { + +class BiDiImpl { +public: + BiDiImpl() : bidiText(ubidi_open()), bidiLine(ubidi_open()) { + } + ~BiDiImpl() { + ubidi_close(bidiText); + ubidi_close(bidiLine); + } + + UBiDi* bidiText = nullptr; + UBiDi* bidiLine = nullptr; +}; + +BiDi::BiDi() : impl(std::make_unique()) {} +BiDi::~BiDi() = default; + +// Takes UTF16 input in logical order and applies Arabic shaping to the input while maintaining +// logical order. Output won't be intelligible until the bidirectional algorithm is applied +std::u16string applyArabicShaping(const std::u16string& input) { + UErrorCode errorCode = U_ZERO_ERROR; + + const int32_t outputLength = + u_shapeArabic(mbgl::utf16char_cast(input.c_str()), static_cast(input.size()), nullptr, 0, + (U_SHAPE_LETTERS_SHAPE & U_SHAPE_LETTERS_MASK) | + (U_SHAPE_TEXT_DIRECTION_LOGICAL & U_SHAPE_TEXT_DIRECTION_MASK), + &errorCode); + + // Pre-flighting will always set U_BUFFER_OVERFLOW_ERROR + errorCode = U_ZERO_ERROR; + + std::u16string outputText(outputLength, 0); + + u_shapeArabic(mbgl::utf16char_cast(input.c_str()), static_cast(input.size()), mbgl::utf16char_cast(&outputText[0]), outputLength, + (U_SHAPE_LETTERS_SHAPE & U_SHAPE_LETTERS_MASK) | + (U_SHAPE_TEXT_DIRECTION_LOGICAL & U_SHAPE_TEXT_DIRECTION_MASK), + &errorCode); + + // If the algorithm fails for any reason, fall back to non-transformed text + if (U_FAILURE(errorCode)) + return input; + + return outputText; +} + +void BiDi::mergeParagraphLineBreaks(std::set& lineBreakPoints) { + int32_t paragraphCount = ubidi_countParagraphs(impl->bidiText); + for (int32_t i = 0; i < paragraphCount; i++) { + UErrorCode errorCode = U_ZERO_ERROR; + int32_t paragraphEndIndex; + ubidi_getParagraphByIndex(impl->bidiText, i, nullptr, ¶graphEndIndex, nullptr, &errorCode); + + if (U_FAILURE(errorCode)) { + throw std::runtime_error(std::string("ProcessedBiDiText::mergeParagraphLineBreaks: ") + + u_errorName(errorCode)); + } + + lineBreakPoints.insert(static_cast(paragraphEndIndex)); + } +} + +std::vector BiDi::applyLineBreaking(std::set lineBreakPoints) { + // BiDi::getLine will error if called across a paragraph boundary, so we need to ensure that all + // paragraph boundaries are included in the set of line break points. The calling code might not + // include the line break because it didn't need to wrap at that point, or because the text was + // separated with a more exotic code point such as (U+001C) + mergeParagraphLineBreaks(lineBreakPoints); + + std::vector transformedLines; + transformedLines.reserve(lineBreakPoints.size()); + + std::size_t start = 0; + for (std::size_t lineBreakPoint : lineBreakPoints) { + transformedLines.push_back(getLine(start, lineBreakPoint)); + start = lineBreakPoint; + } + + return transformedLines; +} + +std::vector BiDi::processText(const std::u16string& input, + std::set lineBreakPoints) { + UErrorCode errorCode = U_ZERO_ERROR; + + ubidi_setPara(impl->bidiText, mbgl::utf16char_cast(input.c_str()), static_cast(input.size()), + UBIDI_DEFAULT_LTR, nullptr, &errorCode); + + if (U_FAILURE(errorCode)) { + throw std::runtime_error(std::string("BiDi::processText: ") + u_errorName(errorCode)); + } + + return applyLineBreaking(lineBreakPoints); +} + +std::vector BiDi::processStyledText(const StyledText& input, std::set lineBreakPoints) { + std::vector lines; + const auto& inputText = input.first; + const auto& styleIndices = input.second; + + UErrorCode errorCode = U_ZERO_ERROR; + + ubidi_setPara(impl->bidiText, mbgl::utf16char_cast(inputText.c_str()), static_cast(inputText.size()), + UBIDI_DEFAULT_LTR, nullptr, &errorCode); + + if (U_FAILURE(errorCode)) { + throw std::runtime_error(std::string("BiDi::processStyledText: ") + u_errorName(errorCode)); + } + + mergeParagraphLineBreaks(lineBreakPoints); + + std::size_t lineStartIndex = 0; + + for (std::size_t lineBreakPoint : lineBreakPoints) { + StyledText line; + line.second.reserve(lineBreakPoint - lineStartIndex); + + errorCode = U_ZERO_ERROR; + ubidi_setLine(impl->bidiText, static_cast(lineStartIndex), static_cast(lineBreakPoint), impl->bidiLine, &errorCode); + if (U_FAILURE(errorCode)) { + throw std::runtime_error(std::string("BiDi::processStyledText (setLine): ") + u_errorName(errorCode)); + } + + errorCode = U_ZERO_ERROR; + uint32_t runCount = ubidi_countRuns(impl->bidiLine, &errorCode); + if (U_FAILURE(errorCode)) { + throw std::runtime_error(std::string("BiDi::processStyledText (countRuns): ") + u_errorName(errorCode)); + } + + for (uint32_t runIndex = 0; runIndex < runCount; runIndex++) { + int32_t runLogicalStart; + int32_t runLength; + UBiDiDirection direction = ubidi_getVisualRun(impl->bidiLine, runIndex, &runLogicalStart, &runLength); + const bool isReversed = direction == UBIDI_RTL; + + std::size_t logicalStart = lineStartIndex + runLogicalStart; + std::size_t logicalEnd = logicalStart + runLength; + if (isReversed) { + // Within this reversed section, iterate logically backwards + // Each time we see a change in style, render a reversed chunk + // of everything since the last change + std::size_t styleRunStart = logicalEnd; + uint8_t currentStyleIndex = styleIndices.at(styleRunStart - 1); + for (std::size_t i = logicalEnd - 1; i >= logicalStart; i--) { + if (currentStyleIndex != styleIndices.at(i) || i == logicalStart) { + std::size_t styleRunEnd = i == logicalStart ? i : i + 1; + std::u16string reversed = writeReverse(inputText, styleRunEnd, styleRunStart); + line.first += reversed; + for (std::size_t j = 0; j < reversed.size(); j++) { + line.second.push_back(currentStyleIndex); + } + currentStyleIndex = styleIndices.at(i); + styleRunStart = styleRunEnd; + } + if (i == 0) { + break; + } + } + + } else { + line.first += input.first.substr(logicalStart, runLength); + line.second.insert(line.second.end(), styleIndices.begin() + logicalStart, styleIndices.begin() + logicalStart + runLength); + } + } + + lines.push_back(line); + lineStartIndex = lineBreakPoint; + } + + return lines; +} + +std::u16string BiDi::writeReverse(const std::u16string& input, std::size_t logicalStart, std::size_t logicalEnd) { + UErrorCode errorCode = U_ZERO_ERROR; + int32_t logicalLength = static_cast(logicalEnd - logicalStart); + std::u16string outputText(logicalLength + 1, 0); + + // UBIDI_DO_MIRRORING: Apply unicode mirroring of characters like parentheses + // UBIDI_REMOVE_BIDI_CONTROLS: Now that all the lines are set, remove control characters so that + // they don't show up on screen (some fonts have glyphs representing them) + int32_t outputLength = + ubidi_writeReverse(mbgl::utf16char_cast(&input[logicalStart]), + logicalLength, + mbgl::utf16char_cast(&outputText[0]), + logicalLength + 1, // Extra room for null terminator, although we don't really need to have ICU write it for us + UBIDI_DO_MIRRORING | UBIDI_REMOVE_BIDI_CONTROLS, + &errorCode); + + if (U_FAILURE(errorCode)) { + throw std::runtime_error(std::string("BiDi::writeReverse: ") + u_errorName(errorCode)); + } + + outputText.resize(outputLength); // REMOVE_BIDI_CONTROLS may have shrunk the string + + return outputText; +} + +std::u16string BiDi::getLine(std::size_t start, std::size_t end) { + UErrorCode errorCode = U_ZERO_ERROR; + ubidi_setLine(impl->bidiText, static_cast(start), static_cast(end), impl->bidiLine, &errorCode); + + if (U_FAILURE(errorCode)) { + throw std::runtime_error(std::string("BiDi::getLine (setLine): ") + u_errorName(errorCode)); + } + + // Because we set UBIDI_REMOVE_BIDI_CONTROLS, the output may be smaller than what we reserve + // Setting UBIDI_INSERT_LRM_FOR_NUMERIC would require + // ubidi_getLength(pBiDi)+2*ubidi_countRuns(pBiDi) + const int32_t outputLength = ubidi_getProcessedLength(impl->bidiLine); + std::u16string outputText(outputLength, 0); + + // UBIDI_DO_MIRRORING: Apply unicode mirroring of characters like parentheses + // UBIDI_REMOVE_BIDI_CONTROLS: Now that all the lines are set, remove control characters so that + // they don't show up on screen (some fonts have glyphs representing them) + int32_t finalLength = ubidi_writeReordered(impl->bidiLine, + mbgl::utf16char_cast(&outputText[0]), + outputLength, + UBIDI_DO_MIRRORING | UBIDI_REMOVE_BIDI_CONTROLS, + &errorCode); + + outputText.resize(finalLength); // REMOVE_BIDI_CONTROLS may have shrunk the string + + if (U_FAILURE(errorCode)) { + throw std::runtime_error(std::string("BiDi::getLine (writeReordered): ") + + u_errorName(errorCode)); + } + + return outputText; +} + +} // end namespace mbgl diff --git a/platform/default/src/mbgl/text/collator.cpp b/platform/default/src/mbgl/text/collator.cpp new file mode 100644 index 0000000000..400fa4d94d --- /dev/null +++ b/platform/default/src/mbgl/text/collator.cpp @@ -0,0 +1,79 @@ +#include +#include +#include +#include + +/* + The default implementation of Collator ignores locale. + Case sensitivity and collation order are based on + Default Unicode Collation Element Table (DUCET). + + Diacritic-insensitivity is implemented with nunicode's + non-standard "unaccent" functionality, which is tailored + to European languages. + + It would be possible to implement locale awareness using ICU, + but would require bundling locale data. +*/ + +namespace mbgl { +namespace style { +namespace expression { + +class Collator::Impl { +public: + Impl(bool caseSensitive_, bool diacriticSensitive_, optional) + : caseSensitive(caseSensitive_) + , diacriticSensitive(diacriticSensitive_) + {} + + bool operator==(const Impl& other) const { + return caseSensitive == other.caseSensitive && + diacriticSensitive == other.diacriticSensitive; + } + + int compare(const std::string& lhs, const std::string& rhs) const { + if (caseSensitive && diacriticSensitive) { + return nu_strcoll(lhs.c_str(), rhs.c_str(), + nu_utf8_read, nu_utf8_read); + } else if (!caseSensitive && diacriticSensitive) { + return nu_strcasecoll(lhs.c_str(), rhs.c_str(), + nu_utf8_read, nu_utf8_read); + } else if (caseSensitive && !diacriticSensitive) { + return nu_strcoll(platform::unaccent(lhs).c_str(), platform::unaccent(rhs).c_str(), + nu_utf8_read, nu_utf8_read); + } else { + return nu_strcasecoll(platform::unaccent(lhs).c_str(), platform::unaccent(rhs).c_str(), + nu_utf8_read, nu_utf8_read); + } + } + + std::string resolvedLocale() const { + return ""; + } +private: + bool caseSensitive; + bool diacriticSensitive; +}; + + +Collator::Collator(bool caseSensitive, bool diacriticSensitive, optional locale_) + : impl(std::make_shared(caseSensitive, diacriticSensitive, std::move(locale_))) +{} + +bool Collator::operator==(const Collator& other) const { + return *impl == *(other.impl); +} + +int Collator::compare(const std::string& lhs, const std::string& rhs) const { + return impl->compare(lhs, rhs); +} + +std::string Collator::resolvedLocale() const { + return impl->resolvedLocale(); +} + + +} // namespace expression +} // namespace style +} // namespace mbgl diff --git a/platform/default/src/mbgl/text/local_glyph_rasterizer.cpp b/platform/default/src/mbgl/text/local_glyph_rasterizer.cpp new file mode 100644 index 0000000000..7866f29420 --- /dev/null +++ b/platform/default/src/mbgl/text/local_glyph_rasterizer.cpp @@ -0,0 +1,22 @@ +#include + +namespace mbgl { + +class LocalGlyphRasterizer::Impl { +}; + +LocalGlyphRasterizer::LocalGlyphRasterizer(const optional) +{} + +LocalGlyphRasterizer::~LocalGlyphRasterizer() +{} + +bool LocalGlyphRasterizer::canRasterizeGlyph(const FontStack&, GlyphID) { + return false; +} + +Glyph LocalGlyphRasterizer::rasterizeGlyph(const FontStack&, GlyphID) { + return Glyph(); +} + +} // namespace mbgl diff --git a/platform/default/src/mbgl/text/unaccent.cpp b/platform/default/src/mbgl/text/unaccent.cpp new file mode 100644 index 0000000000..37b9a0d9ca --- /dev/null +++ b/platform/default/src/mbgl/text/unaccent.cpp @@ -0,0 +1,43 @@ +#include +#include +#include + +#include +#include + +namespace mbgl { namespace platform { + +std::string unaccent(const std::string& str) +{ + std::stringstream output; + char const *itr = str.c_str(), *nitr; + char const *end = itr + str.length(); + char lo[5] = { 0 }; + + for (; itr < end; itr = nitr) + { + uint32_t code_point = 0; + char const* buf = nullptr; + + nitr = _nu_tounaccent(itr, end, nu_utf8_read, &code_point, &buf, nullptr); + if (buf != nullptr) + { + do + { + buf = NU_CASEMAP_DECODING_FUNCTION(buf, &code_point); + if (code_point == 0) break; + output.write(lo, nu_utf8_write(code_point, lo) - lo); + } + while (code_point != 0); + } + else + { + output.write(itr, nitr - itr); + } + } + + return output.str(); +} + +} // namespace platform +} // namespace mbgl diff --git a/platform/default/src/mbgl/util/async_task.cpp b/platform/default/src/mbgl/util/async_task.cpp new file mode 100644 index 0000000000..50891056d8 --- /dev/null +++ b/platform/default/src/mbgl/util/async_task.cpp @@ -0,0 +1,66 @@ +#include + +#include + +#include +#include + +#include + +namespace mbgl { +namespace util { + +class AsyncTask::Impl { +public: + Impl(std::function&& fn) + : async(new uv_async_t), + task(std::move(fn)) { + + auto* loop = reinterpret_cast(RunLoop::getLoopHandle()); + if (uv_async_init(loop, async, asyncCallback) != 0) { + throw std::runtime_error("Failed to initialize async."); + } + + handle()->data = this; + uv_unref(handle()); + } + + ~Impl() { + uv_close(handle(), [](uv_handle_t* h) { + delete reinterpret_cast(h); + }); + } + + void maySend() { + // uv_async_send will do the call coalescing for us. + if (uv_async_send(async) != 0) { + throw std::runtime_error("Failed to async send."); + } + } + +private: + static void asyncCallback(uv_async_t* handle) { + reinterpret_cast(handle->data)->task(); + } + + uv_handle_t* handle() { + return reinterpret_cast(async); + } + + uv_async_t* async; + + std::function task; +}; + +AsyncTask::AsyncTask(std::function&& fn) + : impl(std::make_unique(std::move(fn))) { +} + +AsyncTask::~AsyncTask() = default; + +void AsyncTask::send() { + impl->maySend(); +} + +} // namespace util +} // namespace mbgl diff --git a/platform/default/src/mbgl/util/default_thread_pool.cpp b/platform/default/src/mbgl/util/default_thread_pool.cpp new file mode 100644 index 0000000000..d3950bb8aa --- /dev/null +++ b/platform/default/src/mbgl/util/default_thread_pool.cpp @@ -0,0 +1,57 @@ +#include +#include +#include +#include + +namespace mbgl { + +ThreadPool::ThreadPool(std::size_t count) { + threads.reserve(count); + for (std::size_t i = 0; i < count; ++i) { + threads.emplace_back([this, i]() { + platform::setCurrentThreadName(std::string{ "Worker " } + util::toString(i + 1)); + + while (true) { + std::unique_lock lock(mutex); + + cv.wait(lock, [this] { + return !queue.empty() || terminate; + }); + + if (terminate) { + return; + } + + auto mailbox = queue.front(); + queue.pop(); + lock.unlock(); + + Mailbox::maybeReceive(mailbox); + } + }); + } +} + +ThreadPool::~ThreadPool() { + { + std::lock_guard lock(mutex); + terminate = true; + } + + cv.notify_all(); + + for (auto& thread : threads) { + thread.join(); + } +} + +void ThreadPool::schedule(std::weak_ptr mailbox) { + { + std::lock_guard lock(mutex); + queue.push(mailbox); + } + + cv.notify_one(); +} + +} // namespace mbgl diff --git a/platform/default/src/mbgl/util/image.cpp b/platform/default/src/mbgl/util/image.cpp new file mode 100644 index 0000000000..25063892b7 --- /dev/null +++ b/platform/default/src/mbgl/util/image.cpp @@ -0,0 +1,31 @@ +#include +#include +#include + +namespace mbgl { + +PremultipliedImage decodePNG(const uint8_t*, size_t); +PremultipliedImage decodeJPEG(const uint8_t*, size_t); + +PremultipliedImage decodeImage(const std::string& string) { + const auto* data = reinterpret_cast(string.data()); + const size_t size = string.size(); + + if (size >= 4) { + uint32_t magic = (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3]; + if (magic == 0x89504E47U) { + return decodePNG(data, size); + } + } + + if (size >= 2) { + uint16_t magic = ((data[0] << 8) | data[1]) & 0xffff; + if (magic == 0xFFD8) { + return decodeJPEG(data, size); + } + } + + throw std::runtime_error("unsupported image type"); +} + +} // namespace mbgl diff --git a/platform/default/src/mbgl/util/jpeg_reader.cpp b/platform/default/src/mbgl/util/jpeg_reader.cpp new file mode 100644 index 0000000000..5f613f9423 --- /dev/null +++ b/platform/default/src/mbgl/util/jpeg_reader.cpp @@ -0,0 +1,151 @@ +#include +#include + +#include +#include +#include + +extern "C" +{ +#include +} + +namespace mbgl { + +const static unsigned BUF_SIZE = 4096; + +struct jpeg_stream_wrapper { + jpeg_source_mgr manager; + std::istream* stream; + std::array buffer; +}; + +static void init_source(j_decompress_ptr cinfo) { + auto* wrap = reinterpret_cast(cinfo->src); + wrap->stream->seekg(0, std::ios_base::beg); +} + +static boolean fill_input_buffer(j_decompress_ptr cinfo) { + auto* wrap = reinterpret_cast(cinfo->src); + wrap->stream->read(reinterpret_cast(&wrap->buffer[0]), BUF_SIZE); + std::streamsize size = wrap->stream->gcount(); + wrap->manager.next_input_byte = wrap->buffer.data(); + wrap->manager.bytes_in_buffer = BUF_SIZE; + return (size > 0) ? TRUE : FALSE; +} + +static void skip(j_decompress_ptr cinfo, long count) { + if (count <= 0) return; // A zero or negative skip count should be treated as a no-op. + auto* wrap = reinterpret_cast(cinfo->src); + + if (wrap->manager.bytes_in_buffer > 0 && count < static_cast(wrap->manager.bytes_in_buffer)) + { + wrap->manager.bytes_in_buffer -= count; + wrap->manager.next_input_byte = &wrap->buffer[BUF_SIZE - wrap->manager.bytes_in_buffer]; + } + else + { + wrap->stream->seekg(count - wrap->manager.bytes_in_buffer, std::ios_base::cur); + // trigger buffer fill + wrap->manager.next_input_byte = nullptr; + wrap->manager.bytes_in_buffer = 0; // bytes_in_buffer may be zero on return. + } +} + +static void term(j_decompress_ptr) {} + +static void attach_stream(j_decompress_ptr cinfo, std::istream* in) { + if (cinfo->src == nullptr) { + cinfo->src = (struct jpeg_source_mgr *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof(jpeg_stream_wrapper)); + } + auto * src = reinterpret_cast (cinfo->src); + src->manager.init_source = init_source; + src->manager.fill_input_buffer = fill_input_buffer; + src->manager.skip_input_data = skip; + src->manager.resync_to_restart = jpeg_resync_to_restart; + src->manager.term_source = term; + src->manager.bytes_in_buffer = 0; + src->manager.next_input_byte = nullptr; + src->stream = in; +} + +static void on_error(j_common_ptr) {} + +static void on_error_message(j_common_ptr cinfo) { + char buffer[JMSG_LENGTH_MAX]; + (*cinfo->err->format_message)(cinfo, buffer); + throw std::runtime_error(std::string("JPEG Reader: libjpeg could not read image: ") + buffer); +} + +struct jpeg_info_guard { + jpeg_info_guard(jpeg_decompress_struct* cinfo) + : i_(cinfo) {} + + ~jpeg_info_guard() { + jpeg_destroy_decompress(i_); + } + + jpeg_decompress_struct* i_; +}; + +PremultipliedImage decodeJPEG(const uint8_t* data, size_t size) { + util::CharArrayBuffer dataBuffer { reinterpret_cast(data), size }; + std::istream stream(&dataBuffer); + + jpeg_decompress_struct cinfo; + jpeg_info_guard iguard(&cinfo); + jpeg_error_mgr jerr; + cinfo.err = jpeg_std_error(&jerr); + jerr.error_exit = on_error; + jerr.output_message = on_error_message; + jpeg_create_decompress(&cinfo); + attach_stream(&cinfo, &stream); + + int ret = jpeg_read_header(&cinfo, TRUE); + if (ret != JPEG_HEADER_OK) + throw std::runtime_error("JPEG Reader: failed to read header"); + + jpeg_start_decompress(&cinfo); + + if (cinfo.out_color_space == JCS_UNKNOWN) + throw std::runtime_error("JPEG Reader: failed to read unknown color space"); + + if (cinfo.output_width == 0 || cinfo.output_height == 0) + throw std::runtime_error("JPEG Reader: failed to read image size"); + + size_t width = cinfo.output_width; + size_t height = cinfo.output_height; + size_t components = cinfo.output_components; + size_t rowStride = components * width; + + PremultipliedImage image({ static_cast(width), static_cast(height) }); + uint8_t* dst = image.data.get(); + + JSAMPARRAY buffer = (*cinfo.mem->alloc_sarray)((j_common_ptr) &cinfo, JPOOL_IMAGE, rowStride, 1); + + while (cinfo.output_scanline < cinfo.output_height) { + jpeg_read_scanlines(&cinfo, buffer, 1); + + for (size_t i = 0; i < width; ++i) { + dst[0] = buffer[0][components * i]; + dst[3] = 0xFF; + + if (components > 2) { + dst[1] = buffer[0][components * i + 1]; + dst[2] = buffer[0][components * i + 2]; + } else { + dst[1] = dst[0]; + dst[2] = dst[0]; + } + + dst += 4; + } + } + + jpeg_finish_decompress(&cinfo); + + return image; +} + +} // namespace mbgl diff --git a/platform/default/src/mbgl/util/logging_stderr.cpp b/platform/default/src/mbgl/util/logging_stderr.cpp new file mode 100644 index 0000000000..41585fb7bb --- /dev/null +++ b/platform/default/src/mbgl/util/logging_stderr.cpp @@ -0,0 +1,12 @@ +#include +#include + +#include + +namespace mbgl { + +void Log::platformRecord(EventSeverity severity, const std::string &msg) { + std::cerr << "[" << Enum::toString(severity) << "] " << msg << std::endl; +} + +} // namespace mbgl diff --git a/platform/default/src/mbgl/util/png_reader.cpp b/platform/default/src/mbgl/util/png_reader.cpp new file mode 100644 index 0000000000..4d4ee29d1f --- /dev/null +++ b/platform/default/src/mbgl/util/png_reader.cpp @@ -0,0 +1,142 @@ +#include +#include +#include +#include + +#include +#include + +extern "C" +{ +#include +} + +template +static std::string sprintf(const char *msg, Args... args) { + char res[max]; + int len = snprintf(res, sizeof(res), msg, args...); + return std::string(res, len); +} + +const static bool png_version_check __attribute__((unused)) = []() { + const png_uint_32 version = png_access_version_number(); + if (version != PNG_LIBPNG_VER) { + throw std::runtime_error(sprintf<96>( + "libpng version mismatch: headers report %d.%d.%d, but library reports %d.%d.%d", + PNG_LIBPNG_VER / 10000, (PNG_LIBPNG_VER / 100) % 100, PNG_LIBPNG_VER % 100, + version / 10000, (version / 100) % 100, version % 100)); + } + return true; +}(); + +namespace mbgl { + +static void user_error_fn(png_structp, png_const_charp error_msg) { + throw std::runtime_error(std::string("failed to read invalid png: '") + error_msg + "'"); +} + +static void user_warning_fn(png_structp, png_const_charp warning_msg) { + Log::Warning(Event::Image, "ImageReader (PNG): %s", warning_msg); +} + +static void png_read_data(png_structp png_ptr, png_bytep data, png_size_t length) { + auto* fin = reinterpret_cast(png_get_io_ptr(png_ptr)); + fin->read(reinterpret_cast(data), length); + std::streamsize read_count = fin->gcount(); + if (read_count < 0 || static_cast(read_count) != length) + { + png_error(png_ptr, "Read Error"); + } +} + +struct png_struct_guard { + png_struct_guard(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr) + : p_(png_ptr_ptr), + i_(info_ptr_ptr) {} + + ~png_struct_guard() { + png_destroy_read_struct(p_,i_,nullptr); + } + + png_structpp p_; + png_infopp i_; +}; + +PremultipliedImage decodePNG(const uint8_t* data, size_t size) { + util::CharArrayBuffer dataBuffer { reinterpret_cast(data), size }; + std::istream stream(&dataBuffer); + + png_byte header[8] = { 0 }; + stream.read(reinterpret_cast(header), 8); + if (stream.gcount() != 8) + throw std::runtime_error("PNG reader: Could not read image"); + + int is_png = !png_sig_cmp(header, 0, 8); + if (!is_png) + throw std::runtime_error("File or stream is not a png"); + + png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr); + if (!png_ptr) + throw std::runtime_error("failed to allocate png_ptr"); + + // catch errors in a custom way to avoid the need for setjmp + png_set_error_fn(png_ptr, png_get_error_ptr(png_ptr), user_error_fn, user_warning_fn); + + png_infop info_ptr; + png_struct_guard sguard(&png_ptr, &info_ptr); + info_ptr = png_create_info_struct(png_ptr); + if (!info_ptr) + throw std::runtime_error("failed to create info_ptr"); + + png_set_read_fn(png_ptr, &stream, png_read_data); + png_set_sig_bytes(png_ptr, 8); + png_read_info(png_ptr, info_ptr); + + png_uint_32 width = 0; + png_uint_32 height = 0; + int bit_depth = 0; + int color_type = 0; + png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, nullptr, nullptr, nullptr); + + UnassociatedImage image({ static_cast(width), static_cast(height) }); + + if (color_type == PNG_COLOR_TYPE_PALETTE) + png_set_expand(png_ptr); + + if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) + png_set_expand(png_ptr); + + if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) + png_set_expand(png_ptr); + + if (bit_depth == 16) + png_set_strip_16(png_ptr); + + if (color_type == PNG_COLOR_TYPE_GRAY || + color_type == PNG_COLOR_TYPE_GRAY_ALPHA) + png_set_gray_to_rgb(png_ptr); + + png_set_add_alpha(png_ptr, 0xff, PNG_FILLER_AFTER); + + if (png_get_interlace_type(png_ptr,info_ptr) == PNG_INTERLACE_ADAM7) { + png_set_interlace_handling(png_ptr); // FIXME: libpng bug? + // according to docs png_read_image + // "..automatically handles interlacing, + // so you don't need to call png_set_interlace_handling()" + } + + png_read_update_info(png_ptr, info_ptr); + + // we can read whole image at once + // alloc row pointers + const std::unique_ptr rows(new png_bytep[height]); + for (unsigned row = 0; row < height; ++row) + rows[row] = image.data.get() + row * width * 4; + png_read_image(png_ptr, rows.get()); + + png_read_end(png_ptr, nullptr); + + return util::premultiply(std::move(image)); +} + +} // namespace mbgl diff --git a/platform/default/src/mbgl/util/png_writer.cpp b/platform/default/src/mbgl/util/png_writer.cpp new file mode 100644 index 0000000000..b89e253f85 --- /dev/null +++ b/platform/default/src/mbgl/util/png_writer.cpp @@ -0,0 +1,77 @@ +#include +#include +#include + +#include + +#include +#include + +#define NETWORK_BYTE_UINT32(value) \ + char(value >> 24), char(value >> 16), char(value >> 8), char(value >> 0) + +namespace { + +void addChunk(std::string& png, const char* type, const char* data = "", const uint32_t size = 0) { + assert(strlen(type) == 4); + + // Checksum encompasses type + data + boost::crc_32_type checksum; + checksum.process_bytes(type, 4); + checksum.process_bytes(data, size); + + const char length[4] = { NETWORK_BYTE_UINT32(size) }; + const char crc[4] = { NETWORK_BYTE_UINT32(checksum.checksum()) }; + + png.reserve(png.size() + 4 /* length */ + 4 /* type */ + size + 4 /* CRC */); + png.append(length, 4); + png.append(type, 4); + png.append(data, size); + png.append(crc, 4); +} + +} // namespace + +namespace mbgl { + +// Encode PNGs without libpng. +std::string encodePNG(const PremultipliedImage& pre) { + // Make copy of the image so that we can unpremultiply it. + const auto src = util::unpremultiply(pre.clone()); + + // PNG magic bytes + const char preamble[8] = { char(0x89), 'P', 'N', 'G', '\r', '\n', 0x1a, '\n' }; + + // IHDR chunk for our RGBA image. + const char ihdr[13] = { + NETWORK_BYTE_UINT32(src.size.width), // width + NETWORK_BYTE_UINT32(src.size.height), // height + 8, // bit depth == 8 bits + 6, // color type == RGBA + 0, // compression method == deflate + 0, // filter method == default + 0, // interlace method == none + }; + + // Prepare the (compressed) data chunk. + const auto stride = src.stride(); + std::string idat; + for (uint32_t y = 0; y < src.size.height; y++) { + // Every scanline needs to be prefixed with one byte that indicates the filter type. + idat.append(1, 0); // filter type 0 + idat.append((const char*)(src.data.get() + y * stride), stride); + } + idat = util::compress(idat); + + // Assemble the PNG. + std::string png; + png.reserve((8 /* preamble */) + (12 + 13 /* IHDR */) + + (12 + idat.size() /* IDAT */) + (12 /* IEND */)); + png.append(preamble, 8); + addChunk(png, "IHDR", ihdr, 13); + addChunk(png, "IDAT", idat.data(), static_cast(idat.size())); + addChunk(png, "IEND"); + return png; +} + +} // namespace mbgl diff --git a/platform/default/src/mbgl/util/run_loop.cpp b/platform/default/src/mbgl/util/run_loop.cpp new file mode 100644 index 0000000000..868ee72114 --- /dev/null +++ b/platform/default/src/mbgl/util/run_loop.cpp @@ -0,0 +1,219 @@ +#include +#include +#include +#include + +#include + +#include +#include +#include + +namespace { + +void dummyCallback(uv_async_t*) {} + +} // namespace + +namespace mbgl { +namespace util { + +struct Watch { + static void onEvent(uv_poll_t* poll, int, int event) { + auto watch = reinterpret_cast(poll->data); + + RunLoop::Event watchEvent = RunLoop::Event::None; + switch (event) { + case UV_READABLE: + watchEvent = RunLoop::Event::Read; + break; + case UV_WRITABLE: + watchEvent = RunLoop::Event::Write; + break; + case UV_READABLE | UV_WRITABLE: + watchEvent = RunLoop::Event::ReadWrite; + break; + } + + watch->eventCallback(watch->fd, watchEvent); + }; + + static void onClose(uv_handle_t *poll) { + auto watch = reinterpret_cast(poll->data); + watch->closeCallback(); + }; + + uv_poll_t poll; + int fd; + + std::function eventCallback; + std::function closeCallback; +}; + +RunLoop* RunLoop::Get() { + assert(static_cast(Scheduler::GetCurrent())); + return static_cast(Scheduler::GetCurrent()); +} + +class RunLoop::Impl { +public: + void closeHolder() { + uv_close(holderHandle(), [](uv_handle_t* h) { + delete reinterpret_cast(h); + }); + } + + uv_handle_t* holderHandle() { + return reinterpret_cast(holder); + } + + uv_loop_t *loop = nullptr; + uv_async_t* holder = new uv_async_t; + + RunLoop::Type type; + std::unique_ptr async; + + std::unordered_map> watchPoll; +}; + +RunLoop::RunLoop(Type type) : impl(std::make_unique()) { + switch (type) { + case Type::New: + impl->loop = new uv_loop_t; + if (uv_loop_init(impl->loop) != 0) { + throw std::runtime_error("Failed to initialize loop."); + } + break; + case Type::Default: + impl->loop = uv_default_loop(); + break; + } + + // Just for holding a ref to the main loop and keep + // it alive as required by libuv. + if (uv_async_init(impl->loop, impl->holder, dummyCallback) != 0) { + throw std::runtime_error("Failed to initialize async."); + } + + impl->type = type; + + Scheduler::SetCurrent(this); + impl->async = std::make_unique(std::bind(&RunLoop::process, this)); +} + +RunLoop::~RunLoop() { + Scheduler::SetCurrent(nullptr); + + // Close the dummy handle that we have + // just to keep the main loop alive. + impl->closeHolder(); + + if (impl->type == Type::Default) { + return; + } + + // Run the loop again to ensure that async + // close callbacks have been called. Not needed + // for the default main loop because it is only + // closed when the application exits. + impl->async.reset(); + runOnce(); + + if (uv_loop_close(impl->loop) == UV_EBUSY) { + assert(false && "Failed to close loop."); + } + delete impl->loop; +} + +LOOP_HANDLE RunLoop::getLoopHandle() { + return Get()->impl->loop; +} + +void RunLoop::wake() { + impl->async->send(); +} + +void RunLoop::run() { + MBGL_VERIFY_THREAD(tid); + + uv_ref(impl->holderHandle()); + uv_run(impl->loop, UV_RUN_DEFAULT); +} + +void RunLoop::runOnce() { + MBGL_VERIFY_THREAD(tid); + + uv_run(impl->loop, UV_RUN_NOWAIT); +} + +void RunLoop::stop() { + invoke([&] { uv_unref(impl->holderHandle()); }); +} + +void RunLoop::addWatch(int fd, Event event, std::function&& callback) { + MBGL_VERIFY_THREAD(tid); + + Watch *watch = nullptr; + auto watchPollIter = impl->watchPoll.find(fd); + + if (watchPollIter == impl->watchPoll.end()) { + std::unique_ptr watchPtr = std::make_unique(); + + watch = watchPtr.get(); + impl->watchPoll[fd] = std::move(watchPtr); + + if (uv_poll_init(impl->loop, &watch->poll, fd)) { + throw std::runtime_error("Failed to init poll on file descriptor."); + } + } else { + watch = watchPollIter->second.get(); + } + + watch->poll.data = watch; + watch->fd = fd; + watch->eventCallback = std::move(callback); + + int pollEvent = 0; + switch (event) { + case Event::Read: + pollEvent = UV_READABLE; + break; + case Event::Write: + pollEvent = UV_WRITABLE; + break; + case Event::ReadWrite: + pollEvent = UV_READABLE | UV_WRITABLE; + break; + default: + throw std::runtime_error("Unhandled event."); + } + + if (uv_poll_start(&watch->poll, pollEvent, &Watch::onEvent)) { + throw std::runtime_error("Failed to start poll on file descriptor."); + } +} + +void RunLoop::removeWatch(int fd) { + MBGL_VERIFY_THREAD(tid); + + auto watchPollIter = impl->watchPoll.find(fd); + if (watchPollIter == impl->watchPoll.end()) { + return; + } + + Watch* watch = watchPollIter->second.release(); + impl->watchPoll.erase(watchPollIter); + + watch->closeCallback = [watch] { + delete watch; + }; + + if (uv_poll_stop(&watch->poll)) { + throw std::runtime_error("Failed to stop poll on file descriptor."); + } + + uv_close(reinterpret_cast(&watch->poll), &Watch::onClose); +} + +} // namespace util +} // namespace mbgl diff --git a/platform/default/src/mbgl/util/shared_thread_pool.cpp b/platform/default/src/mbgl/util/shared_thread_pool.cpp new file mode 100644 index 0000000000..d7facbab94 --- /dev/null +++ b/platform/default/src/mbgl/util/shared_thread_pool.cpp @@ -0,0 +1,14 @@ +#include + +namespace mbgl { + +std::shared_ptr sharedThreadPool() { + static std::weak_ptr weak; + auto pool = weak.lock(); + if (!pool) { + weak = pool = std::make_shared(4); + } + return pool; +} + +} // namespace mbgl diff --git a/platform/default/src/mbgl/util/string_stdlib.cpp b/platform/default/src/mbgl/util/string_stdlib.cpp new file mode 100644 index 0000000000..103444df1c --- /dev/null +++ b/platform/default/src/mbgl/util/string_stdlib.cpp @@ -0,0 +1,74 @@ +#include +#include +#include +#include + +namespace mbgl { namespace platform { + +std::string uppercase(const std::string& str) +{ + std::stringstream output; + char const *itr = str.c_str(), *nitr; + char const *end = itr + str.length(); + char lo[5] = { 0 }; + + for (; itr < end; itr = nitr) + { + uint32_t code_point = 0; + char const* buf = nullptr; + + nitr = _nu_toupper(itr, end, nu_utf8_read, &code_point, &buf, nullptr); + if (buf != nullptr) + { + do + { + buf = NU_CASEMAP_DECODING_FUNCTION(buf, &code_point); + if (code_point == 0) break; + output.write(lo, nu_utf8_write(code_point, lo) - lo); + } + while (code_point != 0); + } + else + { + output.write(itr, nitr - itr); + } + } + + return output.str(); + +} + +std::string lowercase(const std::string& str) +{ + std::stringstream output; + char const *itr = str.c_str(), *nitr; + char const *end = itr + str.length(); + char lo[5] = { 0 }; + + for (; itr < end; itr = nitr) + { + uint32_t code_point = 0; + char const* buf = nullptr; + + nitr = _nu_tolower(itr, end, nu_utf8_read, &code_point, &buf, nullptr); + if (buf != nullptr) + { + do + { + buf = NU_CASEMAP_DECODING_FUNCTION(buf, &code_point); + if (code_point == 0) break; + output.write(lo, nu_utf8_write(code_point, lo) - lo); + } + while (code_point != 0); + } + else + { + output.write(itr, nitr - itr); + } + } + + return output.str(); +} + +} // namespace platform +} // namespace mbgl diff --git a/platform/default/src/mbgl/util/thread.cpp b/platform/default/src/mbgl/util/thread.cpp new file mode 100644 index 0000000000..c7c79b4fb0 --- /dev/null +++ b/platform/default/src/mbgl/util/thread.cpp @@ -0,0 +1,37 @@ +#include +#include + +#include + +#include +#include + +namespace mbgl { +namespace platform { + +std::string getCurrentThreadName() { + char name[32] = "unknown"; + pthread_getname_np(pthread_self(), name, sizeof(name)); + + return name; +} + +void setCurrentThreadName(const std::string& name) { + if (name.size() > 15) { // Linux hard limit (see manpages). + pthread_setname_np(pthread_self(), name.substr(0, 15).c_str()); + } else { + pthread_setname_np(pthread_self(), name.c_str()); + } +} + +void makeThreadLowPriority() { + struct sched_param param; + param.sched_priority = 0; + + if (sched_setscheduler(0, SCHED_IDLE, ¶m) != 0) { + Log::Warning(Event::General, "Couldn't set thread scheduling policy"); + } +} + +} // namespace platform +} // namespace mbgl diff --git a/platform/default/src/mbgl/util/thread_local.cpp b/platform/default/src/mbgl/util/thread_local.cpp new file mode 100644 index 0000000000..db70773c12 --- /dev/null +++ b/platform/default/src/mbgl/util/thread_local.cpp @@ -0,0 +1,66 @@ +#include + +#include +#include +#include + +#include +#include + +#include + +namespace mbgl { +namespace util { + +template +class ThreadLocal::Impl { +public: + pthread_key_t key; +}; + +template +ThreadLocal::ThreadLocal() : impl(std::make_unique()) { + int ret = pthread_key_create(&impl->key, [](void *) {}); + + if (ret) { + throw std::runtime_error("Failed to init local storage key."); + } +} + +template +ThreadLocal::~ThreadLocal() { + // ThreadLocal will not take ownership + // of the pointer it is managing. The pointer + // needs to be explicitly cleared before we + // destroy this object. + assert(!get()); + + if (pthread_key_delete(impl->key)) { + Log::Error(Event::General, "Failed to delete local storage key."); + assert(false); + } +} + +template +T* ThreadLocal::get() { + auto* ret = reinterpret_cast(pthread_getspecific(impl->key)); + if (!ret) { + return nullptr; + } + + return ret; +} + +template +void ThreadLocal::set(T* ptr) { + if (pthread_setspecific(impl->key, ptr)) { + throw std::runtime_error("Failed to set local storage."); + } +} + +template class ThreadLocal; +template class ThreadLocal; +template class ThreadLocal; // For unit tests + +} // namespace util +} // namespace mbgl diff --git a/platform/default/src/mbgl/util/timer.cpp b/platform/default/src/mbgl/util/timer.cpp new file mode 100644 index 0000000000..90a85bfc1f --- /dev/null +++ b/platform/default/src/mbgl/util/timer.cpp @@ -0,0 +1,73 @@ +#include + +#include + +#include + +namespace mbgl { +namespace util { + +class Timer::Impl { +public: + Impl() : timer(new uv_timer_t) { + auto* loop = reinterpret_cast(RunLoop::getLoopHandle()); + if (uv_timer_init(loop, timer) != 0) { + throw std::runtime_error("Failed to initialize timer."); + } + + handle()->data = this; + uv_unref(handle()); + } + + ~Impl() { + uv_close(handle(), [](uv_handle_t* h) { + delete reinterpret_cast(h); + }); + } + + void start(uint64_t timeout, uint64_t repeat, std::function&& cb_) { + cb = std::move(cb_); + if (uv_timer_start(timer, timerCallback, timeout, repeat) != 0) { + throw std::runtime_error("Failed to start timer."); + } + } + + void stop() { + cb = nullptr; + if (uv_timer_stop(timer) != 0) { + throw std::runtime_error("Failed to stop timer."); + } + } + +private: + static void timerCallback(uv_timer_t* handle) { + reinterpret_cast(handle->data)->cb(); + } + + uv_handle_t* handle() { + return reinterpret_cast(timer); + } + + uv_timer_t* timer; + + std::function cb; +}; + +Timer::Timer() + : impl(std::make_unique()) { +} + +Timer::~Timer() = default; + +void Timer::start(Duration timeout, Duration repeat, std::function&& cb) { + impl->start(std::chrono::duration_cast(timeout).count(), + std::chrono::duration_cast(repeat).count(), + std::move(cb)); +} + +void Timer::stop() { + impl->stop(); +} + +} // namespace util +} // namespace mbgl diff --git a/platform/default/src/mbgl/util/utf.cpp b/platform/default/src/mbgl/util/utf.cpp new file mode 100644 index 0000000000..f0f9d3e67a --- /dev/null +++ b/platform/default/src/mbgl/util/utf.cpp @@ -0,0 +1,17 @@ +#include + +#include + +namespace mbgl { +namespace util { + +std::u16string convertUTF8ToUTF16(const std::string& str) { + return boost::locale::conv::utf_to_utf(str); +} + +std::string convertUTF16ToUTF8(const std::u16string& str) { + return boost::locale::conv::utf_to_utf(str); +} + +} // namespace util +} // namespace mbgl diff --git a/platform/default/string_stdlib.cpp b/platform/default/string_stdlib.cpp deleted file mode 100644 index 103444df1c..0000000000 --- a/platform/default/string_stdlib.cpp +++ /dev/null @@ -1,74 +0,0 @@ -#include -#include -#include -#include - -namespace mbgl { namespace platform { - -std::string uppercase(const std::string& str) -{ - std::stringstream output; - char const *itr = str.c_str(), *nitr; - char const *end = itr + str.length(); - char lo[5] = { 0 }; - - for (; itr < end; itr = nitr) - { - uint32_t code_point = 0; - char const* buf = nullptr; - - nitr = _nu_toupper(itr, end, nu_utf8_read, &code_point, &buf, nullptr); - if (buf != nullptr) - { - do - { - buf = NU_CASEMAP_DECODING_FUNCTION(buf, &code_point); - if (code_point == 0) break; - output.write(lo, nu_utf8_write(code_point, lo) - lo); - } - while (code_point != 0); - } - else - { - output.write(itr, nitr - itr); - } - } - - return output.str(); - -} - -std::string lowercase(const std::string& str) -{ - std::stringstream output; - char const *itr = str.c_str(), *nitr; - char const *end = itr + str.length(); - char lo[5] = { 0 }; - - for (; itr < end; itr = nitr) - { - uint32_t code_point = 0; - char const* buf = nullptr; - - nitr = _nu_tolower(itr, end, nu_utf8_read, &code_point, &buf, nullptr); - if (buf != nullptr) - { - do - { - buf = NU_CASEMAP_DECODING_FUNCTION(buf, &code_point); - if (code_point == 0) break; - output.write(lo, nu_utf8_write(code_point, lo) - lo); - } - while (code_point != 0); - } - else - { - output.write(itr, nitr - itr); - } - } - - return output.str(); -} - -} // namespace platform -} // namespace mbgl diff --git a/platform/default/thread.cpp b/platform/default/thread.cpp deleted file mode 100644 index c7c79b4fb0..0000000000 --- a/platform/default/thread.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include - -#include - -#include -#include - -namespace mbgl { -namespace platform { - -std::string getCurrentThreadName() { - char name[32] = "unknown"; - pthread_getname_np(pthread_self(), name, sizeof(name)); - - return name; -} - -void setCurrentThreadName(const std::string& name) { - if (name.size() > 15) { // Linux hard limit (see manpages). - pthread_setname_np(pthread_self(), name.substr(0, 15).c_str()); - } else { - pthread_setname_np(pthread_self(), name.c_str()); - } -} - -void makeThreadLowPriority() { - struct sched_param param; - param.sched_priority = 0; - - if (sched_setscheduler(0, SCHED_IDLE, ¶m) != 0) { - Log::Warning(Event::General, "Couldn't set thread scheduling policy"); - } -} - -} // namespace platform -} // namespace mbgl diff --git a/platform/default/thread_local.cpp b/platform/default/thread_local.cpp deleted file mode 100644 index db70773c12..0000000000 --- a/platform/default/thread_local.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include - -#include -#include -#include - -#include -#include - -#include - -namespace mbgl { -namespace util { - -template -class ThreadLocal::Impl { -public: - pthread_key_t key; -}; - -template -ThreadLocal::ThreadLocal() : impl(std::make_unique()) { - int ret = pthread_key_create(&impl->key, [](void *) {}); - - if (ret) { - throw std::runtime_error("Failed to init local storage key."); - } -} - -template -ThreadLocal::~ThreadLocal() { - // ThreadLocal will not take ownership - // of the pointer it is managing. The pointer - // needs to be explicitly cleared before we - // destroy this object. - assert(!get()); - - if (pthread_key_delete(impl->key)) { - Log::Error(Event::General, "Failed to delete local storage key."); - assert(false); - } -} - -template -T* ThreadLocal::get() { - auto* ret = reinterpret_cast(pthread_getspecific(impl->key)); - if (!ret) { - return nullptr; - } - - return ret; -} - -template -void ThreadLocal::set(T* ptr) { - if (pthread_setspecific(impl->key, ptr)) { - throw std::runtime_error("Failed to set local storage."); - } -} - -template class ThreadLocal; -template class ThreadLocal; -template class ThreadLocal; // For unit tests - -} // namespace util -} // namespace mbgl diff --git a/platform/default/timer.cpp b/platform/default/timer.cpp deleted file mode 100644 index 90a85bfc1f..0000000000 --- a/platform/default/timer.cpp +++ /dev/null @@ -1,73 +0,0 @@ -#include - -#include - -#include - -namespace mbgl { -namespace util { - -class Timer::Impl { -public: - Impl() : timer(new uv_timer_t) { - auto* loop = reinterpret_cast(RunLoop::getLoopHandle()); - if (uv_timer_init(loop, timer) != 0) { - throw std::runtime_error("Failed to initialize timer."); - } - - handle()->data = this; - uv_unref(handle()); - } - - ~Impl() { - uv_close(handle(), [](uv_handle_t* h) { - delete reinterpret_cast(h); - }); - } - - void start(uint64_t timeout, uint64_t repeat, std::function&& cb_) { - cb = std::move(cb_); - if (uv_timer_start(timer, timerCallback, timeout, repeat) != 0) { - throw std::runtime_error("Failed to start timer."); - } - } - - void stop() { - cb = nullptr; - if (uv_timer_stop(timer) != 0) { - throw std::runtime_error("Failed to stop timer."); - } - } - -private: - static void timerCallback(uv_timer_t* handle) { - reinterpret_cast(handle->data)->cb(); - } - - uv_handle_t* handle() { - return reinterpret_cast(timer); - } - - uv_timer_t* timer; - - std::function cb; -}; - -Timer::Timer() - : impl(std::make_unique()) { -} - -Timer::~Timer() = default; - -void Timer::start(Duration timeout, Duration repeat, std::function&& cb) { - impl->start(std::chrono::duration_cast(timeout).count(), - std::chrono::duration_cast(repeat).count(), - std::move(cb)); -} - -void Timer::stop() { - impl->stop(); -} - -} // namespace util -} // namespace mbgl diff --git a/platform/default/unaccent.cpp b/platform/default/unaccent.cpp deleted file mode 100644 index faefb4b4cd..0000000000 --- a/platform/default/unaccent.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include -#include -#include - -#include -#include - -namespace mbgl { namespace platform { - -std::string unaccent(const std::string& str) -{ - std::stringstream output; - char const *itr = str.c_str(), *nitr; - char const *end = itr + str.length(); - char lo[5] = { 0 }; - - for (; itr < end; itr = nitr) - { - uint32_t code_point = 0; - char const* buf = nullptr; - - nitr = _nu_tounaccent(itr, end, nu_utf8_read, &code_point, &buf, nullptr); - if (buf != nullptr) - { - do - { - buf = NU_CASEMAP_DECODING_FUNCTION(buf, &code_point); - if (code_point == 0) break; - output.write(lo, nu_utf8_write(code_point, lo) - lo); - } - while (code_point != 0); - } - else - { - output.write(itr, nitr - itr); - } - } - - return output.str(); -} - -} // namespace platform -} // namespace mbgl diff --git a/platform/default/unaccent.hpp b/platform/default/unaccent.hpp deleted file mode 100644 index 85ac37a7de..0000000000 --- a/platform/default/unaccent.hpp +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include - -namespace mbgl { -namespace platform { - -// Non-locale-aware diacritic folding based on nunicode -// Used as a fallback when locale-aware comparisons aren't available -std::string unaccent(const std::string &string); - -} // namespace platform -} // namespace mbgl diff --git a/platform/default/utf.cpp b/platform/default/utf.cpp deleted file mode 100644 index f0f9d3e67a..0000000000 --- a/platform/default/utf.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include - -#include - -namespace mbgl { -namespace util { - -std::u16string convertUTF8ToUTF16(const std::string& str) { - return boost::locale::conv::utf_to_utf(str); -} - -std::string convertUTF16ToUTF8(const std::u16string& str) { - return boost::locale::conv::utf_to_utf(str); -} - -} // namespace util -} // namespace mbgl diff --git a/platform/ios/config.cmake b/platform/ios/config.cmake index 320ef7e73b..98a8b48a05 100644 --- a/platform/ios/config.cmake +++ b/platform/ios/config.cmake @@ -20,49 +20,11 @@ initialize_ios_target(mbgl-loop-darwin) macro(mbgl_platform_core) initialize_ios_target(mbgl-core) - target_sources(mbgl-core - # Default styles - PRIVATE platform/default/mbgl/util/default_styles.hpp - - # Misc - PRIVATE platform/darwin/mbgl/storage/reachability.h - PRIVATE platform/darwin/mbgl/storage/reachability.m - PRIVATE platform/darwin/src/CFHandle.hpp - PRIVATE platform/darwin/src/collator.mm - PRIVATE platform/darwin/src/local_glyph_rasterizer.mm - PRIVATE platform/darwin/src/logging_nslog.mm - PRIVATE platform/darwin/src/nsthread.mm - PRIVATE platform/darwin/src/string_nsstring.mm - PRIVATE platform/default/bidi.cpp - PRIVATE platform/default/thread_local.cpp - PRIVATE platform/default/utf.cpp - - # Image handling - PRIVATE platform/darwin/mbgl/util/image+MGLAdditions.hpp - PRIVATE platform/darwin/src/image.mm - PRIVATE platform/default/png_writer.cpp - - # Headless view - PRIVATE platform/default/mbgl/gl/headless_frontend.cpp - PRIVATE platform/default/mbgl/gl/headless_frontend.hpp - PRIVATE platform/default/mbgl/gl/headless_backend.cpp - PRIVATE platform/default/mbgl/gl/headless_backend.hpp - PRIVATE platform/darwin/src/headless_backend_eagl.mm - - # Snapshotting - PRIVATE platform/default/mbgl/map/map_snapshotter.cpp - PRIVATE platform/default/mbgl/map/map_snapshotter.hpp - - # Thread pool - PRIVATE platform/default/mbgl/util/shared_thread_pool.cpp - PRIVATE platform/default/mbgl/util/shared_thread_pool.hpp - PRIVATE platform/default/mbgl/util/default_thread_pool.cpp - PRIVATE platform/default/mbgl/util/default_thread_pool.cpp - ) + target_sources_from_file(mbgl-core PRIVATE platform/ios/core-files.txt) target_include_directories(mbgl-core - PUBLIC platform/darwin - PUBLIC platform/default + PUBLIC platform/darwin/include + PUBLIC platform/default/include ) target_link_libraries(mbgl-core diff --git a/platform/ios/core-files.txt b/platform/ios/core-files.txt index b1e708e727..fa6d263d00 100644 --- a/platform/ios/core-files.txt +++ b/platform/ios/core-files.txt @@ -1,320 +1,36 @@ -# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js - -# SDK -platform/ios/src/Mapbox.h - -# SDK/Foundation -platform/darwin/src/MGLAccountManager.h -platform/darwin/src/MGLAccountManager.m -platform/darwin/src/MGLAccountManager_Private.h -platform/darwin/src/MGLAttributionInfo.h -platform/darwin/src/MGLAttributionInfo.mm -platform/darwin/src/MGLAttributionInfo_Private.h -platform/darwin/src/MGLFoundation.h -platform/darwin/src/MGLFoundation.mm -platform/darwin/src/MGLFoundation_Private.h -platform/darwin/src/MGLLocationManager.h -platform/darwin/src/MGLLocationManager.m -platform/darwin/src/MGLLocationManager_Private.h -platform/darwin/src/MGLLoggingConfiguration.h -platform/darwin/src/MGLLoggingConfiguration.m -platform/darwin/src/MGLLoggingConfiguration_Private.h -platform/darwin/src/MGLMapCamera.h -platform/darwin/src/MGLMapCamera.mm -platform/darwin/src/MGLMapSnapshotter.h -platform/darwin/src/MGLMapSnapshotter.mm -platform/darwin/src/MGLNetworkConfiguration.h -platform/darwin/src/MGLNetworkConfiguration.m -platform/darwin/src/MGLRendererConfiguration.h -platform/darwin/src/MGLRendererConfiguration.mm -platform/darwin/src/MGLRendererFrontend.h -platform/darwin/src/MGLStyle.h -platform/darwin/src/MGLStyle.mm -platform/darwin/src/MGLStyle_Private.h -platform/darwin/src/MGLTypes.h -platform/darwin/src/MGLTypes.m -platform/darwin/src/MGLValueEvaluator.h - -# SDK/Foundation/Categories -platform/darwin/src/NSArray+MGLAdditions.h -platform/darwin/src/NSArray+MGLAdditions.mm -platform/darwin/src/NSBundle+MGLAdditions.h -platform/darwin/src/NSBundle+MGLAdditions.m -platform/darwin/src/NSComparisonPredicate+MGLAdditions.h -platform/darwin/src/NSComparisonPredicate+MGLAdditions.mm -platform/darwin/src/NSCompoundPredicate+MGLAdditions.h -platform/darwin/src/NSCompoundPredicate+MGLAdditions.mm -platform/darwin/src/NSData+MGLAdditions.h -platform/darwin/src/NSData+MGLAdditions.mm -platform/darwin/src/NSDate+MGLAdditions.h -platform/darwin/src/NSDate+MGLAdditions.mm -platform/darwin/src/NSDictionary+MGLAdditions.h -platform/darwin/src/NSDictionary+MGLAdditions.mm -platform/darwin/src/NSException+MGLAdditions.h -platform/darwin/src/NSExpression+MGLAdditions.h -platform/darwin/src/NSExpression+MGLAdditions.mm -platform/darwin/src/NSExpression+MGLPrivateAdditions.h -platform/darwin/src/NSPredicate+MGLAdditions.h -platform/darwin/src/NSPredicate+MGLAdditions.mm -platform/darwin/src/NSPredicate+MGLPrivateAdditions.h -platform/darwin/src/NSProcessInfo+MGLAdditions.h -platform/darwin/src/NSProcessInfo+MGLAdditions.m -platform/darwin/src/NSString+MGLAdditions.h -platform/darwin/src/NSString+MGLAdditions.m -platform/darwin/src/NSURL+MGLAdditions.h -platform/darwin/src/NSURL+MGLAdditions.m -platform/darwin/src/NSValue+MGLAdditions.h -platform/darwin/src/NSValue+MGLAdditions.m - -# SDK/Foundation/Formatters -platform/darwin/src/MGLClockDirectionFormatter.h -platform/darwin/src/MGLClockDirectionFormatter.m -platform/darwin/src/MGLCompassDirectionFormatter.h -platform/darwin/src/MGLCompassDirectionFormatter.m -platform/darwin/src/MGLCoordinateFormatter.h -platform/darwin/src/MGLCoordinateFormatter.m -platform/darwin/src/MGLDistanceFormatter.h -platform/darwin/src/MGLDistanceFormatter.m - -# SDK/Foundation/Geometry -platform/darwin/src/MGLAnnotation.h -platform/darwin/src/MGLFeature.h -platform/darwin/src/MGLFeature.mm -platform/darwin/src/MGLFeature_Private.h -platform/darwin/src/MGLGeometry.h -platform/darwin/src/MGLGeometry.mm -platform/darwin/src/MGLGeometry_Private.h -platform/darwin/src/MGLMultiPoint.h -platform/darwin/src/MGLMultiPoint.mm -platform/darwin/src/MGLMultiPoint_Private.h -platform/darwin/src/MGLOverlay.h -platform/darwin/src/MGLPointAnnotation.h -platform/darwin/src/MGLPointAnnotation.mm -platform/darwin/src/MGLPointCollection.h -platform/darwin/src/MGLPointCollection.mm -platform/darwin/src/MGLPointCollection_Private.h -platform/darwin/src/MGLPolygon.h -platform/darwin/src/MGLPolygon.mm -platform/darwin/src/MGLPolygon_Private.h -platform/darwin/src/MGLPolyline.h -platform/darwin/src/MGLPolyline.mm -platform/darwin/src/MGLPolyline_Private.h -platform/darwin/src/MGLShape.h -platform/darwin/src/MGLShape.mm -platform/darwin/src/MGLShapeCollection.h -platform/darwin/src/MGLShapeCollection.mm -platform/darwin/src/MGLShape_Private.h - -# SDK/Foundation/Offline Maps -platform/darwin/src/MGLOfflinePack.h -platform/darwin/src/MGLOfflinePack.mm -platform/darwin/src/MGLOfflinePack_Private.h -platform/darwin/src/MGLOfflineRegion.h -platform/darwin/src/MGLOfflineRegion_Private.h -platform/darwin/src/MGLOfflineStorage.h -platform/darwin/src/MGLOfflineStorage.mm -platform/darwin/src/MGLOfflineStorage_Private.h -platform/darwin/src/MGLShapeOfflineRegion.h -platform/darwin/src/MGLShapeOfflineRegion.mm -platform/darwin/src/MGLShapeOfflineRegion_Private.h -platform/darwin/src/MGLTilePyramidOfflineRegion.h -platform/darwin/src/MGLTilePyramidOfflineRegion.mm -platform/darwin/src/MGLTilePyramidOfflineRegion_Private.h - -# SDK/Foundation/Styling -platform/darwin/src/MGLConversion.h -platform/darwin/src/MGLLight.h -platform/darwin/src/MGLLight.mm -platform/darwin/src/MGLLight_Private.h -platform/darwin/src/MGLStyleValue.h -platform/darwin/src/MGLStyleValue.mm -platform/darwin/src/MGLStyleValue_Private.h - -# SDK/Foundation/Styling/Categories -platform/darwin/src/NSValue+MGLStyleAttributeAdditions.h -platform/darwin/src/NSValue+MGLStyleAttributeAdditions.mm - -# SDK/Foundation/Styling/Layers -platform/darwin/src/MGLBackgroundStyleLayer.h -platform/darwin/src/MGLBackgroundStyleLayer.mm -platform/darwin/src/MGLBackgroundStyleLayer_Private.h -platform/darwin/src/MGLCircleStyleLayer.h -platform/darwin/src/MGLCircleStyleLayer.mm -platform/darwin/src/MGLCircleStyleLayer_Private.h -platform/darwin/src/MGLFillExtrusionStyleLayer.h -platform/darwin/src/MGLFillExtrusionStyleLayer.mm -platform/darwin/src/MGLFillExtrusionStyleLayer_Private.h -platform/darwin/src/MGLFillStyleLayer.h -platform/darwin/src/MGLFillStyleLayer.mm -platform/darwin/src/MGLFillStyleLayer_Private.h -platform/darwin/src/MGLForegroundStyleLayer.h -platform/darwin/src/MGLForegroundStyleLayer.mm -platform/darwin/src/MGLHeatmapStyleLayer.h -platform/darwin/src/MGLHeatmapStyleLayer.mm -platform/darwin/src/MGLHeatmapStyleLayer_Private.h -platform/darwin/src/MGLHillshadeStyleLayer.h -platform/darwin/src/MGLHillshadeStyleLayer.mm -platform/darwin/src/MGLHillshadeStyleLayer_Private.h -platform/darwin/src/MGLLineStyleLayer.h -platform/darwin/src/MGLLineStyleLayer.mm -platform/darwin/src/MGLLineStyleLayer_Private.h -platform/darwin/src/MGLOpenGLStyleLayer.h -platform/darwin/src/MGLOpenGLStyleLayer.mm -platform/darwin/src/MGLOpenGLStyleLayer_Private.h -platform/darwin/src/MGLRasterStyleLayer.h -platform/darwin/src/MGLRasterStyleLayer.mm -platform/darwin/src/MGLRasterStyleLayer_Private.h -platform/darwin/src/MGLStyleLayer.h -platform/darwin/src/MGLStyleLayer.mm -platform/darwin/src/MGLStyleLayerManager.h -platform/darwin/src/MGLStyleLayerManager.mm -platform/darwin/src/MGLStyleLayer_Private.h -platform/darwin/src/MGLSymbolStyleLayer.h -platform/darwin/src/MGLSymbolStyleLayer.mm -platform/darwin/src/MGLSymbolStyleLayer_Private.h -platform/darwin/src/MGLVectorStyleLayer.h -platform/darwin/src/MGLVectorStyleLayer.m - -# SDK/Foundation/Styling/Sources -platform/darwin/src/MGLComputedShapeSource.h -platform/darwin/src/MGLComputedShapeSource.mm -platform/darwin/src/MGLComputedShapeSource_Private.h -platform/darwin/src/MGLImageSource.h -platform/darwin/src/MGLImageSource.mm -platform/darwin/src/MGLRasterDEMSource.h -platform/darwin/src/MGLRasterDEMSource.mm -platform/darwin/src/MGLRasterTileSource.h -platform/darwin/src/MGLRasterTileSource.mm -platform/darwin/src/MGLRasterTileSource_Private.h -platform/darwin/src/MGLShapeSource.h -platform/darwin/src/MGLShapeSource.mm -platform/darwin/src/MGLShapeSource_Private.h -platform/darwin/src/MGLSource.h -platform/darwin/src/MGLSource.mm -platform/darwin/src/MGLSource_Private.h -platform/darwin/src/MGLTileSource.h -platform/darwin/src/MGLTileSource.mm -platform/darwin/src/MGLTileSource_Private.h -platform/darwin/src/MGLVectorTileSource.h -platform/darwin/src/MGLVectorTileSource.mm -platform/darwin/src/MGLVectorTileSource_Private.h - -# SDK/Kit -platform/ios/src/MGLCameraChangeReason.h -platform/ios/src/MGLMapAccessibilityElement.h -platform/ios/src/MGLMapAccessibilityElement.mm -platform/ios/src/MGLMapView+IBAdditions.h -platform/ios/src/MGLMapView.h -platform/ios/src/MGLMapView.mm -platform/ios/src/MGLMapViewDelegate.h -platform/ios/src/MGLMapView_Private.h - -# SDK/Kit/Annotations -platform/ios/src/MGLAnnotationContainerView.h -platform/ios/src/MGLAnnotationContainerView.m -platform/ios/src/MGLAnnotationContainerView_Private.h -platform/ios/src/MGLAnnotationImage.h -platform/ios/src/MGLAnnotationImage.m -platform/ios/src/MGLAnnotationImage_Private.h -platform/ios/src/MGLAnnotationView.h -platform/ios/src/MGLAnnotationView.mm -platform/ios/src/MGLAnnotationView_Private.h -platform/ios/src/MGLCalloutView.h -platform/ios/src/MGLCompactCalloutView.h -platform/ios/src/MGLCompactCalloutView.m -platform/ios/src/MGLFaux3DUserLocationAnnotationView.h -platform/ios/src/MGLFaux3DUserLocationAnnotationView.m -platform/ios/src/MGLUserLocation.h -platform/ios/src/MGLUserLocation.m -platform/ios/src/MGLUserLocationAnnotationView.h -platform/ios/src/MGLUserLocationAnnotationView.m -platform/ios/src/MGLUserLocationAnnotationView_Private.h -platform/ios/src/MGLUserLocationHeadingArrowLayer.h -platform/ios/src/MGLUserLocationHeadingArrowLayer.m -platform/ios/src/MGLUserLocationHeadingBeamLayer.h -platform/ios/src/MGLUserLocationHeadingBeamLayer.m -platform/ios/src/MGLUserLocationHeadingIndicator.h -platform/ios/src/MGLUserLocation_Private.h - -# SDK/Kit/Categories -platform/darwin/src/NSCoder+MGLAdditions.h -platform/darwin/src/NSCoder+MGLAdditions.mm -platform/ios/src/NSOrthography+MGLAdditions.h -platform/ios/src/NSOrthography+MGLAdditions.m -platform/ios/src/UIColor+MGLAdditions.h -platform/ios/src/UIColor+MGLAdditions.mm -platform/ios/src/UIDevice+MGLAdditions.h -platform/ios/src/UIDevice+MGLAdditions.m -platform/ios/src/UIImage+MGLAdditions.h -platform/ios/src/UIImage+MGLAdditions.mm -platform/ios/src/UIViewController+MGLAdditions.h -platform/ios/src/UIViewController+MGLAdditions.m - -# SDK/Kit/SMCalloutView -platform/ios/vendor/SMCalloutView/SMCalloutView.h -platform/ios/vendor/SMCalloutView/SMCalloutView.m - -# SDK/Kit/Telemetry -platform/ios/src/MGLTelemetryConfig.h -platform/ios/src/MGLTelemetryConfig.m - -# SDK/Kit/Telemetry/Development -platform/ios/src/MGLSDKUpdateChecker.h -platform/ios/src/MGLSDKUpdateChecker.mm - -# SDK/Kit/Telemetry/Runtime -platform/ios/src/MGLMapboxEvents.h -platform/ios/src/MGLMapboxEvents.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/CLLocation+MMEMobileEvents.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEAPIClient.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMECategoryLoader.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMECommonEventData.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEConfigurator.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEConstants.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEDependencyManager.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEDispatchManager.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEEvent.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEEventLogReportViewController.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEEventLogger.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEEventsConfiguration.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEEventsManager.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEHashProvider.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMELocationManager.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEMetrics.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEMetricsManager.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMENSDateWrapper.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMENSURLSessionWrapper.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMETimerManager.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMETrustKitProvider.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMETypes.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEUIApplicationWrapper.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEUINavigation.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEUniqueIdentifier.m -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/NSData+MMEGZIP.m - -# SDK/Kit/Telemetry/Runtime/Reachability -platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/Reachability/MMEReachability.m - -# SDK/Kit/Telemetry/Runtime/TrustKit -platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/TSKPinningValidator.m -platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/TSKPinningValidatorResult.m -platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/TSKTrustKitConfig.m -platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/TrustKit.m -platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/configuration_utils.m -platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/parse_configuration.m - -# SDK/Kit/Telemetry/Runtime/TrustKit/Pinning -platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Pinning/TSKSPKIHashCache.m -platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Pinning/ssl_pin_verifier.m - -# SDK/Kit/Telemetry/Runtime/TrustKit/Reporting -platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Reporting/TSKBackgroundReporter.m -platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Reporting/TSKPinFailureReport.m -platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Reporting/TSKReportsRateLimiter.m -platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Reporting/reporting_utils.m -platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Reporting/vendor_identifier.m - -# SDK/Kit/Views -platform/ios/src/MGLScaleBar.h -platform/ios/src/MGLScaleBar.mm - +platform/default/include/mbgl/util/default_styles.hpp + +# Misc +platform/darwin/include/mbgl/storage/reachability.h +platform/darwin/src/reachability.m +platform/darwin/src/CFHandle.hpp +platform/darwin/src/collator.mm +platform/darwin/src/local_glyph_rasterizer.mm +platform/darwin/src/logging_nslog.mm +platform/darwin/src/nsthread.mm +platform/darwin/src/string_nsstring.mm +platform/default/src/mbgl/text/bidi.cpp +platform/default/src/mbgl/util/thread_local.cpp +platform/default/src/mbgl/util/utf.cpp + +# Image handling +platform/darwin/include/mbgl/util/image+MGLAdditions.hpp +platform/darwin/src/image.mm +platform/default/src/mbgl/util/png_writer.cpp + +# Headless view +platform/default/src/mbgl/gl/headless_frontend.cpp +platform/default/include/mbgl/gl/headless_frontend.hpp +platform/default/src/mbgl/gl/headless_backend.cpp +platform/default/include/mbgl/gl/headless_backend.hpp +platform/darwin/src/headless_backend_eagl.mm + +# Snapshotting +platform/default/src/mbgl/map/map_snapshotter.cpp +platform/default/include/mbgl/map/map_snapshotter.hpp + +# Thread pool +platform/default/src/mbgl/util/shared_thread_pool.cpp +platform/default/include/mbgl/util/shared_thread_pool.hpp +platform/default/src/mbgl/util/default_thread_pool.cpp +platform/default/include/mbgl/util/default_thread_pool.hpp diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj index b2d43f502b..77cf0dd6d9 100644 --- a/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/ios.xcodeproj/project.pbxproj @@ -298,6 +298,53 @@ 55D120A61F791007004B6D81 /* libmbgl-loop-darwin.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 55D120A71F791007004B6D81 /* libmbgl-loop-darwin.a */; }; 55D120A81F79100C004B6D81 /* libmbgl-filesource.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 55D120A91F79100C004B6D81 /* libmbgl-filesource.a */; }; 55E2AD131E5B125400E8C587 /* MGLOfflineStorageTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 55E2AD121E5B125400E8C587 /* MGLOfflineStorageTests.mm */; }; + 55E5663F21C2A0920008B8B5 /* configuration_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834C0F1FE05F3600C1BD0D /* configuration_utils.h */; }; + 55E5664021C2A0920008B8B5 /* parse_configuration.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834C131FE05F3600C1BD0D /* parse_configuration.h */; }; + 55E5664121C2A0920008B8B5 /* ssl_pin_verifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834C161FE05F3600C1BD0D /* ssl_pin_verifier.h */; }; + 55E5664221C2A0920008B8B5 /* TSKPublicKeyAlgorithm.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834C181FE05F3600C1BD0D /* TSKPublicKeyAlgorithm.h */; }; + 55E5664321C2A0920008B8B5 /* TSKSPKIHashCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834C191FE05F3600C1BD0D /* TSKSPKIHashCache.h */; }; + 55E5664421C2A0920008B8B5 /* reporting_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834C1C1FE05F3600C1BD0D /* reporting_utils.h */; }; + 55E5664521C2A0930008B8B5 /* TSKBackgroundReporter.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834C1E1FE05F3600C1BD0D /* TSKBackgroundReporter.h */; }; + 55E5664621C2A0930008B8B5 /* TSKPinFailureReport.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834C201FE05F3600C1BD0D /* TSKPinFailureReport.h */; }; + 55E5664721C2A0930008B8B5 /* TSKReportsRateLimiter.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834C221FE05F3600C1BD0D /* TSKReportsRateLimiter.h */; }; + 55E5664821C2A0930008B8B5 /* vendor_identifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834C241FE05F3600C1BD0D /* vendor_identifier.h */; }; + 55E5664921C2A0930008B8B5 /* TrustKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834C261FE05F3600C1BD0D /* TrustKit.h */; }; + 55E5664A21C2A0930008B8B5 /* TSKLog.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834C281FE05F3600C1BD0D /* TSKLog.h */; }; + 55E5664B21C2A0930008B8B5 /* TSKPinningValidator.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834C291FE05F3600C1BD0D /* TSKPinningValidator.h */; }; + 55E5664C21C2A0930008B8B5 /* TSKPinningValidator_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834C2B1FE05F3600C1BD0D /* TSKPinningValidator_Private.h */; }; + 55E5664D21C2A0930008B8B5 /* TSKPinningValidatorCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834C2C1FE05F3600C1BD0D /* TSKPinningValidatorCallback.h */; }; + 55E5664E21C2A0930008B8B5 /* TSKPinningValidatorResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834C2D1FE05F3600C1BD0D /* TSKPinningValidatorResult.h */; }; + 55E5664F21C2A0930008B8B5 /* TSKTrustDecision.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834C2F1FE05F3600C1BD0D /* TSKTrustDecision.h */; }; + 55E5665021C2A0930008B8B5 /* TSKTrustKitConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834C301FE05F3600C1BD0D /* TSKTrustKitConfig.h */; }; + 55E5665121C2A1C20008B8B5 /* MMEReachability.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834BCC1FE05D7100C1BD0D /* MMEReachability.h */; }; + 55E5665221C2A2080008B8B5 /* MMENamespacedDependencies.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834BC81FE05D7000C1BD0D /* MMENamespacedDependencies.h */; }; + 55E5665321C2A2080008B8B5 /* MapboxMobileEvents.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834BAC1FE05D6C00C1BD0D /* MapboxMobileEvents.h */; }; + 55E5665421C2A2080008B8B5 /* CLLocation+MMEMobileEvents.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834BC21FE05D6F00C1BD0D /* CLLocation+MMEMobileEvents.h */; }; + 55E5665521C2A2080008B8B5 /* MMEAPIClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834BAB1FE05D6C00C1BD0D /* MMEAPIClient.h */; }; + 55E5665621C2A2080008B8B5 /* MMECategoryLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834BB51FE05D6D00C1BD0D /* MMECategoryLoader.h */; }; + 55E5665721C2A2080008B8B5 /* MMECommonEventData.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834BAE1FE05D6C00C1BD0D /* MMECommonEventData.h */; }; + 55E5665821C2A2080008B8B5 /* MMEConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834BB01FE05D6C00C1BD0D /* MMEConstants.h */; }; + 55E5665921C2A2080008B8B5 /* MMEDependencyManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834BB11FE05D6D00C1BD0D /* MMEDependencyManager.h */; }; + 55E5665A21C2A2080008B8B5 /* MMEEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834BBA1FE05D6E00C1BD0D /* MMEEvent.h */; }; + 55E5665B21C2A2080008B8B5 /* MMEEventLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834BA61FE05D6B00C1BD0D /* MMEEventLogger.h */; }; + 55E5665C21C2A2080008B8B5 /* MMEEventLogReportViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 406E99B51FFEFED600D9FFCC /* MMEEventLogReportViewController.h */; }; + 55E5665D21C2A2080008B8B5 /* MMEEventsConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834BBB1FE05D6E00C1BD0D /* MMEEventsConfiguration.h */; }; + 55E5665E21C2A2080008B8B5 /* MMEHashProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = ACA65F4A214066AB00537748 /* MMEHashProvider.h */; }; + 55E5665F21C2A2080008B8B5 /* MMETrustKitProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = ACA65F442140667D00537748 /* MMETrustKitProvider.h */; }; + 55E5666021C2A2080008B8B5 /* MMEConfigurator.h in Headers */ = {isa = PBXBuildFile; fileRef = ACA65F4F214066E200537748 /* MMEConfigurator.h */; }; + 55E5666121C2A2080008B8B5 /* MMEEventsManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834BA31FE05D6B00C1BD0D /* MMEEventsManager.h */; }; + 55E5666221C2A2080008B8B5 /* MMELocationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834BB31FE05D6D00C1BD0D /* MMELocationManager.h */; }; + 55E5666321C2A2080008B8B5 /* MMEMetrics.h in Headers */ = {isa = PBXBuildFile; fileRef = ACD024552187EAAF00D8C8A7 /* MMEMetrics.h */; }; + 55E5666421C2A2080008B8B5 /* MMEMetricsManager.h in Headers */ = {isa = PBXBuildFile; fileRef = ACD024562187EAAF00D8C8A7 /* MMEMetricsManager.h */; }; + 55E5666521C2A2080008B8B5 /* MMENSDateWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834BC51FE05D6F00C1BD0D /* MMENSDateWrapper.h */; }; + 55E5666621C2A2080008B8B5 /* MMENSURLSessionWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834BAA1FE05D6C00C1BD0D /* MMENSURLSessionWrapper.h */; }; + 55E5666721C2A2080008B8B5 /* MMETimerManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834BC91FE05D7000C1BD0D /* MMETimerManager.h */; }; + 55E5666821C2A2080008B8B5 /* MMETypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834BB61FE05D6D00C1BD0D /* MMETypes.h */; }; + 55E5666921C2A2080008B8B5 /* MMEUIApplicationWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834BBE1FE05D6E00C1BD0D /* MMEUIApplicationWrapper.h */; }; + 55E5666A21C2A2080008B8B5 /* MMEUINavigation.h in Headers */ = {isa = PBXBuildFile; fileRef = 406E99B31FFEFED600D9FFCC /* MMEUINavigation.h */; }; + 55E5666B21C2A2080008B8B5 /* MMEUniqueIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834BBF1FE05D6E00C1BD0D /* MMEUniqueIdentifier.h */; }; + 55E5666C21C2A2080008B8B5 /* MMEDispatchManager.h in Headers */ = {isa = PBXBuildFile; fileRef = ACA65F552140696B00537748 /* MMEDispatchManager.h */; }; + 55E5666D21C2A2080008B8B5 /* NSData+MMEGZIP.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834BCF1FE05D7100C1BD0D /* NSData+MMEGZIP.h */; }; 632281DF1E6F855900D75A5D /* MBXEmbeddedMapViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 632281DE1E6F855900D75A5D /* MBXEmbeddedMapViewController.m */; }; 6407D6701E0085FD00F6A9C3 /* MGLDocumentationExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6407D66F1E0085FD00F6A9C3 /* MGLDocumentationExampleTests.swift */; }; 74CB5EB1219B252C00102936 /* MGLStyleLayerManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 74CB5EAF219B252C00102936 /* MGLStyleLayerManager.h */; }; @@ -2359,7 +2406,6 @@ DA6408DB1DA4E7D300908C90 /* MGLVectorStyleLayer.h in Headers */, DA704CC21F65A475004B3F28 /* MGLMapAccessibilityElement.h in Headers */, DD0902AB1DB192A800C5BDCE /* MGLNetworkConfiguration.h in Headers */, - DA8848571CBAFB9800AB86E3 /* MGLMapboxEvents.h in Headers */, 35D3A1E61E9BE7EB002B38EE /* MGLScaleBar.h in Headers */, 0778DD431F67556700A73B34 /* MGLComputedShapeSource.h in Headers */, 1F6A82A221360F9D00BA5B41 /* MGLLoggingConfiguration.h in Headers */, @@ -2441,6 +2487,54 @@ DAD1656E1CF41981001FF4B9 /* MGLFeature_Private.h in Headers */, DA88483C1CBAFB8500AB86E3 /* MGLMapView.h in Headers */, 3EA9363147E77DD29FA06063 /* MGLRendererConfiguration.h in Headers */, + 55E5663F21C2A0920008B8B5 /* configuration_utils.h in Headers */, + 55E5664021C2A0920008B8B5 /* parse_configuration.h in Headers */, + 55E5664121C2A0920008B8B5 /* ssl_pin_verifier.h in Headers */, + 55E5664221C2A0920008B8B5 /* TSKPublicKeyAlgorithm.h in Headers */, + 55E5664321C2A0920008B8B5 /* TSKSPKIHashCache.h in Headers */, + 55E5664421C2A0920008B8B5 /* reporting_utils.h in Headers */, + 55E5664521C2A0930008B8B5 /* TSKBackgroundReporter.h in Headers */, + 55E5664621C2A0930008B8B5 /* TSKPinFailureReport.h in Headers */, + 55E5664721C2A0930008B8B5 /* TSKReportsRateLimiter.h in Headers */, + 55E5664821C2A0930008B8B5 /* vendor_identifier.h in Headers */, + 55E5664921C2A0930008B8B5 /* TrustKit.h in Headers */, + 55E5664A21C2A0930008B8B5 /* TSKLog.h in Headers */, + 55E5664B21C2A0930008B8B5 /* TSKPinningValidator.h in Headers */, + 55E5664C21C2A0930008B8B5 /* TSKPinningValidator_Private.h in Headers */, + 55E5664D21C2A0930008B8B5 /* TSKPinningValidatorCallback.h in Headers */, + 55E5664E21C2A0930008B8B5 /* TSKPinningValidatorResult.h in Headers */, + 55E5664F21C2A0930008B8B5 /* TSKTrustDecision.h in Headers */, + 55E5665021C2A0930008B8B5 /* TSKTrustKitConfig.h in Headers */, + 55E5665121C2A1C20008B8B5 /* MMEReachability.h in Headers */, + 55E5665221C2A2080008B8B5 /* MMENamespacedDependencies.h in Headers */, + 55E5665321C2A2080008B8B5 /* MapboxMobileEvents.h in Headers */, + DA8848571CBAFB9800AB86E3 /* MGLMapboxEvents.h in Headers */, + 55E5665421C2A2080008B8B5 /* CLLocation+MMEMobileEvents.h in Headers */, + 55E5665521C2A2080008B8B5 /* MMEAPIClient.h in Headers */, + 55E5665621C2A2080008B8B5 /* MMECategoryLoader.h in Headers */, + 55E5665721C2A2080008B8B5 /* MMECommonEventData.h in Headers */, + 55E5665821C2A2080008B8B5 /* MMEConstants.h in Headers */, + 55E5665921C2A2080008B8B5 /* MMEDependencyManager.h in Headers */, + 55E5665A21C2A2080008B8B5 /* MMEEvent.h in Headers */, + 55E5665B21C2A2080008B8B5 /* MMEEventLogger.h in Headers */, + 55E5665C21C2A2080008B8B5 /* MMEEventLogReportViewController.h in Headers */, + 55E5665D21C2A2080008B8B5 /* MMEEventsConfiguration.h in Headers */, + 55E5665E21C2A2080008B8B5 /* MMEHashProvider.h in Headers */, + 55E5665F21C2A2080008B8B5 /* MMETrustKitProvider.h in Headers */, + 55E5666021C2A2080008B8B5 /* MMEConfigurator.h in Headers */, + 55E5666221C2A2080008B8B5 /* MMELocationManager.h in Headers */, + 55E5666321C2A2080008B8B5 /* MMEMetrics.h in Headers */, + 55E5666421C2A2080008B8B5 /* MMEMetricsManager.h in Headers */, + 55E5666521C2A2080008B8B5 /* MMENSDateWrapper.h in Headers */, + 55E5666621C2A2080008B8B5 /* MMENSURLSessionWrapper.h in Headers */, + 55E5666721C2A2080008B8B5 /* MMETimerManager.h in Headers */, + 55E5666821C2A2080008B8B5 /* MMETypes.h in Headers */, + 55E5666921C2A2080008B8B5 /* MMEUIApplicationWrapper.h in Headers */, + 55E5666A21C2A2080008B8B5 /* MMEUINavigation.h in Headers */, + 55E5666B21C2A2080008B8B5 /* MMEUniqueIdentifier.h in Headers */, + 55E5666C21C2A2080008B8B5 /* MMEDispatchManager.h in Headers */, + 55E5666121C2A2080008B8B5 /* MMEEventsManager.h in Headers */, + 55E5666D21C2A2080008B8B5 /* NSData+MMEGZIP.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/platform/ios/sdk-files.txt b/platform/ios/sdk-files.txt new file mode 100644 index 0000000000..474eb3bbc8 --- /dev/null +++ b/platform/ios/sdk-files.txt @@ -0,0 +1,366 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# SDK +platform/ios/src/Mapbox.h + +# SDK/Foundation +platform/darwin/src/MGLAccountManager.h +platform/darwin/src/MGLAccountManager.m +platform/darwin/src/MGLAccountManager_Private.h +platform/darwin/src/MGLAttributionInfo.h +platform/darwin/src/MGLAttributionInfo.mm +platform/darwin/src/MGLAttributionInfo_Private.h +platform/darwin/src/MGLFoundation.h +platform/darwin/src/MGLFoundation.mm +platform/darwin/src/MGLFoundation_Private.h +platform/darwin/src/MGLLocationManager.h +platform/darwin/src/MGLLocationManager.m +platform/darwin/src/MGLLocationManager_Private.h +platform/darwin/src/MGLLoggingConfiguration.h +platform/darwin/src/MGLLoggingConfiguration.m +platform/darwin/src/MGLLoggingConfiguration_Private.h +platform/darwin/src/MGLMapCamera.h +platform/darwin/src/MGLMapCamera.mm +platform/darwin/src/MGLMapSnapshotter.h +platform/darwin/src/MGLMapSnapshotter.mm +platform/darwin/src/MGLNetworkConfiguration.h +platform/darwin/src/MGLNetworkConfiguration.m +platform/darwin/src/MGLRendererConfiguration.h +platform/darwin/src/MGLRendererConfiguration.mm +platform/darwin/src/MGLRendererFrontend.h +platform/darwin/src/MGLStyle.h +platform/darwin/src/MGLStyle.mm +platform/darwin/src/MGLStyle_Private.h +platform/darwin/src/MGLTypes.h +platform/darwin/src/MGLTypes.m +platform/darwin/src/MGLValueEvaluator.h + +# SDK/Foundation/Categories +platform/darwin/src/NSArray+MGLAdditions.h +platform/darwin/src/NSArray+MGLAdditions.mm +platform/darwin/src/NSBundle+MGLAdditions.h +platform/darwin/src/NSBundle+MGLAdditions.m +platform/darwin/src/NSComparisonPredicate+MGLAdditions.h +platform/darwin/src/NSComparisonPredicate+MGLAdditions.mm +platform/darwin/src/NSCompoundPredicate+MGLAdditions.h +platform/darwin/src/NSCompoundPredicate+MGLAdditions.mm +platform/darwin/src/NSData+MGLAdditions.h +platform/darwin/src/NSData+MGLAdditions.mm +platform/darwin/src/NSDate+MGLAdditions.h +platform/darwin/src/NSDate+MGLAdditions.mm +platform/darwin/src/NSDictionary+MGLAdditions.h +platform/darwin/src/NSDictionary+MGLAdditions.mm +platform/darwin/src/NSException+MGLAdditions.h +platform/darwin/src/NSExpression+MGLAdditions.h +platform/darwin/src/NSExpression+MGLAdditions.mm +platform/darwin/src/NSExpression+MGLPrivateAdditions.h +platform/darwin/src/NSPredicate+MGLAdditions.h +platform/darwin/src/NSPredicate+MGLAdditions.mm +platform/darwin/src/NSPredicate+MGLPrivateAdditions.h +platform/darwin/src/NSProcessInfo+MGLAdditions.h +platform/darwin/src/NSProcessInfo+MGLAdditions.m +platform/darwin/src/NSString+MGLAdditions.h +platform/darwin/src/NSString+MGLAdditions.m +platform/darwin/src/NSURL+MGLAdditions.h +platform/darwin/src/NSURL+MGLAdditions.m +platform/darwin/src/NSValue+MGLAdditions.h +platform/darwin/src/NSValue+MGLAdditions.m + +# SDK/Foundation/Formatters +platform/darwin/src/MGLClockDirectionFormatter.h +platform/darwin/src/MGLClockDirectionFormatter.m +platform/darwin/src/MGLCompassDirectionFormatter.h +platform/darwin/src/MGLCompassDirectionFormatter.m +platform/darwin/src/MGLCoordinateFormatter.h +platform/darwin/src/MGLCoordinateFormatter.m +platform/darwin/src/MGLDistanceFormatter.h +platform/darwin/src/MGLDistanceFormatter.m + +# SDK/Foundation/Geometry +platform/darwin/src/MGLAnnotation.h +platform/darwin/src/MGLFeature.h +platform/darwin/src/MGLFeature.mm +platform/darwin/src/MGLFeature_Private.h +platform/darwin/src/MGLGeometry.h +platform/darwin/src/MGLGeometry.mm +platform/darwin/src/MGLGeometry_Private.h +platform/darwin/src/MGLMultiPoint.h +platform/darwin/src/MGLMultiPoint.mm +platform/darwin/src/MGLMultiPoint_Private.h +platform/darwin/src/MGLOverlay.h +platform/darwin/src/MGLPointAnnotation.h +platform/darwin/src/MGLPointAnnotation.mm +platform/darwin/src/MGLPointCollection.h +platform/darwin/src/MGLPointCollection.mm +platform/darwin/src/MGLPointCollection_Private.h +platform/darwin/src/MGLPolygon.h +platform/darwin/src/MGLPolygon.mm +platform/darwin/src/MGLPolygon_Private.h +platform/darwin/src/MGLPolyline.h +platform/darwin/src/MGLPolyline.mm +platform/darwin/src/MGLPolyline_Private.h +platform/darwin/src/MGLShape.h +platform/darwin/src/MGLShape.mm +platform/darwin/src/MGLShapeCollection.h +platform/darwin/src/MGLShapeCollection.mm +platform/darwin/src/MGLShape_Private.h + +# SDK/Foundation/Offline Maps +platform/darwin/src/MGLOfflinePack.h +platform/darwin/src/MGLOfflinePack.mm +platform/darwin/src/MGLOfflinePack_Private.h +platform/darwin/src/MGLOfflineRegion.h +platform/darwin/src/MGLOfflineRegion_Private.h +platform/darwin/src/MGLOfflineStorage.h +platform/darwin/src/MGLOfflineStorage.mm +platform/darwin/src/MGLOfflineStorage_Private.h +platform/darwin/src/MGLShapeOfflineRegion.h +platform/darwin/src/MGLShapeOfflineRegion.mm +platform/darwin/src/MGLShapeOfflineRegion_Private.h +platform/darwin/src/MGLTilePyramidOfflineRegion.h +platform/darwin/src/MGLTilePyramidOfflineRegion.mm +platform/darwin/src/MGLTilePyramidOfflineRegion_Private.h + +# SDK/Foundation/Styling +platform/darwin/src/MGLConversion.h +platform/darwin/src/MGLLight.h +platform/darwin/src/MGLLight.mm +platform/darwin/src/MGLLight_Private.h +platform/darwin/src/MGLStyleValue.h +platform/darwin/src/MGLStyleValue.mm +platform/darwin/src/MGLStyleValue_Private.h + +# SDK/Foundation/Styling/Categories +platform/darwin/src/NSValue+MGLStyleAttributeAdditions.h +platform/darwin/src/NSValue+MGLStyleAttributeAdditions.mm + +# SDK/Foundation/Styling/Layers +platform/darwin/src/MGLBackgroundStyleLayer.h +platform/darwin/src/MGLBackgroundStyleLayer.mm +platform/darwin/src/MGLBackgroundStyleLayer_Private.h +platform/darwin/src/MGLCircleStyleLayer.h +platform/darwin/src/MGLCircleStyleLayer.mm +platform/darwin/src/MGLCircleStyleLayer_Private.h +platform/darwin/src/MGLFillExtrusionStyleLayer.h +platform/darwin/src/MGLFillExtrusionStyleLayer.mm +platform/darwin/src/MGLFillExtrusionStyleLayer_Private.h +platform/darwin/src/MGLFillStyleLayer.h +platform/darwin/src/MGLFillStyleLayer.mm +platform/darwin/src/MGLFillStyleLayer_Private.h +platform/darwin/src/MGLForegroundStyleLayer.h +platform/darwin/src/MGLForegroundStyleLayer.mm +platform/darwin/src/MGLHeatmapStyleLayer.h +platform/darwin/src/MGLHeatmapStyleLayer.mm +platform/darwin/src/MGLHeatmapStyleLayer_Private.h +platform/darwin/src/MGLHillshadeStyleLayer.h +platform/darwin/src/MGLHillshadeStyleLayer.mm +platform/darwin/src/MGLHillshadeStyleLayer_Private.h +platform/darwin/src/MGLLineStyleLayer.h +platform/darwin/src/MGLLineStyleLayer.mm +platform/darwin/src/MGLLineStyleLayer_Private.h +platform/darwin/src/MGLOpenGLStyleLayer.h +platform/darwin/src/MGLOpenGLStyleLayer.mm +platform/darwin/src/MGLOpenGLStyleLayer_Private.h +platform/darwin/src/MGLRasterStyleLayer.h +platform/darwin/src/MGLRasterStyleLayer.mm +platform/darwin/src/MGLRasterStyleLayer_Private.h +platform/darwin/src/MGLStyleLayer.h +platform/darwin/src/MGLStyleLayer.mm +platform/darwin/src/MGLStyleLayerManager.h +platform/darwin/src/MGLStyleLayerManager.mm +platform/darwin/src/MGLStyleLayer_Private.h +platform/darwin/src/MGLSymbolStyleLayer.h +platform/darwin/src/MGLSymbolStyleLayer.mm +platform/darwin/src/MGLSymbolStyleLayer_Private.h +platform/darwin/src/MGLVectorStyleLayer.h +platform/darwin/src/MGLVectorStyleLayer.m + +# SDK/Foundation/Styling/Sources +platform/darwin/src/MGLComputedShapeSource.h +platform/darwin/src/MGLComputedShapeSource.mm +platform/darwin/src/MGLComputedShapeSource_Private.h +platform/darwin/src/MGLImageSource.h +platform/darwin/src/MGLImageSource.mm +platform/darwin/src/MGLRasterDEMSource.h +platform/darwin/src/MGLRasterDEMSource.mm +platform/darwin/src/MGLRasterTileSource.h +platform/darwin/src/MGLRasterTileSource.mm +platform/darwin/src/MGLRasterTileSource_Private.h +platform/darwin/src/MGLShapeSource.h +platform/darwin/src/MGLShapeSource.mm +platform/darwin/src/MGLShapeSource_Private.h +platform/darwin/src/MGLSource.h +platform/darwin/src/MGLSource.mm +platform/darwin/src/MGLSource_Private.h +platform/darwin/src/MGLTileSource.h +platform/darwin/src/MGLTileSource.mm +platform/darwin/src/MGLTileSource_Private.h +platform/darwin/src/MGLVectorTileSource.h +platform/darwin/src/MGLVectorTileSource.mm +platform/darwin/src/MGLVectorTileSource_Private.h + +# SDK/Kit +platform/ios/src/MGLCameraChangeReason.h +platform/ios/src/MGLMapAccessibilityElement.h +platform/ios/src/MGLMapAccessibilityElement.mm +platform/ios/src/MGLMapView+IBAdditions.h +platform/ios/src/MGLMapView.h +platform/ios/src/MGLMapView.mm +platform/ios/src/MGLMapViewDelegate.h +platform/ios/src/MGLMapView_Private.h + +# SDK/Kit/Annotations +platform/ios/src/MGLAnnotationContainerView.h +platform/ios/src/MGLAnnotationContainerView.m +platform/ios/src/MGLAnnotationContainerView_Private.h +platform/ios/src/MGLAnnotationImage.h +platform/ios/src/MGLAnnotationImage.m +platform/ios/src/MGLAnnotationImage_Private.h +platform/ios/src/MGLAnnotationView.h +platform/ios/src/MGLAnnotationView.mm +platform/ios/src/MGLAnnotationView_Private.h +platform/ios/src/MGLCalloutView.h +platform/ios/src/MGLCompactCalloutView.h +platform/ios/src/MGLCompactCalloutView.m +platform/ios/src/MGLFaux3DUserLocationAnnotationView.h +platform/ios/src/MGLFaux3DUserLocationAnnotationView.m +platform/ios/src/MGLUserLocation.h +platform/ios/src/MGLUserLocation.m +platform/ios/src/MGLUserLocationAnnotationView.h +platform/ios/src/MGLUserLocationAnnotationView.m +platform/ios/src/MGLUserLocationAnnotationView_Private.h +platform/ios/src/MGLUserLocationHeadingArrowLayer.h +platform/ios/src/MGLUserLocationHeadingArrowLayer.m +platform/ios/src/MGLUserLocationHeadingBeamLayer.h +platform/ios/src/MGLUserLocationHeadingBeamLayer.m +platform/ios/src/MGLUserLocationHeadingIndicator.h +platform/ios/src/MGLUserLocation_Private.h + +# SDK/Kit/Categories +platform/darwin/src/NSCoder+MGLAdditions.h +platform/darwin/src/NSCoder+MGLAdditions.mm +platform/ios/src/NSOrthography+MGLAdditions.h +platform/ios/src/NSOrthography+MGLAdditions.m +platform/ios/src/UIColor+MGLAdditions.h +platform/ios/src/UIColor+MGLAdditions.mm +platform/ios/src/UIDevice+MGLAdditions.h +platform/ios/src/UIDevice+MGLAdditions.m +platform/ios/src/UIImage+MGLAdditions.h +platform/ios/src/UIImage+MGLAdditions.mm +platform/ios/src/UIViewController+MGLAdditions.h +platform/ios/src/UIViewController+MGLAdditions.m + +# SDK/Kit/SMCalloutView +platform/ios/vendor/SMCalloutView/SMCalloutView.h +platform/ios/vendor/SMCalloutView/SMCalloutView.m + +# SDK/Kit/Telemetry +platform/ios/src/MGLTelemetryConfig.h +platform/ios/src/MGLTelemetryConfig.m + +# SDK/Kit/Telemetry/Development +platform/ios/src/MGLSDKUpdateChecker.h +platform/ios/src/MGLSDKUpdateChecker.mm + +# SDK/Kit/Telemetry/Runtime +platform/ios/src/MGLMapboxEvents.h +platform/ios/src/MGLMapboxEvents.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/CLLocation+MMEMobileEvents.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/CLLocation+MMEMobileEvents.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEAPIClient.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEAPIClient.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMECategoryLoader.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMECategoryLoader.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMECommonEventData.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMECommonEventData.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEConfigurator.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEConfigurator.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEConstants.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEConstants.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEDependencyManager.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEDependencyManager.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEDispatchManager.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEDispatchManager.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEEvent.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEEvent.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEEventLogReportViewController.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEEventLogReportViewController.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEEventLogger.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEEventLogger.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEEventsConfiguration.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEEventsConfiguration.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEEventsManager.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEEventsManager.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEHashProvider.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEHashProvider.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMELocationManager.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMELocationManager.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEMetrics.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEMetrics.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEMetricsManager.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEMetricsManager.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMENSDateWrapper.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMENSDateWrapper.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMENSURLSessionWrapper.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMENSURLSessionWrapper.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMENamespacedDependencies.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMETimerManager.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMETimerManager.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMETrustKitProvider.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMETrustKitProvider.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMETypes.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMETypes.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEUIApplicationWrapper.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEUIApplicationWrapper.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEUINavigation.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEUINavigation.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEUniqueIdentifier.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEUniqueIdentifier.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MapboxMobileEvents.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/NSData+MMEGZIP.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/NSData+MMEGZIP.m + +# SDK/Kit/Telemetry/Runtime/Reachability +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/Reachability/MMEReachability.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/Reachability/MMEReachability.m + +# SDK/Kit/Telemetry/Runtime/TrustKit +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/TSKLog.h +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/TSKPinningValidator.h +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/TSKPinningValidator.m +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/TSKPinningValidatorCallback.h +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/TSKPinningValidatorResult.h +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/TSKPinningValidatorResult.m +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/TSKPinningValidator_Private.h +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/TSKTrustDecision.h +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/TSKTrustKitConfig.h +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/TSKTrustKitConfig.m +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/TrustKit.h +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/TrustKit.m +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/configuration_utils.h +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/configuration_utils.m +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/parse_configuration.h +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/parse_configuration.m + +# SDK/Kit/Telemetry/Runtime/TrustKit/Pinning +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Pinning/TSKPublicKeyAlgorithm.h +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Pinning/TSKSPKIHashCache.h +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Pinning/TSKSPKIHashCache.m +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Pinning/ssl_pin_verifier.h +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Pinning/ssl_pin_verifier.m + +# SDK/Kit/Telemetry/Runtime/TrustKit/Reporting +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Reporting/TSKBackgroundReporter.h +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Reporting/TSKBackgroundReporter.m +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Reporting/TSKPinFailureReport.h +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Reporting/TSKPinFailureReport.m +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Reporting/TSKReportsRateLimiter.h +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Reporting/TSKReportsRateLimiter.m +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Reporting/reporting_utils.h +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Reporting/reporting_utils.m +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Reporting/vendor_identifier.h +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Reporting/vendor_identifier.m + +# SDK/Kit/Views +platform/ios/src/MGLScaleBar.h +platform/ios/src/MGLScaleBar.mm diff --git a/platform/linux/config.cmake b/platform/linux/config.cmake index 984389e4e8..bcd60cac9e 100644 --- a/platform/linux/config.cmake +++ b/platform/linux/config.cmake @@ -1,9 +1,9 @@ include(cmake/sqlite.cmake) add_library(mbgl-loop-uv STATIC - platform/default/async_task.cpp - platform/default/run_loop.cpp - platform/default/timer.cpp + platform/default/src/mbgl/util/async_task.cpp + platform/default/src/mbgl/util/run_loop.cpp + platform/default/src/mbgl/util/timer.cpp ) target_include_directories(mbgl-loop-uv @@ -20,7 +20,7 @@ target_add_mason_package(mbgl-loop-uv PUBLIC libuv) macro(mbgl_platform_core) if(WITH_OSMESA) target_sources(mbgl-core - PRIVATE platform/default/headless_backend_osmesa.cpp + PRIVATE platform/default/src/mbgl/gl/headless_backend_osmesa.cpp ) target_link_libraries(mbgl-core PUBLIC -lOSMesa @@ -42,42 +42,42 @@ macro(mbgl_platform_core) target_sources(mbgl-core # Misc - PRIVATE platform/default/logging_stderr.cpp - PRIVATE platform/default/string_stdlib.cpp - PRIVATE platform/default/thread.cpp - PRIVATE platform/default/bidi.cpp - PRIVATE platform/default/collator.cpp - PRIVATE platform/default/layer_manager.cpp - PRIVATE platform/default/local_glyph_rasterizer.cpp - PRIVATE platform/default/thread_local.cpp - PRIVATE platform/default/unaccent.cpp - PRIVATE platform/default/unaccent.hpp - PRIVATE platform/default/utf.cpp + PRIVATE platform/default/src/mbgl/util/logging_stderr.cpp + PRIVATE platform/default/src/mbgl/util/string_stdlib.cpp + PRIVATE platform/default/src/mbgl/util/thread.cpp + PRIVATE platform/default/src/mbgl/text/bidi.cpp + PRIVATE platform/default/src/mbgl/text/collator.cpp + PRIVATE platform/default/src/mbgl/layermanager/layer_manager.cpp + PRIVATE platform/default/src/mbgl/text/local_glyph_rasterizer.cpp + PRIVATE platform/default/src/mbgl/util/thread_local.cpp + PRIVATE platform/default/src/mbgl/text/unaccent.cpp + PRIVATE platform/default/include/mbgl/text/unaccent.hpp + PRIVATE platform/default/src/mbgl/util/utf.cpp # Image handling - PRIVATE platform/default/image.cpp - PRIVATE platform/default/jpeg_reader.cpp - PRIVATE platform/default/png_writer.cpp - PRIVATE platform/default/png_reader.cpp + PRIVATE platform/default/src/mbgl/util/image.cpp + PRIVATE platform/default/src/mbgl/util/jpeg_reader.cpp + PRIVATE platform/default/src/mbgl/util/png_writer.cpp + PRIVATE platform/default/src/mbgl/util/png_reader.cpp # Headless view - PRIVATE platform/default/mbgl/gl/headless_frontend.cpp - PRIVATE platform/default/mbgl/gl/headless_frontend.hpp - PRIVATE platform/default/mbgl/gl/headless_backend.cpp - PRIVATE platform/default/mbgl/gl/headless_backend.hpp + PRIVATE platform/default/src/mbgl/gl/headless_frontend.cpp + PRIVATE platform/default/include/mbgl/gl/headless_frontend.hpp + PRIVATE platform/default/src/mbgl/gl/headless_backend.cpp + PRIVATE platform/default/include/mbgl/gl/headless_backend.hpp # Snapshotting - PRIVATE platform/default/mbgl/map/map_snapshotter.cpp - PRIVATE platform/default/mbgl/map/map_snapshotter.hpp + PRIVATE platform/default/src/mbgl/map/map_snapshotter.cpp + PRIVATE platform/default/include/mbgl/map/map_snapshotter.hpp # Thread pool - PRIVATE platform/default/mbgl/util/default_thread_pool.cpp - PRIVATE platform/default/mbgl/util/default_thread_pool.cpp - PRIVATE platform/default/mbgl/util/shared_thread_pool.cpp + PRIVATE platform/default/src/mbgl/util/default_thread_pool.cpp + PRIVATE platform/default/src/mbgl/util/default_thread_pool.cpp + PRIVATE platform/default/src/mbgl/util/shared_thread_pool.cpp ) target_include_directories(mbgl-core - PRIVATE platform/default + PRIVATE platform/default/include PRIVATE platform/linux ) @@ -103,10 +103,10 @@ endmacro() macro(mbgl_filesource) target_sources(mbgl-filesource # File source - PRIVATE platform/default/http_file_source.cpp + PRIVATE platform/default/src/mbgl/storage/http_file_source.cpp # Database - PRIVATE platform/default/sqlite3.cpp + PRIVATE platform/default/src/mbgl/storage/sqlite3.cpp ) # We're not referencing any cURL symbols since we're dynamically loading it. However, we want to @@ -151,7 +151,7 @@ endmacro() macro(mbgl_platform_test) target_sources(mbgl-test - PRIVATE platform/default/mbgl/test/main.cpp + PRIVATE platform/default/src/mbgl/test/main.cpp ) target_include_directories(mbgl-test @@ -159,7 +159,7 @@ macro(mbgl_platform_test) ) set_source_files_properties( - platform/default/mbgl/test/main.cpp + platform/default/src/mbgl/test/main.cpp PROPERTIES COMPILE_FLAGS -DWORK_DIRECTORY="${CMAKE_SOURCE_DIR}" ) diff --git a/platform/macos/config.cmake b/platform/macos/config.cmake index e2335842dd..e49a54f5eb 100644 --- a/platform/macos/config.cmake +++ b/platform/macos/config.cmake @@ -1,41 +1,7 @@ include(cmake/loop-darwin.cmake) macro(mbgl_platform_core) - target_sources(mbgl-core - # Misc - PRIVATE platform/darwin/mbgl/storage/reachability.h - PRIVATE platform/darwin/mbgl/storage/reachability.m - PRIVATE platform/darwin/src/CFHandle.hpp - PRIVATE platform/darwin/src/collator.mm - PRIVATE platform/darwin/src/local_glyph_rasterizer.mm - PRIVATE platform/darwin/src/logging_nslog.mm - PRIVATE platform/darwin/src/nsthread.mm - PRIVATE platform/darwin/src/string_nsstring.mm - PRIVATE platform/default/bidi.cpp - PRIVATE platform/default/thread_local.cpp - PRIVATE platform/default/utf.cpp - - # Image handling - PRIVATE platform/darwin/mbgl/util/image+MGLAdditions.hpp - PRIVATE platform/darwin/src/image.mm - PRIVATE platform/default/png_writer.cpp - - # Headless view - PRIVATE platform/default/mbgl/gl/headless_frontend.cpp - PRIVATE platform/default/mbgl/gl/headless_frontend.hpp - PRIVATE platform/default/mbgl/gl/headless_backend.cpp - PRIVATE platform/default/mbgl/gl/headless_backend.hpp - - # Snapshotting - PRIVATE platform/default/mbgl/map/map_snapshotter.cpp - PRIVATE platform/default/mbgl/map/map_snapshotter.hpp - - # Thread pool - PRIVATE platform/default/mbgl/util/shared_thread_pool.cpp - PRIVATE platform/default/mbgl/util/shared_thread_pool.hpp - PRIVATE platform/default/mbgl/util/default_thread_pool.cpp - PRIVATE platform/default/mbgl/util/default_thread_pool.cpp - ) + target_sources_from_file(mbgl-core PRIVATE platform/macos/core-files.txt) if(WITH_EGL) target_sources(mbgl-core @@ -56,8 +22,8 @@ macro(mbgl_platform_core) ) target_include_directories(mbgl-core - PUBLIC platform/darwin - PUBLIC platform/default + PUBLIC platform/darwin/include + PUBLIC platform/default/include ) target_link_libraries(mbgl-core @@ -113,8 +79,8 @@ endmacro() macro(mbgl_platform_test) target_sources(mbgl-test - PRIVATE platform/default/layer_manager.cpp - PRIVATE platform/default/mbgl/test/main.cpp + PRIVATE platform/default/src/mbgl/layermanager/layer_manager.cpp + PRIVATE platform/default/src/mbgl/test/main.cpp ) target_include_directories(mbgl-test @@ -122,7 +88,7 @@ macro(mbgl_platform_test) ) set_source_files_properties( - platform/default/mbgl/test/main.cpp + platform/default/src/mbgl/test/main.cpp PROPERTIES COMPILE_FLAGS -DWORK_DIRECTORY="${CMAKE_SOURCE_DIR}" ) @@ -135,7 +101,7 @@ endmacro() macro(mbgl_platform_benchmark) target_sources(mbgl-benchmark - PRIVATE platform/default/layer_manager.cpp + PRIVATE platform/default/src/mbgl/layermanager/layer_manager.cpp PRIVATE benchmark/src/main.cpp ) @@ -153,7 +119,7 @@ endmacro() macro(mbgl_platform_node) target_sources(mbgl-core - PRIVATE platform/default/layer_manager.cpp + PRIVATE platform/default/src/mbgl/layermanager/layer_manager.cpp ) target_link_libraries(mbgl-node INTERFACE -exported_symbols_list ${CMAKE_SOURCE_DIR}/platform/node/symbol-list diff --git a/platform/macos/core-files.txt b/platform/macos/core-files.txt index 1c85deccef..c99e735af8 100644 --- a/platform/macos/core-files.txt +++ b/platform/macos/core-files.txt @@ -1,221 +1,33 @@ -# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js - -# SDK -platform/macos/src/Mapbox.h - -# SDK/Foundation -platform/darwin/src/MGLAccountManager.h -platform/darwin/src/MGLAccountManager.m -platform/darwin/src/MGLAccountManager_Private.h -platform/darwin/src/MGLAttributionInfo.h -platform/darwin/src/MGLAttributionInfo.mm -platform/darwin/src/MGLAttributionInfo_Private.h -platform/darwin/src/MGLFoundation.h -platform/darwin/src/MGLFoundation.mm -platform/darwin/src/MGLFoundation_Private.h -platform/darwin/src/MGLLoggingConfiguration.h -platform/darwin/src/MGLLoggingConfiguration.m -platform/darwin/src/MGLLoggingConfiguration_Private.h -platform/darwin/src/MGLMapCamera.h -platform/darwin/src/MGLMapCamera.mm -platform/darwin/src/MGLMapSnapshotter.h -platform/darwin/src/MGLMapSnapshotter.mm -platform/darwin/src/MGLNetworkConfiguration.h -platform/darwin/src/MGLNetworkConfiguration.m -platform/darwin/src/MGLRendererConfiguration.h -platform/darwin/src/MGLRendererConfiguration.mm -platform/darwin/src/MGLRendererFrontend.h -platform/darwin/src/MGLStyle.h -platform/darwin/src/MGLStyle.mm -platform/darwin/src/MGLStyle_Private.h -platform/darwin/src/MGLTypes.h -platform/darwin/src/MGLTypes.m -platform/darwin/src/MGLValueEvaluator.h - -# SDK/Foundation/Categories -platform/darwin/src/NSArray+MGLAdditions.h -platform/darwin/src/NSArray+MGLAdditions.mm -platform/darwin/src/NSBundle+MGLAdditions.h -platform/darwin/src/NSBundle+MGLAdditions.m -platform/darwin/src/NSCoder+MGLAdditions.h -platform/darwin/src/NSCoder+MGLAdditions.mm -platform/darwin/src/NSComparisonPredicate+MGLAdditions.h -platform/darwin/src/NSComparisonPredicate+MGLAdditions.mm -platform/darwin/src/NSCompoundPredicate+MGLAdditions.h -platform/darwin/src/NSCompoundPredicate+MGLAdditions.mm -platform/darwin/src/NSDate+MGLAdditions.h -platform/darwin/src/NSDate+MGLAdditions.mm -platform/darwin/src/NSDictionary+MGLAdditions.h -platform/darwin/src/NSDictionary+MGLAdditions.mm -platform/darwin/src/NSException+MGLAdditions.h -platform/darwin/src/NSExpression+MGLAdditions.h -platform/darwin/src/NSExpression+MGLAdditions.mm -platform/darwin/src/NSExpression+MGLPrivateAdditions.h -platform/darwin/src/NSPredicate+MGLAdditions.h -platform/darwin/src/NSPredicate+MGLAdditions.mm -platform/darwin/src/NSPredicate+MGLPrivateAdditions.h -platform/darwin/src/NSProcessInfo+MGLAdditions.h -platform/darwin/src/NSProcessInfo+MGLAdditions.m -platform/darwin/src/NSString+MGLAdditions.h -platform/darwin/src/NSString+MGLAdditions.m -platform/darwin/src/NSURL+MGLAdditions.h -platform/darwin/src/NSURL+MGLAdditions.m -platform/darwin/src/NSValue+MGLAdditions.h -platform/darwin/src/NSValue+MGLAdditions.m - -# SDK/Foundation/Formatters -platform/darwin/src/MGLClockDirectionFormatter.h -platform/darwin/src/MGLClockDirectionFormatter.m -platform/darwin/src/MGLCompassDirectionFormatter.h -platform/darwin/src/MGLCompassDirectionFormatter.m -platform/darwin/src/MGLCoordinateFormatter.h -platform/darwin/src/MGLCoordinateFormatter.m -platform/darwin/src/MGLDistanceFormatter.h -platform/darwin/src/MGLDistanceFormatter.m - -# SDK/Foundation/Geometry -platform/darwin/src/MGLAnnotation.h -platform/darwin/src/MGLFeature.h -platform/darwin/src/MGLFeature.mm -platform/darwin/src/MGLFeature_Private.h -platform/darwin/src/MGLGeometry.h -platform/darwin/src/MGLGeometry.mm -platform/darwin/src/MGLGeometry_Private.h -platform/darwin/src/MGLMultiPoint.h -platform/darwin/src/MGLMultiPoint.mm -platform/darwin/src/MGLMultiPoint_Private.h -platform/darwin/src/MGLOverlay.h -platform/darwin/src/MGLPointAnnotation.h -platform/darwin/src/MGLPointAnnotation.mm -platform/darwin/src/MGLPointCollection.h -platform/darwin/src/MGLPointCollection.mm -platform/darwin/src/MGLPointCollection_Private.h -platform/darwin/src/MGLPolygon.h -platform/darwin/src/MGLPolygon.mm -platform/darwin/src/MGLPolygon_Private.h -platform/darwin/src/MGLPolyline.h -platform/darwin/src/MGLPolyline.mm -platform/darwin/src/MGLPolyline_Private.h -platform/darwin/src/MGLShape.h -platform/darwin/src/MGLShape.mm -platform/darwin/src/MGLShapeCollection.h -platform/darwin/src/MGLShapeCollection.mm -platform/darwin/src/MGLShape_Private.h - -# SDK/Foundation/Offline Maps -platform/darwin/src/MGLOfflinePack.h -platform/darwin/src/MGLOfflinePack.mm -platform/darwin/src/MGLOfflinePack_Private.h -platform/darwin/src/MGLOfflineRegion.h -platform/darwin/src/MGLOfflineRegion_Private.h -platform/darwin/src/MGLOfflineStorage.h -platform/darwin/src/MGLOfflineStorage.mm -platform/darwin/src/MGLOfflineStorage_Private.h -platform/darwin/src/MGLShapeOfflineRegion.h -platform/darwin/src/MGLShapeOfflineRegion.mm -platform/darwin/src/MGLShapeOfflineRegion_Private.h -platform/darwin/src/MGLTilePyramidOfflineRegion.h -platform/darwin/src/MGLTilePyramidOfflineRegion.mm -platform/darwin/src/MGLTilePyramidOfflineRegion_Private.h - -# SDK/Foundation/Styling -platform/darwin/src/MGLConversion.h -platform/darwin/src/MGLLight.h -platform/darwin/src/MGLLight.mm -platform/darwin/src/MGLLight_Private.h -platform/darwin/src/MGLStyleValue.h -platform/darwin/src/MGLStyleValue.mm -platform/darwin/src/MGLStyleValue_Private.h - -# SDK/Foundation/Styling/Categories -platform/darwin/src/NSValue+MGLStyleAttributeAdditions.h -platform/darwin/src/NSValue+MGLStyleAttributeAdditions.mm - -# SDK/Foundation/Styling/Layers -platform/darwin/src/MGLBackgroundStyleLayer.h -platform/darwin/src/MGLBackgroundStyleLayer.mm -platform/darwin/src/MGLBackgroundStyleLayer_Private.h -platform/darwin/src/MGLCircleStyleLayer.h -platform/darwin/src/MGLCircleStyleLayer.mm -platform/darwin/src/MGLCircleStyleLayer_Private.h -platform/darwin/src/MGLFillExtrusionStyleLayer.h -platform/darwin/src/MGLFillExtrusionStyleLayer.mm -platform/darwin/src/MGLFillExtrusionStyleLayer_Private.h -platform/darwin/src/MGLFillStyleLayer.h -platform/darwin/src/MGLFillStyleLayer.mm -platform/darwin/src/MGLFillStyleLayer_Private.h -platform/darwin/src/MGLForegroundStyleLayer.h -platform/darwin/src/MGLForegroundStyleLayer.mm -platform/darwin/src/MGLHeatmapStyleLayer.h -platform/darwin/src/MGLHeatmapStyleLayer.mm -platform/darwin/src/MGLHeatmapStyleLayer_Private.h -platform/darwin/src/MGLHillshadeStyleLayer.h -platform/darwin/src/MGLHillshadeStyleLayer.mm -platform/darwin/src/MGLHillshadeStyleLayer_Private.h -platform/darwin/src/MGLLineStyleLayer.h -platform/darwin/src/MGLLineStyleLayer.mm -platform/darwin/src/MGLLineStyleLayer_Private.h -platform/darwin/src/MGLOpenGLStyleLayer.h -platform/darwin/src/MGLOpenGLStyleLayer.mm -platform/darwin/src/MGLOpenGLStyleLayer_Private.h -platform/darwin/src/MGLRasterStyleLayer.h -platform/darwin/src/MGLRasterStyleLayer.mm -platform/darwin/src/MGLRasterStyleLayer_Private.h -platform/darwin/src/MGLStyleLayer.h -platform/darwin/src/MGLStyleLayer.mm -platform/darwin/src/MGLStyleLayerManager.h -platform/darwin/src/MGLStyleLayerManager.mm -platform/darwin/src/MGLStyleLayer_Private.h -platform/darwin/src/MGLSymbolStyleLayer.h -platform/darwin/src/MGLSymbolStyleLayer.mm -platform/darwin/src/MGLSymbolStyleLayer_Private.h -platform/darwin/src/MGLVectorStyleLayer.h -platform/darwin/src/MGLVectorStyleLayer.m - -# SDK/Foundation/Styling/Sources -platform/darwin/src/MGLComputedShapeSource.h -platform/darwin/src/MGLComputedShapeSource.mm -platform/darwin/src/MGLComputedShapeSource_Private.h -platform/darwin/src/MGLImageSource.h -platform/darwin/src/MGLImageSource.mm -platform/darwin/src/MGLRasterDEMSource.h -platform/darwin/src/MGLRasterDEMSource.mm -platform/darwin/src/MGLRasterTileSource.h -platform/darwin/src/MGLRasterTileSource.mm -platform/darwin/src/MGLRasterTileSource_Private.h -platform/darwin/src/MGLShapeSource.h -platform/darwin/src/MGLShapeSource.mm -platform/darwin/src/MGLShapeSource_Private.h -platform/darwin/src/MGLSource.h -platform/darwin/src/MGLSource.mm -platform/darwin/src/MGLSource_Private.h -platform/darwin/src/MGLTileSource.h -platform/darwin/src/MGLTileSource.mm -platform/darwin/src/MGLTileSource_Private.h -platform/darwin/src/MGLVectorTileSource.h -platform/darwin/src/MGLVectorTileSource.mm -platform/darwin/src/MGLVectorTileSource_Private.h - -# SDK/Kit -platform/macos/src/MGLAnnotationImage.h -platform/macos/src/MGLAnnotationImage.m -platform/macos/src/MGLAnnotationImage_Private.h -platform/macos/src/MGLAttributionButton.h -platform/macos/src/MGLAttributionButton.mm -platform/macos/src/MGLCompassCell.h -platform/macos/src/MGLCompassCell.m -platform/macos/src/MGLMapView+IBAdditions.h -platform/macos/src/MGLMapView+IBAdditions.mm -platform/macos/src/MGLMapView.h -platform/macos/src/MGLMapView.mm -platform/macos/src/MGLMapViewDelegate.h -platform/macos/src/MGLMapView_Private.h -platform/macos/src/MGLOpenGLLayer.h -platform/macos/src/MGLOpenGLLayer.mm - -# SDK/Kit/Categories -platform/macos/src/NSColor+MGLAdditions.h -platform/macos/src/NSColor+MGLAdditions.mm -platform/macos/src/NSImage+MGLAdditions.h -platform/macos/src/NSImage+MGLAdditions.mm - +# Misc +platform/darwin/include/mbgl/storage/reachability.h +platform/darwin/src/reachability.m +platform/darwin/src/CFHandle.hpp +platform/darwin/src/collator.mm +platform/darwin/src/local_glyph_rasterizer.mm +platform/darwin/src/logging_nslog.mm +platform/darwin/src/nsthread.mm +platform/darwin/src/string_nsstring.mm +platform/default/src/mbgl/text/bidi.cpp +platform/default/src/mbgl/util/thread_local.cpp +platform/default/src/mbgl/util/utf.cpp + +# Image handling +platform/darwin/include/mbgl/util/image+MGLAdditions.hpp +platform/darwin/src/image.mm +platform/default/src/mbgl/util/png_writer.cpp + +# Headless view +platform/default/src/mbgl/gl/headless_frontend.cpp +platform/default/include/mbgl/gl/headless_frontend.hpp +platform/default/src/mbgl/gl/headless_backend.cpp +platform/default/include/mbgl/gl/headless_backend.hpp + +# Snapshotting +platform/default/src/mbgl/map/map_snapshotter.cpp +platform/default/include/mbgl/map/map_snapshotter.hpp + +# Thread pool +platform/default/src/mbgl/util/shared_thread_pool.cpp +platform/default/include/mbgl/util/shared_thread_pool.hpp +platform/default/src/mbgl/util/default_thread_pool.cpp +platform/default/include/mbgl/util/default_thread_pool.hpp diff --git a/platform/macos/sdk-files.txt b/platform/macos/sdk-files.txt new file mode 100644 index 0000000000..baae924236 --- /dev/null +++ b/platform/macos/sdk-files.txt @@ -0,0 +1,220 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# SDK +platform/macos/src/Mapbox.h + +# SDK/Foundation +platform/darwin/src/MGLAccountManager.h +platform/darwin/src/MGLAccountManager.m +platform/darwin/src/MGLAccountManager_Private.h +platform/darwin/src/MGLAttributionInfo.h +platform/darwin/src/MGLAttributionInfo.mm +platform/darwin/src/MGLAttributionInfo_Private.h +platform/darwin/src/MGLFoundation.h +platform/darwin/src/MGLFoundation.mm +platform/darwin/src/MGLFoundation_Private.h +platform/darwin/src/MGLLoggingConfiguration.h +platform/darwin/src/MGLLoggingConfiguration.m +platform/darwin/src/MGLLoggingConfiguration_Private.h +platform/darwin/src/MGLMapCamera.h +platform/darwin/src/MGLMapCamera.mm +platform/darwin/src/MGLMapSnapshotter.h +platform/darwin/src/MGLMapSnapshotter.mm +platform/darwin/src/MGLNetworkConfiguration.h +platform/darwin/src/MGLNetworkConfiguration.m +platform/darwin/src/MGLRendererConfiguration.h +platform/darwin/src/MGLRendererConfiguration.mm +platform/darwin/src/MGLRendererFrontend.h +platform/darwin/src/MGLStyle.h +platform/darwin/src/MGLStyle.mm +platform/darwin/src/MGLStyle_Private.h +platform/darwin/src/MGLTypes.h +platform/darwin/src/MGLTypes.m +platform/darwin/src/MGLValueEvaluator.h + +# SDK/Foundation/Categories +platform/darwin/src/NSArray+MGLAdditions.h +platform/darwin/src/NSArray+MGLAdditions.mm +platform/darwin/src/NSBundle+MGLAdditions.h +platform/darwin/src/NSBundle+MGLAdditions.m +platform/darwin/src/NSCoder+MGLAdditions.h +platform/darwin/src/NSCoder+MGLAdditions.mm +platform/darwin/src/NSComparisonPredicate+MGLAdditions.h +platform/darwin/src/NSComparisonPredicate+MGLAdditions.mm +platform/darwin/src/NSCompoundPredicate+MGLAdditions.h +platform/darwin/src/NSCompoundPredicate+MGLAdditions.mm +platform/darwin/src/NSDate+MGLAdditions.h +platform/darwin/src/NSDate+MGLAdditions.mm +platform/darwin/src/NSDictionary+MGLAdditions.h +platform/darwin/src/NSDictionary+MGLAdditions.mm +platform/darwin/src/NSException+MGLAdditions.h +platform/darwin/src/NSExpression+MGLAdditions.h +platform/darwin/src/NSExpression+MGLAdditions.mm +platform/darwin/src/NSExpression+MGLPrivateAdditions.h +platform/darwin/src/NSPredicate+MGLAdditions.h +platform/darwin/src/NSPredicate+MGLAdditions.mm +platform/darwin/src/NSPredicate+MGLPrivateAdditions.h +platform/darwin/src/NSProcessInfo+MGLAdditions.h +platform/darwin/src/NSProcessInfo+MGLAdditions.m +platform/darwin/src/NSString+MGLAdditions.h +platform/darwin/src/NSString+MGLAdditions.m +platform/darwin/src/NSURL+MGLAdditions.h +platform/darwin/src/NSURL+MGLAdditions.m +platform/darwin/src/NSValue+MGLAdditions.h +platform/darwin/src/NSValue+MGLAdditions.m + +# SDK/Foundation/Formatters +platform/darwin/src/MGLClockDirectionFormatter.h +platform/darwin/src/MGLClockDirectionFormatter.m +platform/darwin/src/MGLCompassDirectionFormatter.h +platform/darwin/src/MGLCompassDirectionFormatter.m +platform/darwin/src/MGLCoordinateFormatter.h +platform/darwin/src/MGLCoordinateFormatter.m +platform/darwin/src/MGLDistanceFormatter.h +platform/darwin/src/MGLDistanceFormatter.m + +# SDK/Foundation/Geometry +platform/darwin/src/MGLAnnotation.h +platform/darwin/src/MGLFeature.h +platform/darwin/src/MGLFeature.mm +platform/darwin/src/MGLFeature_Private.h +platform/darwin/src/MGLGeometry.h +platform/darwin/src/MGLGeometry.mm +platform/darwin/src/MGLGeometry_Private.h +platform/darwin/src/MGLMultiPoint.h +platform/darwin/src/MGLMultiPoint.mm +platform/darwin/src/MGLMultiPoint_Private.h +platform/darwin/src/MGLOverlay.h +platform/darwin/src/MGLPointAnnotation.h +platform/darwin/src/MGLPointAnnotation.mm +platform/darwin/src/MGLPointCollection.h +platform/darwin/src/MGLPointCollection.mm +platform/darwin/src/MGLPointCollection_Private.h +platform/darwin/src/MGLPolygon.h +platform/darwin/src/MGLPolygon.mm +platform/darwin/src/MGLPolygon_Private.h +platform/darwin/src/MGLPolyline.h +platform/darwin/src/MGLPolyline.mm +platform/darwin/src/MGLPolyline_Private.h +platform/darwin/src/MGLShape.h +platform/darwin/src/MGLShape.mm +platform/darwin/src/MGLShapeCollection.h +platform/darwin/src/MGLShapeCollection.mm +platform/darwin/src/MGLShape_Private.h + +# SDK/Foundation/Offline Maps +platform/darwin/src/MGLOfflinePack.h +platform/darwin/src/MGLOfflinePack.mm +platform/darwin/src/MGLOfflinePack_Private.h +platform/darwin/src/MGLOfflineRegion.h +platform/darwin/src/MGLOfflineRegion_Private.h +platform/darwin/src/MGLOfflineStorage.h +platform/darwin/src/MGLOfflineStorage.mm +platform/darwin/src/MGLOfflineStorage_Private.h +platform/darwin/src/MGLShapeOfflineRegion.h +platform/darwin/src/MGLShapeOfflineRegion.mm +platform/darwin/src/MGLShapeOfflineRegion_Private.h +platform/darwin/src/MGLTilePyramidOfflineRegion.h +platform/darwin/src/MGLTilePyramidOfflineRegion.mm +platform/darwin/src/MGLTilePyramidOfflineRegion_Private.h + +# SDK/Foundation/Styling +platform/darwin/src/MGLConversion.h +platform/darwin/src/MGLLight.h +platform/darwin/src/MGLLight.mm +platform/darwin/src/MGLLight_Private.h +platform/darwin/src/MGLStyleValue.h +platform/darwin/src/MGLStyleValue.mm +platform/darwin/src/MGLStyleValue_Private.h + +# SDK/Foundation/Styling/Categories +platform/darwin/src/NSValue+MGLStyleAttributeAdditions.h +platform/darwin/src/NSValue+MGLStyleAttributeAdditions.mm + +# SDK/Foundation/Styling/Layers +platform/darwin/src/MGLBackgroundStyleLayer.h +platform/darwin/src/MGLBackgroundStyleLayer.mm +platform/darwin/src/MGLBackgroundStyleLayer_Private.h +platform/darwin/src/MGLCircleStyleLayer.h +platform/darwin/src/MGLCircleStyleLayer.mm +platform/darwin/src/MGLCircleStyleLayer_Private.h +platform/darwin/src/MGLFillExtrusionStyleLayer.h +platform/darwin/src/MGLFillExtrusionStyleLayer.mm +platform/darwin/src/MGLFillExtrusionStyleLayer_Private.h +platform/darwin/src/MGLFillStyleLayer.h +platform/darwin/src/MGLFillStyleLayer.mm +platform/darwin/src/MGLFillStyleLayer_Private.h +platform/darwin/src/MGLForegroundStyleLayer.h +platform/darwin/src/MGLForegroundStyleLayer.mm +platform/darwin/src/MGLHeatmapStyleLayer.h +platform/darwin/src/MGLHeatmapStyleLayer.mm +platform/darwin/src/MGLHeatmapStyleLayer_Private.h +platform/darwin/src/MGLHillshadeStyleLayer.h +platform/darwin/src/MGLHillshadeStyleLayer.mm +platform/darwin/src/MGLHillshadeStyleLayer_Private.h +platform/darwin/src/MGLLineStyleLayer.h +platform/darwin/src/MGLLineStyleLayer.mm +platform/darwin/src/MGLLineStyleLayer_Private.h +platform/darwin/src/MGLOpenGLStyleLayer.h +platform/darwin/src/MGLOpenGLStyleLayer.mm +platform/darwin/src/MGLOpenGLStyleLayer_Private.h +platform/darwin/src/MGLRasterStyleLayer.h +platform/darwin/src/MGLRasterStyleLayer.mm +platform/darwin/src/MGLRasterStyleLayer_Private.h +platform/darwin/src/MGLStyleLayer.h +platform/darwin/src/MGLStyleLayer.mm +platform/darwin/src/MGLStyleLayerManager.h +platform/darwin/src/MGLStyleLayerManager.mm +platform/darwin/src/MGLStyleLayer_Private.h +platform/darwin/src/MGLSymbolStyleLayer.h +platform/darwin/src/MGLSymbolStyleLayer.mm +platform/darwin/src/MGLSymbolStyleLayer_Private.h +platform/darwin/src/MGLVectorStyleLayer.h +platform/darwin/src/MGLVectorStyleLayer.m + +# SDK/Foundation/Styling/Sources +platform/darwin/src/MGLComputedShapeSource.h +platform/darwin/src/MGLComputedShapeSource.mm +platform/darwin/src/MGLComputedShapeSource_Private.h +platform/darwin/src/MGLImageSource.h +platform/darwin/src/MGLImageSource.mm +platform/darwin/src/MGLRasterDEMSource.h +platform/darwin/src/MGLRasterDEMSource.mm +platform/darwin/src/MGLRasterTileSource.h +platform/darwin/src/MGLRasterTileSource.mm +platform/darwin/src/MGLRasterTileSource_Private.h +platform/darwin/src/MGLShapeSource.h +platform/darwin/src/MGLShapeSource.mm +platform/darwin/src/MGLShapeSource_Private.h +platform/darwin/src/MGLSource.h +platform/darwin/src/MGLSource.mm +platform/darwin/src/MGLSource_Private.h +platform/darwin/src/MGLTileSource.h +platform/darwin/src/MGLTileSource.mm +platform/darwin/src/MGLTileSource_Private.h +platform/darwin/src/MGLVectorTileSource.h +platform/darwin/src/MGLVectorTileSource.mm +platform/darwin/src/MGLVectorTileSource_Private.h + +# SDK/Kit +platform/macos/src/MGLAnnotationImage.h +platform/macos/src/MGLAnnotationImage.m +platform/macos/src/MGLAnnotationImage_Private.h +platform/macos/src/MGLAttributionButton.h +platform/macos/src/MGLAttributionButton.mm +platform/macos/src/MGLCompassCell.h +platform/macos/src/MGLCompassCell.m +platform/macos/src/MGLMapView+IBAdditions.h +platform/macos/src/MGLMapView+IBAdditions.mm +platform/macos/src/MGLMapView.h +platform/macos/src/MGLMapView.mm +platform/macos/src/MGLMapViewDelegate.h +platform/macos/src/MGLMapView_Private.h +platform/macos/src/MGLOpenGLLayer.h +platform/macos/src/MGLOpenGLLayer.mm + +# SDK/Kit/Categories +platform/macos/src/NSColor+MGLAdditions.h +platform/macos/src/NSColor+MGLAdditions.mm +platform/macos/src/NSImage+MGLAdditions.h +platform/macos/src/NSImage+MGLAdditions.mm diff --git a/platform/qt/config.cmake b/platform/qt/config.cmake index a2c6b0a9e9..68b32b9eb9 100644 --- a/platform/qt/config.cmake +++ b/platform/qt/config.cmake @@ -6,7 +6,7 @@ macro(mbgl_platform_core) ) target_include_directories(mbgl-core - PUBLIC platform/default + PUBLIC platform/default/include PRIVATE platform/qt PRIVATE platform/qt/include ) @@ -18,8 +18,8 @@ macro(mbgl_platform_core) if(NOT WITH_QT_DECODERS) target_sources(mbgl-core - PRIVATE platform/default/jpeg_reader.cpp - PRIVATE platform/default/png_reader.cpp + PRIVATE platform/default/src/mbgl/util/jpeg_reader.cpp + PRIVATE platform/default/src/mbgl/util/png_reader.cpp ) target_add_mason_package(mbgl-core PRIVATE libjpeg-turbo) @@ -29,7 +29,7 @@ macro(mbgl_platform_core) endif() if(NOT WITH_QT_I18N) - target_sources(mbgl-core PRIVATE platform/default/bidi.cpp) + target_sources(mbgl-core PRIVATE platform/default/src/mbgl/text/bidi.cpp) target_link_libraries(mbgl-core PRIVATE icu) else() target_sources(mbgl-core PRIVATE platform/qt/src/bidi.cpp) diff --git a/platform/qt/qt.cmake b/platform/qt/qt.cmake index 2e334563ed..a7b48ac4b1 100644 --- a/platform/qt/qt.cmake +++ b/platform/qt/qt.cmake @@ -11,17 +11,17 @@ set(CMAKE_AUTORCC ON) set(MBGL_QT_CORE_FILES # Headless view - PRIVATE platform/default/mbgl/gl/headless_frontend.cpp - PRIVATE platform/default/mbgl/gl/headless_frontend.hpp - PRIVATE platform/default/mbgl/gl/headless_backend.cpp - PRIVATE platform/default/mbgl/gl/headless_backend.hpp + PRIVATE platform/default/src/mbgl/gl/headless_frontend.cpp + PRIVATE platform/default/include/mbgl/gl/headless_frontend.hpp + PRIVATE platform/default/src/mbgl/gl/headless_backend.cpp + PRIVATE platform/default/include/mbgl/gl/headless_backend.hpp PRIVATE platform/qt/src/headless_backend_qt.cpp # Thread pool - PRIVATE platform/default/mbgl/util/shared_thread_pool.cpp - PRIVATE platform/default/mbgl/util/shared_thread_pool.hpp - PRIVATE platform/default/mbgl/util/default_thread_pool.cpp - PRIVATE platform/default/mbgl/util/default_thread_pool.hpp + PRIVATE platform/default/src/mbgl/util/shared_thread_pool.cpp + PRIVATE platform/default/include/mbgl/util/shared_thread_pool.hpp + PRIVATE platform/default/src/mbgl/util/default_thread_pool.cpp + PRIVATE platform/default/include/mbgl/util/default_thread_pool.hpp # Thread PRIVATE platform/qt/src/thread_local.cpp @@ -38,13 +38,13 @@ set(MBGL_QT_CORE_FILES PRIVATE platform/qt/src/timer_impl.hpp PRIVATE platform/qt/src/utf.cpp - PRIVATE platform/default/local_glyph_rasterizer.cpp - PRIVATE platform/default/collator.cpp - PRIVATE platform/default/unaccent.cpp - PRIVATE platform/default/unaccent.hpp + PRIVATE platform/default/src/mbgl/text/local_glyph_rasterizer.cpp + PRIVATE platform/default/src/mbgl/text/collator.cpp + PRIVATE platform/default/src/mbgl/text/unaccent.cpp + PRIVATE platform/default/include/mbgl/text/unaccent.hpp #Layer manager - PRIVATE platform/default/layer_manager.cpp + PRIVATE platform/default/src/mbgl/layermanager/layer_manager.cpp ) set(MBGL_QT_FILESOURCE_FILES @@ -76,7 +76,7 @@ add_library(qmapboxgl SHARED platform/qt/src/qmapboxgl_renderer_backend.hpp platform/qt/src/qmapboxgl_scheduler.cpp platform/qt/src/qmapboxgl_scheduler.hpp - platform/default/mbgl/util/default_styles.hpp + platform/default/include/mbgl/util/default_styles.hpp ) target_include_directories(qmapboxgl @@ -150,7 +150,7 @@ if (MASON_PLATFORM STREQUAL "osx" OR MASON_PLATFORM STREQUAL "ios") ) elseif (CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") list(APPEND MBGL_QT_CORE_FILES - PRIVATE platform/default/thread.cpp + PRIVATE platform/default/src/mbgl/util/thread.cpp ) elseif (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") add_definitions("-DQT_COMPILING_QIMAGE_COMPAT_CPP") diff --git a/platform/qt/src/sqlite3.cpp b/platform/qt/src/sqlite3.cpp index 6427126875..75befc37c8 100644 --- a/platform/qt/src/sqlite3.cpp +++ b/platform/qt/src/sqlite3.cpp @@ -1,4 +1,4 @@ -#include "sqlite3.hpp" +#include #include #include diff --git a/scripts/generate-cmake-files.js b/scripts/generate-cmake-files.js index 9413ff19b6..c252344c64 100755 --- a/scripts/generate-cmake-files.js +++ b/scripts/generate-cmake-files.js @@ -10,19 +10,19 @@ require('./style-code'); const fileListTxt = ejs.compile(fs.readFileSync('cmake/files.txt.ejs', 'utf8'), {strict: true}); -function generateFileList(name, regex, patterns) { - const files = child_process.execSync(`git ls-files ${patterns.map((p) => '"' + p + '"').join(' ')}`).toString().trim().split('\n'); +function generateFileList(filename, root, regex, patterns) { + const files = child_process.execSync(`git -C ${root} ls-files ${patterns.map((p) => '"' + p + '"').join(' ')}`).toString().trim().split('\n'); var groups = {}; for (const file of files) { const match = file.match(regex); - const group = match[1] || name; + const group = match[1] || path.basename(filename, '-files.txt') if (!groups[group]) { groups[group] = []; } groups[group].push(file); } - writeIfModified(`cmake/${name}-files.txt`, fileListTxt({ groups: groups })); + writeIfModified(filename, fileListTxt({ groups: groups })); } function generateXcodeSourceList(project, target, name) { @@ -87,15 +87,39 @@ function generateXcodeSourceList(project, target, name) { writeIfModified(`${projectPath}/${name || target}-files.txt`, fileListTxt({ groups: groups })); } -generateFileList('core', /^(?:src|include)\/(?:mbgl\/)?(.+)\/[^\/]+$/, +generateFileList('cmake/core-files.txt', '.', /^(?:src|include)\/(?:mbgl\/)?(.+)\/[^\/]+$/, [ 'include/*.hpp', 'include/*.h', 'src/*.hpp', 'src/*.cpp', 'src/*.h', 'src/*.c' ]); -generateFileList('benchmark', /^benchmark\/(?:(?:src|include)\/)?(?:mbgl\/)?(?:(.+)\/)?[^\/]+$/, +generateFileList('cmake/benchmark-files.txt', '.', /^benchmark\/(?:(?:src|include)\/)?(?:mbgl\/)?(?:(.+)\/)?[^\/]+$/, [ 'benchmark/*.hpp', 'benchmark/*.cpp', 'benchmark/*.h', 'benchmark/*.c' ]); -generateFileList('test', /^test\/(?:(?:src|include)\/)?(?:mbgl\/)?(?:(.+)\/)?[^\/]+$/, +generateFileList('cmake/test-files.txt', '.', /^test\/(?:(?:src|include)\/)?(?:mbgl\/)?(?:(.+)\/)?[^\/]+$/, [ 'test/*.hpp', 'test/*.cpp', 'test/*.h', 'test/*.c' ]); -generateXcodeSourceList('platform/macos/macos.xcodeproj', 'dynamic', 'core'); - -generateXcodeSourceList('platform/ios/ios.xcodeproj', 'dynamic', 'core'); +generateXcodeSourceList('platform/macos/macos.xcodeproj', 'dynamic', 'sdk'); + +generateXcodeSourceList('platform/ios/ios.xcodeproj', 'dynamic', 'sdk'); + +const vendorRegex = /^(?:(?:src|include)\/)?(?:(.+)\/)?[^\/]+$/ +generateFileList('vendor/boost-files.txt', 'vendor/boost', vendorRegex, [ "include/**/*.hpp", "include/**/*.h" ]); +generateFileList('vendor/cheap-ruler-cpp-files.txt', 'vendor/cheap-ruler-cpp', vendorRegex, [ "include/**/*.hpp" ]); +generateFileList('vendor/earcut.hpp-files.txt', 'vendor/earcut.hpp', vendorRegex, [ "include/**/*.hpp" ]); +generateFileList('vendor/eternal-files.txt', 'vendor/eternal', vendorRegex, [ "include/**/*.hpp" ]); +generateFileList('vendor/expected-files.txt', 'vendor/expected', vendorRegex, [ "include/expected.hpp" ]); +generateFileList('vendor/geojson-vt-cpp-files.txt', 'vendor/geojson-vt-cpp', vendorRegex, [ "include/**/*.hpp" ]); +generateFileList('vendor/geojson.hpp-files.txt', 'vendor/geojson.hpp', vendorRegex, [ "include/**/*.hpp" ]); +generateFileList('vendor/geometry.hpp-files.txt', 'vendor/geometry.hpp', vendorRegex, [ "include/**/*.hpp" ]); +generateFileList('vendor/icu-files.txt', 'vendor/icu', vendorRegex, [ "include/**/*.h", "src/*.h", "src/*.cpp" ]); +generateFileList('vendor/jni.hpp-files.txt', 'vendor/jni.hpp', vendorRegex, [ "include/**/*.hpp", ":!:include/jni/string_conversion.hpp" ]); +generateFileList('vendor/kdbush.hpp-files.txt', 'vendor/kdbush.hpp', vendorRegex, [ "include/*.hpp" ]); +generateFileList('vendor/pixelmatch-cpp-files.txt', 'vendor/pixelmatch-cpp', vendorRegex, [ "include/**/*.hpp" ]); +generateFileList('vendor/polylabel-files.txt', 'vendor/polylabel', vendorRegex, [ "include/**/*.hpp" ]); +generateFileList('vendor/protozero-files.txt', 'vendor/protozero', vendorRegex, [ "include/**/*.hpp" ]); +generateFileList('vendor/rapidjson-files.txt', 'vendor/rapidjson', vendorRegex, [ "include/**/*.h" ]); +generateFileList('vendor/shelf-pack-cpp-files.txt', 'vendor/shelf-pack-cpp', vendorRegex, [ "include/**/*.hpp" ]); +generateFileList('vendor/sqlite-files.txt', 'vendor/sqlite', vendorRegex, [ "include/*.h", "src/*.c" ]); +generateFileList('vendor/supercluster.hpp-files.txt', 'vendor/supercluster.hpp', vendorRegex, [ "include/*.hpp" ]); +generateFileList('vendor/unique_resource-files.txt', 'vendor/unique_resource', vendorRegex, [ "unique_resource.hpp" ]); +generateFileList('vendor/variant-files.txt', 'vendor/variant', vendorRegex, [ "include/**/*.hpp" ]); +generateFileList('vendor/vector-tile-files.txt', 'vendor/vector-tile', vendorRegex, [ "include/**/*.hpp" ]); +generateFileList('vendor/wagyu-files.txt', 'vendor/wagyu', vendorRegex, [ "include/**/*.hpp" ]); diff --git a/test/storage/offline_database.test.cpp b/test/storage/offline_database.test.cpp index 41eae6f103..809771af07 100644 --- a/test/storage/offline_database.test.cpp +++ b/test/storage/offline_database.test.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include diff --git a/test/storage/offline_download.test.cpp b/test/storage/offline_download.test.cpp index 83fb7f3c18..2195585bf5 100644 --- a/test/storage/offline_download.test.cpp +++ b/test/storage/offline_download.test.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include diff --git a/test/storage/sqlite.test.cpp b/test/storage/sqlite.test.cpp index cdbb7f26d7..1e2cc5488e 100644 --- a/test/storage/sqlite.test.cpp +++ b/test/storage/sqlite.test.cpp @@ -1,7 +1,7 @@ #include #include -#include +#include using namespace mbgl; diff --git a/vendor/boost-files.txt b/vendor/boost-files.txt new file mode 100644 index 0000000000..7e8a577eca --- /dev/null +++ b/vendor/boost-files.txt @@ -0,0 +1,5259 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# boost +include/boost/aligned_storage.hpp +include/boost/any.hpp +include/boost/array.hpp +include/boost/assert.hpp +include/boost/bind.hpp +include/boost/blank.hpp +include/boost/blank_fwd.hpp +include/boost/call_traits.hpp +include/boost/cerrno.hpp +include/boost/checked_delete.hpp +include/boost/compressed_pair.hpp +include/boost/concept_check.hpp +include/boost/config.hpp +include/boost/crc.hpp +include/boost/cstdint.hpp +include/boost/current_function.hpp +include/boost/filesystem.hpp +include/boost/foreach.hpp +include/boost/foreach_fwd.hpp +include/boost/format.hpp +include/boost/function.hpp +include/boost/function_equal.hpp +include/boost/function_output_iterator.hpp +include/boost/geometry.hpp +include/boost/get_pointer.hpp +include/boost/implicit_cast.hpp +include/boost/integer.hpp +include/boost/integer_fwd.hpp +include/boost/integer_traits.hpp +include/boost/io_fwd.hpp +include/boost/is_placeholder.hpp +include/boost/iterator.hpp +include/boost/lexical_cast.hpp +include/boost/limits.hpp +include/boost/make_shared.hpp +include/boost/mem_fn.hpp +include/boost/multi_index_container.hpp +include/boost/multi_index_container_fwd.hpp +include/boost/next_prior.hpp +include/boost/non_type.hpp +include/boost/noncopyable.hpp +include/boost/none.hpp +include/boost/none_t.hpp +include/boost/operators.hpp +include/boost/optional.hpp +include/boost/parameter.hpp +include/boost/predef.h +include/boost/program_options.hpp +include/boost/python.hpp +include/boost/range.hpp +include/boost/rational.hpp +include/boost/ref.hpp +include/boost/regex.hpp +include/boost/regex_fwd.hpp +include/boost/scoped_array.hpp +include/boost/scoped_ptr.hpp +include/boost/shared_array.hpp +include/boost/shared_ptr.hpp +include/boost/static_assert.hpp +include/boost/swap.hpp +include/boost/throw_exception.hpp +include/boost/token_functions.hpp +include/boost/token_iterator.hpp +include/boost/tokenizer.hpp +include/boost/type.hpp +include/boost/type_index.hpp +include/boost/utility.hpp +include/boost/variant.hpp +include/boost/version.hpp +include/boost/visit_each.hpp + +# boost/algorithm +include/boost/algorithm/minmax_element.hpp +include/boost/algorithm/string.hpp + +# boost/algorithm/cxx11 +include/boost/algorithm/cxx11/all_of.hpp + +# boost/algorithm/string +include/boost/algorithm/string/case_conv.hpp +include/boost/algorithm/string/classification.hpp +include/boost/algorithm/string/compare.hpp +include/boost/algorithm/string/concept.hpp +include/boost/algorithm/string/config.hpp +include/boost/algorithm/string/constants.hpp +include/boost/algorithm/string/erase.hpp +include/boost/algorithm/string/find.hpp +include/boost/algorithm/string/find_format.hpp +include/boost/algorithm/string/find_iterator.hpp +include/boost/algorithm/string/finder.hpp +include/boost/algorithm/string/formatter.hpp +include/boost/algorithm/string/iter_find.hpp +include/boost/algorithm/string/join.hpp +include/boost/algorithm/string/predicate.hpp +include/boost/algorithm/string/predicate_facade.hpp +include/boost/algorithm/string/regex.hpp +include/boost/algorithm/string/regex_find_format.hpp +include/boost/algorithm/string/replace.hpp +include/boost/algorithm/string/sequence_traits.hpp +include/boost/algorithm/string/split.hpp +include/boost/algorithm/string/std_containers_traits.hpp +include/boost/algorithm/string/trim.hpp +include/boost/algorithm/string/yes_no_type.hpp + +# boost/algorithm/string/detail +include/boost/algorithm/string/detail/case_conv.hpp +include/boost/algorithm/string/detail/classification.hpp +include/boost/algorithm/string/detail/find_format.hpp +include/boost/algorithm/string/detail/find_format_all.hpp +include/boost/algorithm/string/detail/find_format_store.hpp +include/boost/algorithm/string/detail/find_iterator.hpp +include/boost/algorithm/string/detail/finder.hpp +include/boost/algorithm/string/detail/finder_regex.hpp +include/boost/algorithm/string/detail/formatter.hpp +include/boost/algorithm/string/detail/formatter_regex.hpp +include/boost/algorithm/string/detail/predicate.hpp +include/boost/algorithm/string/detail/replace_storage.hpp +include/boost/algorithm/string/detail/sequence.hpp +include/boost/algorithm/string/detail/trim.hpp +include/boost/algorithm/string/detail/util.hpp + +# boost/algorithm/string/std +include/boost/algorithm/string/std/list_traits.hpp +include/boost/algorithm/string/std/slist_traits.hpp +include/boost/algorithm/string/std/string_traits.hpp + +# boost/archive +include/boost/archive/archive_exception.hpp + +# boost/archive/detail +include/boost/archive/detail/abi_prefix.hpp +include/boost/archive/detail/abi_suffix.hpp +include/boost/archive/detail/decl.hpp + +# boost/bind +include/boost/bind/arg.hpp +include/boost/bind/bind.hpp +include/boost/bind/bind_cc.hpp +include/boost/bind/bind_mf2_cc.hpp +include/boost/bind/bind_mf_cc.hpp +include/boost/bind/bind_template.hpp +include/boost/bind/mem_fn.hpp +include/boost/bind/mem_fn_cc.hpp +include/boost/bind/mem_fn_template.hpp +include/boost/bind/mem_fn_vw.hpp +include/boost/bind/placeholders.hpp +include/boost/bind/protect.hpp +include/boost/bind/storage.hpp + +# boost/concept +include/boost/concept/assert.hpp +include/boost/concept/requires.hpp +include/boost/concept/usage.hpp + +# boost/concept/detail +include/boost/concept/detail/backward_compatibility.hpp +include/boost/concept/detail/borland.hpp +include/boost/concept/detail/concept_def.hpp +include/boost/concept/detail/concept_undef.hpp +include/boost/concept/detail/general.hpp +include/boost/concept/detail/has_constraints.hpp +include/boost/concept/detail/msvc.hpp + +# boost/config +include/boost/config/abi_prefix.hpp +include/boost/config/abi_suffix.hpp +include/boost/config/auto_link.hpp +include/boost/config/requires_threads.hpp +include/boost/config/user.hpp +include/boost/config/warning_disable.hpp +include/boost/config/workaround.hpp + +# boost/config/abi +include/boost/config/abi/borland_prefix.hpp +include/boost/config/abi/borland_suffix.hpp +include/boost/config/abi/msvc_prefix.hpp +include/boost/config/abi/msvc_suffix.hpp + +# boost/config/compiler +include/boost/config/compiler/borland.hpp +include/boost/config/compiler/clang.hpp +include/boost/config/compiler/codegear.hpp +include/boost/config/compiler/comeau.hpp +include/boost/config/compiler/common_edg.hpp +include/boost/config/compiler/compaq_cxx.hpp +include/boost/config/compiler/cray.hpp +include/boost/config/compiler/diab.hpp +include/boost/config/compiler/digitalmars.hpp +include/boost/config/compiler/gcc.hpp +include/boost/config/compiler/gcc_xml.hpp +include/boost/config/compiler/greenhills.hpp +include/boost/config/compiler/hp_acc.hpp +include/boost/config/compiler/intel.hpp +include/boost/config/compiler/kai.hpp +include/boost/config/compiler/metrowerks.hpp +include/boost/config/compiler/mpw.hpp +include/boost/config/compiler/nvcc.hpp +include/boost/config/compiler/pathscale.hpp +include/boost/config/compiler/pgi.hpp +include/boost/config/compiler/sgi_mipspro.hpp +include/boost/config/compiler/sunpro_cc.hpp +include/boost/config/compiler/vacpp.hpp +include/boost/config/compiler/visualc.hpp +include/boost/config/compiler/xlcpp.hpp +include/boost/config/compiler/xlcpp_zos.hpp + +# boost/config/detail +include/boost/config/detail/posix_features.hpp +include/boost/config/detail/select_compiler_config.hpp +include/boost/config/detail/select_platform_config.hpp +include/boost/config/detail/select_stdlib_config.hpp +include/boost/config/detail/suffix.hpp + +# boost/config/no_tr1 +include/boost/config/no_tr1/cmath.hpp +include/boost/config/no_tr1/complex.hpp +include/boost/config/no_tr1/functional.hpp +include/boost/config/no_tr1/memory.hpp +include/boost/config/no_tr1/utility.hpp + +# boost/config/platform +include/boost/config/platform/aix.hpp +include/boost/config/platform/amigaos.hpp +include/boost/config/platform/beos.hpp +include/boost/config/platform/bsd.hpp +include/boost/config/platform/cloudabi.hpp +include/boost/config/platform/cray.hpp +include/boost/config/platform/cygwin.hpp +include/boost/config/platform/haiku.hpp +include/boost/config/platform/hpux.hpp +include/boost/config/platform/irix.hpp +include/boost/config/platform/linux.hpp +include/boost/config/platform/macos.hpp +include/boost/config/platform/qnxnto.hpp +include/boost/config/platform/solaris.hpp +include/boost/config/platform/symbian.hpp +include/boost/config/platform/vms.hpp +include/boost/config/platform/vxworks.hpp +include/boost/config/platform/win32.hpp +include/boost/config/platform/zos.hpp + +# boost/config/stdlib +include/boost/config/stdlib/dinkumware.hpp +include/boost/config/stdlib/libcomo.hpp +include/boost/config/stdlib/libcpp.hpp +include/boost/config/stdlib/libstdcpp3.hpp +include/boost/config/stdlib/modena.hpp +include/boost/config/stdlib/msl.hpp +include/boost/config/stdlib/roguewave.hpp +include/boost/config/stdlib/sgi.hpp +include/boost/config/stdlib/stlport.hpp +include/boost/config/stdlib/vacpp.hpp +include/boost/config/stdlib/xlcpp_zos.hpp + +# boost/container +include/boost/container/allocator_traits.hpp +include/boost/container/container_fwd.hpp +include/boost/container/new_allocator.hpp +include/boost/container/throw_exception.hpp +include/boost/container/vector.hpp + +# boost/container/detail +include/boost/container/detail/advanced_insert_int.hpp +include/boost/container/detail/algorithm.hpp +include/boost/container/detail/alloc_helpers.hpp +include/boost/container/detail/allocation_type.hpp +include/boost/container/detail/config_begin.hpp +include/boost/container/detail/config_end.hpp +include/boost/container/detail/construct_in_place.hpp +include/boost/container/detail/copy_move_algo.hpp +include/boost/container/detail/destroyers.hpp +include/boost/container/detail/iterator.hpp +include/boost/container/detail/iterators.hpp +include/boost/container/detail/min_max.hpp +include/boost/container/detail/mpl.hpp +include/boost/container/detail/next_capacity.hpp +include/boost/container/detail/placement_new.hpp +include/boost/container/detail/std_fwd.hpp +include/boost/container/detail/type_traits.hpp +include/boost/container/detail/value_init.hpp +include/boost/container/detail/variadic_templates_tools.hpp +include/boost/container/detail/version_type.hpp +include/boost/container/detail/workaround.hpp + +# boost/core +include/boost/core/addressof.hpp +include/boost/core/checked_delete.hpp +include/boost/core/demangle.hpp +include/boost/core/enable_if.hpp +include/boost/core/explicit_operator_bool.hpp +include/boost/core/ignore_unused.hpp +include/boost/core/is_same.hpp +include/boost/core/no_exceptions_support.hpp +include/boost/core/noncopyable.hpp +include/boost/core/pointer_traits.hpp +include/boost/core/ref.hpp +include/boost/core/scoped_enum.hpp +include/boost/core/swap.hpp +include/boost/core/typeinfo.hpp + +# boost/date_time +include/boost/date_time/adjust_functors.hpp +include/boost/date_time/c_time.hpp +include/boost/date_time/compiler_config.hpp +include/boost/date_time/constrained_value.hpp +include/boost/date_time/date.hpp +include/boost/date_time/date_clock_device.hpp +include/boost/date_time/date_defs.hpp +include/boost/date_time/date_duration.hpp +include/boost/date_time/date_duration_types.hpp +include/boost/date_time/date_facet.hpp +include/boost/date_time/date_format_simple.hpp +include/boost/date_time/date_formatting.hpp +include/boost/date_time/date_formatting_limited.hpp +include/boost/date_time/date_formatting_locales.hpp +include/boost/date_time/date_generator_formatter.hpp +include/boost/date_time/date_generator_parser.hpp +include/boost/date_time/date_generators.hpp +include/boost/date_time/date_iterator.hpp +include/boost/date_time/date_names_put.hpp +include/boost/date_time/date_parsing.hpp +include/boost/date_time/dst_rules.hpp +include/boost/date_time/dst_transition_generators.hpp +include/boost/date_time/filetime_functions.hpp +include/boost/date_time/format_date_parser.hpp +include/boost/date_time/gregorian_calendar.hpp +include/boost/date_time/int_adapter.hpp +include/boost/date_time/iso_format.hpp +include/boost/date_time/locale_config.hpp +include/boost/date_time/microsec_time_clock.hpp +include/boost/date_time/parse_format_base.hpp +include/boost/date_time/period.hpp +include/boost/date_time/period_formatter.hpp +include/boost/date_time/period_parser.hpp +include/boost/date_time/special_defs.hpp +include/boost/date_time/special_values_formatter.hpp +include/boost/date_time/special_values_parser.hpp +include/boost/date_time/string_convert.hpp +include/boost/date_time/string_parse_tree.hpp +include/boost/date_time/strings_from_facet.hpp +include/boost/date_time/time.hpp +include/boost/date_time/time_clock.hpp +include/boost/date_time/time_defs.hpp +include/boost/date_time/time_duration.hpp +include/boost/date_time/time_facet.hpp +include/boost/date_time/time_formatting_streams.hpp +include/boost/date_time/time_iterator.hpp +include/boost/date_time/time_parsing.hpp +include/boost/date_time/time_resolution_traits.hpp +include/boost/date_time/time_system_counted.hpp +include/boost/date_time/time_system_split.hpp +include/boost/date_time/time_zone_base.hpp +include/boost/date_time/time_zone_names.hpp +include/boost/date_time/tz_db_base.hpp +include/boost/date_time/wrapping_int.hpp +include/boost/date_time/year_month_day.hpp + +# boost/date_time/gregorian +include/boost/date_time/gregorian/conversion.hpp +include/boost/date_time/gregorian/formatters.hpp +include/boost/date_time/gregorian/formatters_limited.hpp +include/boost/date_time/gregorian/greg_calendar.hpp +include/boost/date_time/gregorian/greg_date.hpp +include/boost/date_time/gregorian/greg_day.hpp +include/boost/date_time/gregorian/greg_day_of_year.hpp +include/boost/date_time/gregorian/greg_duration.hpp +include/boost/date_time/gregorian/greg_duration_types.hpp +include/boost/date_time/gregorian/greg_facet.hpp +include/boost/date_time/gregorian/greg_month.hpp +include/boost/date_time/gregorian/greg_weekday.hpp +include/boost/date_time/gregorian/greg_year.hpp +include/boost/date_time/gregorian/greg_ymd.hpp +include/boost/date_time/gregorian/gregorian.hpp +include/boost/date_time/gregorian/gregorian_io.hpp +include/boost/date_time/gregorian/gregorian_types.hpp +include/boost/date_time/gregorian/parsers.hpp + +# boost/date_time/local_time +include/boost/date_time/local_time/conversion.hpp +include/boost/date_time/local_time/custom_time_zone.hpp +include/boost/date_time/local_time/date_duration_operators.hpp +include/boost/date_time/local_time/dst_transition_day_rules.hpp +include/boost/date_time/local_time/local_date_time.hpp +include/boost/date_time/local_time/local_time.hpp +include/boost/date_time/local_time/local_time_io.hpp +include/boost/date_time/local_time/local_time_types.hpp +include/boost/date_time/local_time/posix_time_zone.hpp +include/boost/date_time/local_time/tz_database.hpp + +# boost/date_time/posix_time +include/boost/date_time/posix_time/conversion.hpp +include/boost/date_time/posix_time/date_duration_operators.hpp +include/boost/date_time/posix_time/posix_time.hpp +include/boost/date_time/posix_time/posix_time_config.hpp +include/boost/date_time/posix_time/posix_time_duration.hpp +include/boost/date_time/posix_time/posix_time_io.hpp +include/boost/date_time/posix_time/posix_time_legacy_io.hpp +include/boost/date_time/posix_time/posix_time_system.hpp +include/boost/date_time/posix_time/posix_time_types.hpp +include/boost/date_time/posix_time/ptime.hpp +include/boost/date_time/posix_time/time_formatters.hpp +include/boost/date_time/posix_time/time_formatters_limited.hpp +include/boost/date_time/posix_time/time_parsers.hpp +include/boost/date_time/posix_time/time_period.hpp + +# boost/detail +include/boost/detail/allocator_utilities.hpp +include/boost/detail/atomic_count.hpp +include/boost/detail/basic_pointerbuf.hpp +include/boost/detail/bitmask.hpp +include/boost/detail/call_traits.hpp +include/boost/detail/compressed_pair.hpp +include/boost/detail/container_fwd.hpp +include/boost/detail/endian.hpp +include/boost/detail/fenv.hpp +include/boost/detail/indirect_traits.hpp +include/boost/detail/is_incrementable.hpp +include/boost/detail/is_xxx.hpp +include/boost/detail/iterator.hpp +include/boost/detail/lcast_precision.hpp +include/boost/detail/lightweight_mutex.hpp +include/boost/detail/no_exceptions_support.hpp +include/boost/detail/reference_content.hpp +include/boost/detail/scoped_enum_emulation.hpp +include/boost/detail/sp_typeinfo.hpp +include/boost/detail/templated_streams.hpp +include/boost/detail/workaround.hpp + +# boost/detail/winapi +include/boost/detail/winapi/basic_types.hpp +include/boost/detail/winapi/character_code_conversion.hpp +include/boost/detail/winapi/config.hpp +include/boost/detail/winapi/error_codes.hpp +include/boost/detail/winapi/error_handling.hpp +include/boost/detail/winapi/get_last_error.hpp +include/boost/detail/winapi/local_memory.hpp + +# boost/exception +include/boost/exception/error_info.hpp +include/boost/exception/exception.hpp + +# boost/filesystem +include/boost/filesystem/config.hpp +include/boost/filesystem/convenience.hpp +include/boost/filesystem/fstream.hpp +include/boost/filesystem/operations.hpp +include/boost/filesystem/path.hpp +include/boost/filesystem/path_traits.hpp +include/boost/filesystem/string_file.hpp + +# boost/format +include/boost/format/alt_sstream.hpp +include/boost/format/alt_sstream_impl.hpp +include/boost/format/exceptions.hpp +include/boost/format/feed_args.hpp +include/boost/format/format_class.hpp +include/boost/format/format_fwd.hpp +include/boost/format/format_implementation.hpp +include/boost/format/free_funcs.hpp +include/boost/format/group.hpp +include/boost/format/internals.hpp +include/boost/format/internals_fwd.hpp +include/boost/format/parsing.hpp + +# boost/format/detail +include/boost/format/detail/compat_workarounds.hpp +include/boost/format/detail/config_macros.hpp +include/boost/format/detail/msvc_disambiguater.hpp +include/boost/format/detail/unset_macros.hpp +include/boost/format/detail/workarounds_gcc-2_95.hpp +include/boost/format/detail/workarounds_stlport.hpp + +# boost/function +include/boost/function/function0.hpp +include/boost/function/function1.hpp +include/boost/function/function10.hpp +include/boost/function/function2.hpp +include/boost/function/function3.hpp +include/boost/function/function4.hpp +include/boost/function/function5.hpp +include/boost/function/function6.hpp +include/boost/function/function7.hpp +include/boost/function/function8.hpp +include/boost/function/function9.hpp +include/boost/function/function_base.hpp +include/boost/function/function_fwd.hpp +include/boost/function/function_template.hpp + +# boost/function/detail +include/boost/function/detail/function_iterate.hpp +include/boost/function/detail/maybe_include.hpp +include/boost/function/detail/prologue.hpp + +# boost/function_types +include/boost/function_types/components.hpp +include/boost/function_types/function_arity.hpp +include/boost/function_types/is_callable_builtin.hpp +include/boost/function_types/is_function.hpp +include/boost/function_types/is_member_function_pointer.hpp +include/boost/function_types/parameter_types.hpp +include/boost/function_types/property_tags.hpp +include/boost/function_types/result_type.hpp + +# boost/function_types/config +include/boost/function_types/config/cc_names.hpp +include/boost/function_types/config/compiler.hpp +include/boost/function_types/config/config.hpp + +# boost/function_types/detail +include/boost/function_types/detail/class_transform.hpp +include/boost/function_types/detail/classifier.hpp +include/boost/function_types/detail/components_as_mpl_sequence.hpp +include/boost/function_types/detail/cv_traits.hpp +include/boost/function_types/detail/pp_arity_loop.hpp +include/boost/function_types/detail/pp_loop.hpp +include/boost/function_types/detail/retag_default_cc.hpp +include/boost/function_types/detail/synthesize.hpp +include/boost/function_types/detail/to_sequence.hpp + +# boost/function_types/detail/classifier_impl +include/boost/function_types/detail/classifier_impl/arity10_0.hpp +include/boost/function_types/detail/classifier_impl/arity10_1.hpp +include/boost/function_types/detail/classifier_impl/arity20_0.hpp +include/boost/function_types/detail/classifier_impl/arity20_1.hpp +include/boost/function_types/detail/classifier_impl/arity30_0.hpp +include/boost/function_types/detail/classifier_impl/arity30_1.hpp +include/boost/function_types/detail/classifier_impl/arity40_0.hpp +include/boost/function_types/detail/classifier_impl/arity40_1.hpp +include/boost/function_types/detail/classifier_impl/arity50_0.hpp +include/boost/function_types/detail/classifier_impl/arity50_1.hpp +include/boost/function_types/detail/classifier_impl/master.hpp + +# boost/function_types/detail/components_impl +include/boost/function_types/detail/components_impl/arity10_0.hpp +include/boost/function_types/detail/components_impl/arity10_1.hpp +include/boost/function_types/detail/components_impl/arity20_0.hpp +include/boost/function_types/detail/components_impl/arity20_1.hpp +include/boost/function_types/detail/components_impl/arity30_0.hpp +include/boost/function_types/detail/components_impl/arity30_1.hpp +include/boost/function_types/detail/components_impl/arity40_0.hpp +include/boost/function_types/detail/components_impl/arity40_1.hpp +include/boost/function_types/detail/components_impl/arity50_0.hpp +include/boost/function_types/detail/components_impl/arity50_1.hpp +include/boost/function_types/detail/components_impl/master.hpp + +# boost/function_types/detail/encoding +include/boost/function_types/detail/encoding/aliases_def.hpp +include/boost/function_types/detail/encoding/aliases_undef.hpp +include/boost/function_types/detail/encoding/def.hpp +include/boost/function_types/detail/encoding/undef.hpp + +# boost/function_types/detail/pp_cc_loop +include/boost/function_types/detail/pp_cc_loop/master.hpp +include/boost/function_types/detail/pp_cc_loop/preprocessed.hpp + +# boost/function_types/detail/pp_retag_default_cc +include/boost/function_types/detail/pp_retag_default_cc/master.hpp +include/boost/function_types/detail/pp_retag_default_cc/preprocessed.hpp + +# boost/function_types/detail/pp_tags +include/boost/function_types/detail/pp_tags/cc_tag.hpp +include/boost/function_types/detail/pp_tags/master.hpp +include/boost/function_types/detail/pp_tags/preprocessed.hpp + +# boost/function_types/detail/pp_variate_loop +include/boost/function_types/detail/pp_variate_loop/master.hpp +include/boost/function_types/detail/pp_variate_loop/preprocessed.hpp + +# boost/function_types/detail/synthesize_impl +include/boost/function_types/detail/synthesize_impl/arity10_0.hpp +include/boost/function_types/detail/synthesize_impl/arity10_1.hpp +include/boost/function_types/detail/synthesize_impl/arity20_0.hpp +include/boost/function_types/detail/synthesize_impl/arity20_1.hpp +include/boost/function_types/detail/synthesize_impl/arity30_0.hpp +include/boost/function_types/detail/synthesize_impl/arity30_1.hpp +include/boost/function_types/detail/synthesize_impl/arity40_0.hpp +include/boost/function_types/detail/synthesize_impl/arity40_1.hpp +include/boost/function_types/detail/synthesize_impl/arity50_0.hpp +include/boost/function_types/detail/synthesize_impl/arity50_1.hpp +include/boost/function_types/detail/synthesize_impl/master.hpp + +# boost/functional +include/boost/functional/hash.hpp +include/boost/functional/hash_fwd.hpp + +# boost/functional/hash +include/boost/functional/hash/extensions.hpp +include/boost/functional/hash/hash.hpp +include/boost/functional/hash/hash_fwd.hpp + +# boost/functional/hash/detail +include/boost/functional/hash/detail/float_functions.hpp +include/boost/functional/hash/detail/hash_float.hpp +include/boost/functional/hash/detail/limits.hpp + +# boost/fusion +include/boost/fusion/mpl.hpp + +# boost/fusion/adapted +include/boost/fusion/adapted/mpl.hpp + +# boost/fusion/adapted/mpl +include/boost/fusion/adapted/mpl/mpl_iterator.hpp + +# boost/fusion/adapted/mpl/detail +include/boost/fusion/adapted/mpl/detail/at_impl.hpp +include/boost/fusion/adapted/mpl/detail/begin_impl.hpp +include/boost/fusion/adapted/mpl/detail/category_of_impl.hpp +include/boost/fusion/adapted/mpl/detail/empty_impl.hpp +include/boost/fusion/adapted/mpl/detail/end_impl.hpp +include/boost/fusion/adapted/mpl/detail/has_key_impl.hpp +include/boost/fusion/adapted/mpl/detail/is_sequence_impl.hpp +include/boost/fusion/adapted/mpl/detail/is_view_impl.hpp +include/boost/fusion/adapted/mpl/detail/size_impl.hpp +include/boost/fusion/adapted/mpl/detail/value_at_impl.hpp + +# boost/fusion/adapted/struct +include/boost/fusion/adapted/struct/adapt_struct.hpp + +# boost/fusion/adapted/struct/detail +include/boost/fusion/adapted/struct/detail/adapt_auto.hpp +include/boost/fusion/adapted/struct/detail/adapt_base.hpp +include/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp +include/boost/fusion/adapted/struct/detail/adapt_is_tpl.hpp +include/boost/fusion/adapted/struct/detail/at_impl.hpp +include/boost/fusion/adapted/struct/detail/begin_impl.hpp +include/boost/fusion/adapted/struct/detail/category_of_impl.hpp +include/boost/fusion/adapted/struct/detail/deref_impl.hpp +include/boost/fusion/adapted/struct/detail/end_impl.hpp +include/boost/fusion/adapted/struct/detail/extension.hpp +include/boost/fusion/adapted/struct/detail/is_sequence_impl.hpp +include/boost/fusion/adapted/struct/detail/is_view_impl.hpp +include/boost/fusion/adapted/struct/detail/size_impl.hpp +include/boost/fusion/adapted/struct/detail/value_at_impl.hpp +include/boost/fusion/adapted/struct/detail/value_of_impl.hpp + +# boost/fusion/adapted/struct/detail/preprocessor +include/boost/fusion/adapted/struct/detail/preprocessor/is_seq.hpp + +# boost/fusion/algorithm/auxiliary +include/boost/fusion/algorithm/auxiliary/copy.hpp + +# boost/fusion/algorithm/iteration +include/boost/fusion/algorithm/iteration/fold.hpp +include/boost/fusion/algorithm/iteration/fold_fwd.hpp +include/boost/fusion/algorithm/iteration/for_each.hpp +include/boost/fusion/algorithm/iteration/for_each_fwd.hpp +include/boost/fusion/algorithm/iteration/reverse_fold.hpp +include/boost/fusion/algorithm/iteration/reverse_fold_fwd.hpp + +# boost/fusion/algorithm/iteration/detail +include/boost/fusion/algorithm/iteration/detail/fold.hpp +include/boost/fusion/algorithm/iteration/detail/for_each.hpp +include/boost/fusion/algorithm/iteration/detail/segmented_fold.hpp +include/boost/fusion/algorithm/iteration/detail/segmented_for_each.hpp + +# boost/fusion/algorithm/iteration/detail/preprocessed +include/boost/fusion/algorithm/iteration/detail/preprocessed/fold.hpp +include/boost/fusion/algorithm/iteration/detail/preprocessed/reverse_fold.hpp + +# boost/fusion/algorithm/query +include/boost/fusion/algorithm/query/any.hpp +include/boost/fusion/algorithm/query/find.hpp +include/boost/fusion/algorithm/query/find_fwd.hpp +include/boost/fusion/algorithm/query/find_if.hpp +include/boost/fusion/algorithm/query/find_if_fwd.hpp + +# boost/fusion/algorithm/query/detail +include/boost/fusion/algorithm/query/detail/any.hpp +include/boost/fusion/algorithm/query/detail/find_if.hpp +include/boost/fusion/algorithm/query/detail/segmented_find.hpp +include/boost/fusion/algorithm/query/detail/segmented_find_if.hpp + +# boost/fusion/algorithm/transformation +include/boost/fusion/algorithm/transformation/erase.hpp +include/boost/fusion/algorithm/transformation/erase_key.hpp +include/boost/fusion/algorithm/transformation/filter_if.hpp +include/boost/fusion/algorithm/transformation/insert.hpp +include/boost/fusion/algorithm/transformation/insert_range.hpp +include/boost/fusion/algorithm/transformation/pop_back.hpp +include/boost/fusion/algorithm/transformation/pop_front.hpp +include/boost/fusion/algorithm/transformation/push_back.hpp +include/boost/fusion/algorithm/transformation/push_front.hpp +include/boost/fusion/algorithm/transformation/remove.hpp +include/boost/fusion/algorithm/transformation/reverse.hpp +include/boost/fusion/algorithm/transformation/transform.hpp + +# boost/fusion/container +include/boost/fusion/container/vector.hpp + +# boost/fusion/container/deque +include/boost/fusion/container/deque/deque_fwd.hpp + +# boost/fusion/container/deque/detail/cpp03 +include/boost/fusion/container/deque/detail/cpp03/deque_fwd.hpp +include/boost/fusion/container/deque/detail/cpp03/limits.hpp + +# boost/fusion/container/deque/detail/cpp03/preprocessed +include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque10_fwd.hpp +include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque20_fwd.hpp +include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque30_fwd.hpp +include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque40_fwd.hpp +include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque50_fwd.hpp +include/boost/fusion/container/deque/detail/cpp03/preprocessed/deque_fwd.hpp + +# boost/fusion/container/generation +include/boost/fusion/container/generation/make_vector.hpp + +# boost/fusion/container/generation/detail +include/boost/fusion/container/generation/detail/pp_make_vector.hpp + +# boost/fusion/container/generation/detail/preprocessed +include/boost/fusion/container/generation/detail/preprocessed/make_vector.hpp +include/boost/fusion/container/generation/detail/preprocessed/make_vector10.hpp +include/boost/fusion/container/generation/detail/preprocessed/make_vector20.hpp +include/boost/fusion/container/generation/detail/preprocessed/make_vector30.hpp +include/boost/fusion/container/generation/detail/preprocessed/make_vector40.hpp +include/boost/fusion/container/generation/detail/preprocessed/make_vector50.hpp + +# boost/fusion/container/list +include/boost/fusion/container/list/cons.hpp +include/boost/fusion/container/list/cons_fwd.hpp +include/boost/fusion/container/list/cons_iterator.hpp +include/boost/fusion/container/list/convert.hpp +include/boost/fusion/container/list/list_fwd.hpp +include/boost/fusion/container/list/nil.hpp + +# boost/fusion/container/list/detail +include/boost/fusion/container/list/detail/at_impl.hpp +include/boost/fusion/container/list/detail/begin_impl.hpp +include/boost/fusion/container/list/detail/build_cons.hpp +include/boost/fusion/container/list/detail/convert_impl.hpp +include/boost/fusion/container/list/detail/deref_impl.hpp +include/boost/fusion/container/list/detail/empty_impl.hpp +include/boost/fusion/container/list/detail/end_impl.hpp +include/boost/fusion/container/list/detail/equal_to_impl.hpp +include/boost/fusion/container/list/detail/next_impl.hpp +include/boost/fusion/container/list/detail/reverse_cons.hpp +include/boost/fusion/container/list/detail/value_at_impl.hpp +include/boost/fusion/container/list/detail/value_of_impl.hpp + +# boost/fusion/container/list/detail/cpp03 +include/boost/fusion/container/list/detail/cpp03/limits.hpp +include/boost/fusion/container/list/detail/cpp03/list_fwd.hpp + +# boost/fusion/container/list/detail/cpp03/preprocessed +include/boost/fusion/container/list/detail/cpp03/preprocessed/list10_fwd.hpp +include/boost/fusion/container/list/detail/cpp03/preprocessed/list20_fwd.hpp +include/boost/fusion/container/list/detail/cpp03/preprocessed/list30_fwd.hpp +include/boost/fusion/container/list/detail/cpp03/preprocessed/list40_fwd.hpp +include/boost/fusion/container/list/detail/cpp03/preprocessed/list50_fwd.hpp +include/boost/fusion/container/list/detail/cpp03/preprocessed/list_fwd.hpp + +# boost/fusion/container/map +include/boost/fusion/container/map/map_fwd.hpp + +# boost/fusion/container/map/detail +include/boost/fusion/container/map/detail/map_impl.hpp + +# boost/fusion/container/map/detail/cpp03 +include/boost/fusion/container/map/detail/cpp03/limits.hpp +include/boost/fusion/container/map/detail/cpp03/map_fwd.hpp + +# boost/fusion/container/map/detail/cpp03/preprocessed +include/boost/fusion/container/map/detail/cpp03/preprocessed/map10_fwd.hpp +include/boost/fusion/container/map/detail/cpp03/preprocessed/map20_fwd.hpp +include/boost/fusion/container/map/detail/cpp03/preprocessed/map30_fwd.hpp +include/boost/fusion/container/map/detail/cpp03/preprocessed/map40_fwd.hpp +include/boost/fusion/container/map/detail/cpp03/preprocessed/map50_fwd.hpp +include/boost/fusion/container/map/detail/cpp03/preprocessed/map_fwd.hpp + +# boost/fusion/container/set +include/boost/fusion/container/set/set_fwd.hpp + +# boost/fusion/container/set/detail/cpp03 +include/boost/fusion/container/set/detail/cpp03/limits.hpp +include/boost/fusion/container/set/detail/cpp03/set_fwd.hpp + +# boost/fusion/container/set/detail/cpp03/preprocessed +include/boost/fusion/container/set/detail/cpp03/preprocessed/set10_fwd.hpp +include/boost/fusion/container/set/detail/cpp03/preprocessed/set20_fwd.hpp +include/boost/fusion/container/set/detail/cpp03/preprocessed/set30_fwd.hpp +include/boost/fusion/container/set/detail/cpp03/preprocessed/set40_fwd.hpp +include/boost/fusion/container/set/detail/cpp03/preprocessed/set50_fwd.hpp +include/boost/fusion/container/set/detail/cpp03/preprocessed/set_fwd.hpp + +# boost/fusion/container/vector +include/boost/fusion/container/vector/convert.hpp +include/boost/fusion/container/vector/vector.hpp +include/boost/fusion/container/vector/vector10.hpp +include/boost/fusion/container/vector/vector_fwd.hpp +include/boost/fusion/container/vector/vector_iterator.hpp + +# boost/fusion/container/vector/detail +include/boost/fusion/container/vector/detail/advance_impl.hpp +include/boost/fusion/container/vector/detail/as_vector.hpp +include/boost/fusion/container/vector/detail/at_impl.hpp +include/boost/fusion/container/vector/detail/begin_impl.hpp +include/boost/fusion/container/vector/detail/config.hpp +include/boost/fusion/container/vector/detail/convert_impl.hpp +include/boost/fusion/container/vector/detail/deref_impl.hpp +include/boost/fusion/container/vector/detail/distance_impl.hpp +include/boost/fusion/container/vector/detail/end_impl.hpp +include/boost/fusion/container/vector/detail/equal_to_impl.hpp +include/boost/fusion/container/vector/detail/next_impl.hpp +include/boost/fusion/container/vector/detail/prior_impl.hpp +include/boost/fusion/container/vector/detail/value_at_impl.hpp +include/boost/fusion/container/vector/detail/value_of_impl.hpp + +# boost/fusion/container/vector/detail/cpp03 +include/boost/fusion/container/vector/detail/cpp03/as_vector.hpp +include/boost/fusion/container/vector/detail/cpp03/limits.hpp +include/boost/fusion/container/vector/detail/cpp03/value_at_impl.hpp +include/boost/fusion/container/vector/detail/cpp03/vector.hpp +include/boost/fusion/container/vector/detail/cpp03/vector10.hpp +include/boost/fusion/container/vector/detail/cpp03/vector10_fwd.hpp +include/boost/fusion/container/vector/detail/cpp03/vector20.hpp +include/boost/fusion/container/vector/detail/cpp03/vector20_fwd.hpp +include/boost/fusion/container/vector/detail/cpp03/vector30.hpp +include/boost/fusion/container/vector/detail/cpp03/vector30_fwd.hpp +include/boost/fusion/container/vector/detail/cpp03/vector40.hpp +include/boost/fusion/container/vector/detail/cpp03/vector40_fwd.hpp +include/boost/fusion/container/vector/detail/cpp03/vector50.hpp +include/boost/fusion/container/vector/detail/cpp03/vector50_fwd.hpp +include/boost/fusion/container/vector/detail/cpp03/vector_forward_ctor.hpp +include/boost/fusion/container/vector/detail/cpp03/vector_fwd.hpp +include/boost/fusion/container/vector/detail/cpp03/vector_n.hpp +include/boost/fusion/container/vector/detail/cpp03/vector_n_chooser.hpp + +# boost/fusion/container/vector/detail/cpp03/preprocessed +include/boost/fusion/container/vector/detail/cpp03/preprocessed/as_vector.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/as_vector10.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/as_vector20.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/as_vector30.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/as_vector40.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/as_vector50.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vector.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vector10.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vector10_fwd.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vector20.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vector20_fwd.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vector30.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vector30_fwd.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vector40.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vector40_fwd.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vector50.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vector50_fwd.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vector_chooser.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vector_chooser10.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vector_chooser20.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vector_chooser30.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vector_chooser40.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vector_chooser50.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vector_fwd.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector10.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector10_fwd.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector20.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector20_fwd.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector30.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector30_fwd.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector40.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector40_fwd.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector50.hpp +include/boost/fusion/container/vector/detail/cpp03/preprocessed/vvector50_fwd.hpp + +# boost/fusion/include +include/boost/fusion/include/any.hpp +include/boost/fusion/include/as_list.hpp +include/boost/fusion/include/as_vector.hpp +include/boost/fusion/include/at.hpp +include/boost/fusion/include/at_c.hpp +include/boost/fusion/include/begin.hpp +include/boost/fusion/include/category_of.hpp +include/boost/fusion/include/cons.hpp +include/boost/fusion/include/copy.hpp +include/boost/fusion/include/deref.hpp +include/boost/fusion/include/end.hpp +include/boost/fusion/include/equal_to.hpp +include/boost/fusion/include/filter_if.hpp +include/boost/fusion/include/fold.hpp +include/boost/fusion/include/for_each.hpp +include/boost/fusion/include/intrinsic.hpp +include/boost/fusion/include/is_segmented.hpp +include/boost/fusion/include/is_sequence.hpp +include/boost/fusion/include/is_view.hpp +include/boost/fusion/include/iterator_base.hpp +include/boost/fusion/include/make_vector.hpp +include/boost/fusion/include/mpl.hpp +include/boost/fusion/include/next.hpp +include/boost/fusion/include/out.hpp +include/boost/fusion/include/pop_back.hpp +include/boost/fusion/include/pop_front.hpp +include/boost/fusion/include/prior.hpp +include/boost/fusion/include/push_back.hpp +include/boost/fusion/include/push_front.hpp +include/boost/fusion/include/reverse.hpp +include/boost/fusion/include/reverse_fold.hpp +include/boost/fusion/include/single_view.hpp +include/boost/fusion/include/size.hpp +include/boost/fusion/include/tag_of_fwd.hpp +include/boost/fusion/include/transform.hpp +include/boost/fusion/include/value_at.hpp +include/boost/fusion/include/value_of.hpp +include/boost/fusion/include/vector.hpp + +# boost/fusion/iterator +include/boost/fusion/iterator/advance.hpp +include/boost/fusion/iterator/basic_iterator.hpp +include/boost/fusion/iterator/deref.hpp +include/boost/fusion/iterator/deref_data.hpp +include/boost/fusion/iterator/distance.hpp +include/boost/fusion/iterator/equal_to.hpp +include/boost/fusion/iterator/iterator_adapter.hpp +include/boost/fusion/iterator/iterator_facade.hpp +include/boost/fusion/iterator/key_of.hpp +include/boost/fusion/iterator/mpl.hpp +include/boost/fusion/iterator/next.hpp +include/boost/fusion/iterator/prior.hpp +include/boost/fusion/iterator/segmented_iterator.hpp +include/boost/fusion/iterator/value_of.hpp +include/boost/fusion/iterator/value_of_data.hpp + +# boost/fusion/iterator/detail +include/boost/fusion/iterator/detail/adapt_deref_traits.hpp +include/boost/fusion/iterator/detail/adapt_value_traits.hpp +include/boost/fusion/iterator/detail/advance.hpp +include/boost/fusion/iterator/detail/distance.hpp +include/boost/fusion/iterator/detail/segment_sequence.hpp +include/boost/fusion/iterator/detail/segmented_equal_to.hpp +include/boost/fusion/iterator/detail/segmented_iterator.hpp +include/boost/fusion/iterator/detail/segmented_next_impl.hpp + +# boost/fusion/iterator/mpl +include/boost/fusion/iterator/mpl/convert_iterator.hpp +include/boost/fusion/iterator/mpl/fusion_iterator.hpp + +# boost/fusion/mpl +include/boost/fusion/mpl/at.hpp +include/boost/fusion/mpl/back.hpp +include/boost/fusion/mpl/begin.hpp +include/boost/fusion/mpl/clear.hpp +include/boost/fusion/mpl/empty.hpp +include/boost/fusion/mpl/end.hpp +include/boost/fusion/mpl/erase.hpp +include/boost/fusion/mpl/erase_key.hpp +include/boost/fusion/mpl/front.hpp +include/boost/fusion/mpl/has_key.hpp +include/boost/fusion/mpl/insert.hpp +include/boost/fusion/mpl/insert_range.hpp +include/boost/fusion/mpl/pop_back.hpp +include/boost/fusion/mpl/pop_front.hpp +include/boost/fusion/mpl/push_back.hpp +include/boost/fusion/mpl/push_front.hpp +include/boost/fusion/mpl/size.hpp + +# boost/fusion/mpl/detail +include/boost/fusion/mpl/detail/clear.hpp + +# boost/fusion/sequence +include/boost/fusion/sequence/convert.hpp +include/boost/fusion/sequence/intrinsic.hpp +include/boost/fusion/sequence/intrinsic_fwd.hpp +include/boost/fusion/sequence/sequence_facade.hpp + +# boost/fusion/sequence/comparison +include/boost/fusion/sequence/comparison/enable_comparison.hpp +include/boost/fusion/sequence/comparison/equal_to.hpp + +# boost/fusion/sequence/comparison/detail +include/boost/fusion/sequence/comparison/detail/equal_to.hpp + +# boost/fusion/sequence/intrinsic +include/boost/fusion/sequence/intrinsic/at.hpp +include/boost/fusion/sequence/intrinsic/at_c.hpp +include/boost/fusion/sequence/intrinsic/at_key.hpp +include/boost/fusion/sequence/intrinsic/back.hpp +include/boost/fusion/sequence/intrinsic/begin.hpp +include/boost/fusion/sequence/intrinsic/empty.hpp +include/boost/fusion/sequence/intrinsic/end.hpp +include/boost/fusion/sequence/intrinsic/front.hpp +include/boost/fusion/sequence/intrinsic/has_key.hpp +include/boost/fusion/sequence/intrinsic/segments.hpp +include/boost/fusion/sequence/intrinsic/size.hpp +include/boost/fusion/sequence/intrinsic/swap.hpp +include/boost/fusion/sequence/intrinsic/value_at.hpp +include/boost/fusion/sequence/intrinsic/value_at_key.hpp + +# boost/fusion/sequence/intrinsic/detail +include/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp +include/boost/fusion/sequence/intrinsic/detail/segmented_begin_impl.hpp +include/boost/fusion/sequence/intrinsic/detail/segmented_end.hpp +include/boost/fusion/sequence/intrinsic/detail/segmented_end_impl.hpp +include/boost/fusion/sequence/intrinsic/detail/segmented_size.hpp + +# boost/fusion/sequence/io +include/boost/fusion/sequence/io/out.hpp + +# boost/fusion/sequence/io/detail +include/boost/fusion/sequence/io/detail/manip.hpp +include/boost/fusion/sequence/io/detail/out.hpp + +# boost/fusion/support +include/boost/fusion/support/as_const.hpp +include/boost/fusion/support/category_of.hpp +include/boost/fusion/support/config.hpp +include/boost/fusion/support/is_iterator.hpp +include/boost/fusion/support/is_segmented.hpp +include/boost/fusion/support/is_sequence.hpp +include/boost/fusion/support/is_view.hpp +include/boost/fusion/support/iterator_base.hpp +include/boost/fusion/support/segmented_fold_until.hpp +include/boost/fusion/support/sequence_base.hpp +include/boost/fusion/support/tag_of.hpp +include/boost/fusion/support/tag_of_fwd.hpp +include/boost/fusion/support/unused.hpp +include/boost/fusion/support/void.hpp + +# boost/fusion/support/detail +include/boost/fusion/support/detail/access.hpp +include/boost/fusion/support/detail/and.hpp +include/boost/fusion/support/detail/as_fusion_element.hpp +include/boost/fusion/support/detail/category_of.hpp +include/boost/fusion/support/detail/enabler.hpp +include/boost/fusion/support/detail/index_sequence.hpp +include/boost/fusion/support/detail/is_mpl_sequence.hpp +include/boost/fusion/support/detail/is_view.hpp +include/boost/fusion/support/detail/mpl_iterator_category.hpp +include/boost/fusion/support/detail/pp_round.hpp +include/boost/fusion/support/detail/segmented_fold_until_impl.hpp + +# boost/fusion/view +include/boost/fusion/view/iterator_range.hpp +include/boost/fusion/view/single_view.hpp +include/boost/fusion/view/zip_view.hpp + +# boost/fusion/view/detail +include/boost/fusion/view/detail/strictest_traversal.hpp + +# boost/fusion/view/filter_view +include/boost/fusion/view/filter_view/filter_view.hpp +include/boost/fusion/view/filter_view/filter_view_iterator.hpp + +# boost/fusion/view/filter_view/detail +include/boost/fusion/view/filter_view/detail/begin_impl.hpp +include/boost/fusion/view/filter_view/detail/deref_data_impl.hpp +include/boost/fusion/view/filter_view/detail/deref_impl.hpp +include/boost/fusion/view/filter_view/detail/end_impl.hpp +include/boost/fusion/view/filter_view/detail/equal_to_impl.hpp +include/boost/fusion/view/filter_view/detail/key_of_impl.hpp +include/boost/fusion/view/filter_view/detail/next_impl.hpp +include/boost/fusion/view/filter_view/detail/size_impl.hpp +include/boost/fusion/view/filter_view/detail/value_of_data_impl.hpp +include/boost/fusion/view/filter_view/detail/value_of_impl.hpp + +# boost/fusion/view/iterator_range +include/boost/fusion/view/iterator_range/iterator_range.hpp + +# boost/fusion/view/iterator_range/detail +include/boost/fusion/view/iterator_range/detail/at_impl.hpp +include/boost/fusion/view/iterator_range/detail/begin_impl.hpp +include/boost/fusion/view/iterator_range/detail/end_impl.hpp +include/boost/fusion/view/iterator_range/detail/is_segmented_impl.hpp +include/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp +include/boost/fusion/view/iterator_range/detail/segments_impl.hpp +include/boost/fusion/view/iterator_range/detail/size_impl.hpp +include/boost/fusion/view/iterator_range/detail/value_at_impl.hpp + +# boost/fusion/view/joint_view +include/boost/fusion/view/joint_view/joint_view.hpp +include/boost/fusion/view/joint_view/joint_view_fwd.hpp +include/boost/fusion/view/joint_view/joint_view_iterator.hpp + +# boost/fusion/view/joint_view/detail +include/boost/fusion/view/joint_view/detail/begin_impl.hpp +include/boost/fusion/view/joint_view/detail/deref_data_impl.hpp +include/boost/fusion/view/joint_view/detail/deref_impl.hpp +include/boost/fusion/view/joint_view/detail/end_impl.hpp +include/boost/fusion/view/joint_view/detail/key_of_impl.hpp +include/boost/fusion/view/joint_view/detail/next_impl.hpp +include/boost/fusion/view/joint_view/detail/value_of_data_impl.hpp +include/boost/fusion/view/joint_view/detail/value_of_impl.hpp + +# boost/fusion/view/reverse_view +include/boost/fusion/view/reverse_view/reverse_view.hpp +include/boost/fusion/view/reverse_view/reverse_view_iterator.hpp + +# boost/fusion/view/reverse_view/detail +include/boost/fusion/view/reverse_view/detail/advance_impl.hpp +include/boost/fusion/view/reverse_view/detail/at_impl.hpp +include/boost/fusion/view/reverse_view/detail/begin_impl.hpp +include/boost/fusion/view/reverse_view/detail/deref_data_impl.hpp +include/boost/fusion/view/reverse_view/detail/deref_impl.hpp +include/boost/fusion/view/reverse_view/detail/distance_impl.hpp +include/boost/fusion/view/reverse_view/detail/end_impl.hpp +include/boost/fusion/view/reverse_view/detail/key_of_impl.hpp +include/boost/fusion/view/reverse_view/detail/next_impl.hpp +include/boost/fusion/view/reverse_view/detail/prior_impl.hpp +include/boost/fusion/view/reverse_view/detail/value_at_impl.hpp +include/boost/fusion/view/reverse_view/detail/value_of_data_impl.hpp +include/boost/fusion/view/reverse_view/detail/value_of_impl.hpp + +# boost/fusion/view/single_view +include/boost/fusion/view/single_view/single_view.hpp +include/boost/fusion/view/single_view/single_view_iterator.hpp + +# boost/fusion/view/single_view/detail +include/boost/fusion/view/single_view/detail/advance_impl.hpp +include/boost/fusion/view/single_view/detail/at_impl.hpp +include/boost/fusion/view/single_view/detail/begin_impl.hpp +include/boost/fusion/view/single_view/detail/deref_impl.hpp +include/boost/fusion/view/single_view/detail/distance_impl.hpp +include/boost/fusion/view/single_view/detail/end_impl.hpp +include/boost/fusion/view/single_view/detail/equal_to_impl.hpp +include/boost/fusion/view/single_view/detail/next_impl.hpp +include/boost/fusion/view/single_view/detail/prior_impl.hpp +include/boost/fusion/view/single_view/detail/size_impl.hpp +include/boost/fusion/view/single_view/detail/value_at_impl.hpp +include/boost/fusion/view/single_view/detail/value_of_impl.hpp + +# boost/fusion/view/transform_view +include/boost/fusion/view/transform_view/transform_view.hpp +include/boost/fusion/view/transform_view/transform_view_fwd.hpp +include/boost/fusion/view/transform_view/transform_view_iterator.hpp + +# boost/fusion/view/transform_view/detail +include/boost/fusion/view/transform_view/detail/advance_impl.hpp +include/boost/fusion/view/transform_view/detail/apply_transform_result.hpp +include/boost/fusion/view/transform_view/detail/at_impl.hpp +include/boost/fusion/view/transform_view/detail/begin_impl.hpp +include/boost/fusion/view/transform_view/detail/deref_impl.hpp +include/boost/fusion/view/transform_view/detail/distance_impl.hpp +include/boost/fusion/view/transform_view/detail/end_impl.hpp +include/boost/fusion/view/transform_view/detail/equal_to_impl.hpp +include/boost/fusion/view/transform_view/detail/next_impl.hpp +include/boost/fusion/view/transform_view/detail/prior_impl.hpp +include/boost/fusion/view/transform_view/detail/value_at_impl.hpp +include/boost/fusion/view/transform_view/detail/value_of_impl.hpp + +# boost/fusion/view/zip_view +include/boost/fusion/view/zip_view/zip_view.hpp +include/boost/fusion/view/zip_view/zip_view_iterator.hpp +include/boost/fusion/view/zip_view/zip_view_iterator_fwd.hpp + +# boost/fusion/view/zip_view/detail +include/boost/fusion/view/zip_view/detail/advance_impl.hpp +include/boost/fusion/view/zip_view/detail/at_impl.hpp +include/boost/fusion/view/zip_view/detail/begin_impl.hpp +include/boost/fusion/view/zip_view/detail/deref_impl.hpp +include/boost/fusion/view/zip_view/detail/distance_impl.hpp +include/boost/fusion/view/zip_view/detail/end_impl.hpp +include/boost/fusion/view/zip_view/detail/equal_to_impl.hpp +include/boost/fusion/view/zip_view/detail/next_impl.hpp +include/boost/fusion/view/zip_view/detail/prior_impl.hpp +include/boost/fusion/view/zip_view/detail/size_impl.hpp +include/boost/fusion/view/zip_view/detail/value_at_impl.hpp +include/boost/fusion/view/zip_view/detail/value_of_impl.hpp + +# boost/geometry +include/boost/geometry/geometry.hpp + +# boost/geometry/algorithms +include/boost/geometry/algorithms/append.hpp +include/boost/geometry/algorithms/area.hpp +include/boost/geometry/algorithms/assign.hpp +include/boost/geometry/algorithms/buffer.hpp +include/boost/geometry/algorithms/centroid.hpp +include/boost/geometry/algorithms/clear.hpp +include/boost/geometry/algorithms/comparable_distance.hpp +include/boost/geometry/algorithms/convert.hpp +include/boost/geometry/algorithms/convex_hull.hpp +include/boost/geometry/algorithms/correct.hpp +include/boost/geometry/algorithms/covered_by.hpp +include/boost/geometry/algorithms/crosses.hpp +include/boost/geometry/algorithms/difference.hpp +include/boost/geometry/algorithms/disjoint.hpp +include/boost/geometry/algorithms/distance.hpp +include/boost/geometry/algorithms/envelope.hpp +include/boost/geometry/algorithms/equals.hpp +include/boost/geometry/algorithms/expand.hpp +include/boost/geometry/algorithms/for_each.hpp +include/boost/geometry/algorithms/intersection.hpp +include/boost/geometry/algorithms/intersects.hpp +include/boost/geometry/algorithms/is_convex.hpp +include/boost/geometry/algorithms/is_empty.hpp +include/boost/geometry/algorithms/is_simple.hpp +include/boost/geometry/algorithms/is_valid.hpp +include/boost/geometry/algorithms/length.hpp +include/boost/geometry/algorithms/make.hpp +include/boost/geometry/algorithms/not_implemented.hpp +include/boost/geometry/algorithms/num_geometries.hpp +include/boost/geometry/algorithms/num_interior_rings.hpp +include/boost/geometry/algorithms/num_points.hpp +include/boost/geometry/algorithms/num_segments.hpp +include/boost/geometry/algorithms/overlaps.hpp +include/boost/geometry/algorithms/perimeter.hpp +include/boost/geometry/algorithms/relate.hpp +include/boost/geometry/algorithms/relation.hpp +include/boost/geometry/algorithms/remove_spikes.hpp +include/boost/geometry/algorithms/reverse.hpp +include/boost/geometry/algorithms/simplify.hpp +include/boost/geometry/algorithms/sym_difference.hpp +include/boost/geometry/algorithms/touches.hpp +include/boost/geometry/algorithms/transform.hpp +include/boost/geometry/algorithms/union.hpp +include/boost/geometry/algorithms/unique.hpp +include/boost/geometry/algorithms/validity_failure_type.hpp +include/boost/geometry/algorithms/within.hpp + +# boost/geometry/algorithms/detail +include/boost/geometry/algorithms/detail/as_range.hpp +include/boost/geometry/algorithms/detail/assign_box_corners.hpp +include/boost/geometry/algorithms/detail/assign_indexed_point.hpp +include/boost/geometry/algorithms/detail/assign_values.hpp +include/boost/geometry/algorithms/detail/azimuth.hpp +include/boost/geometry/algorithms/detail/calculate_null.hpp +include/boost/geometry/algorithms/detail/calculate_sum.hpp +include/boost/geometry/algorithms/detail/check_iterator_range.hpp +include/boost/geometry/algorithms/detail/convert_indexed_to_indexed.hpp +include/boost/geometry/algorithms/detail/convert_point_to_point.hpp +include/boost/geometry/algorithms/detail/counting.hpp +include/boost/geometry/algorithms/detail/course.hpp +include/boost/geometry/algorithms/detail/direction_code.hpp +include/boost/geometry/algorithms/detail/expand_by_epsilon.hpp +include/boost/geometry/algorithms/detail/for_each_range.hpp +include/boost/geometry/algorithms/detail/get_left_turns.hpp +include/boost/geometry/algorithms/detail/get_max_size.hpp +include/boost/geometry/algorithms/detail/has_self_intersections.hpp +include/boost/geometry/algorithms/detail/interior_iterator.hpp +include/boost/geometry/algorithms/detail/max_interval_gap.hpp +include/boost/geometry/algorithms/detail/multi_modify.hpp +include/boost/geometry/algorithms/detail/multi_sum.hpp +include/boost/geometry/algorithms/detail/normalize.hpp +include/boost/geometry/algorithms/detail/not.hpp +include/boost/geometry/algorithms/detail/num_distinct_consecutive_points.hpp +include/boost/geometry/algorithms/detail/occupation_info.hpp +include/boost/geometry/algorithms/detail/partition.hpp +include/boost/geometry/algorithms/detail/point_is_spike_or_equal.hpp +include/boost/geometry/algorithms/detail/point_on_border.hpp +include/boost/geometry/algorithms/detail/recalculate.hpp +include/boost/geometry/algorithms/detail/ring_identifier.hpp +include/boost/geometry/algorithms/detail/signed_size_type.hpp +include/boost/geometry/algorithms/detail/single_geometry.hpp +include/boost/geometry/algorithms/detail/sub_range.hpp +include/boost/geometry/algorithms/detail/sweep.hpp +include/boost/geometry/algorithms/detail/throw_on_empty_input.hpp + +# boost/geometry/algorithms/detail/buffer +include/boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp +include/boost/geometry/algorithms/detail/buffer/buffer_policies.hpp +include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp +include/boost/geometry/algorithms/detail/buffer/buffered_ring.hpp +include/boost/geometry/algorithms/detail/buffer/get_piece_turns.hpp +include/boost/geometry/algorithms/detail/buffer/line_line_intersection.hpp +include/boost/geometry/algorithms/detail/buffer/parallel_continue.hpp +include/boost/geometry/algorithms/detail/buffer/turn_in_original_visitor.hpp +include/boost/geometry/algorithms/detail/buffer/turn_in_piece_visitor.hpp + +# boost/geometry/algorithms/detail/centroid +include/boost/geometry/algorithms/detail/centroid/translating_transformer.hpp + +# boost/geometry/algorithms/detail/closest_feature +include/boost/geometry/algorithms/detail/closest_feature/geometry_to_range.hpp +include/boost/geometry/algorithms/detail/closest_feature/point_to_range.hpp +include/boost/geometry/algorithms/detail/closest_feature/range_to_range.hpp + +# boost/geometry/algorithms/detail/comparable_distance +include/boost/geometry/algorithms/detail/comparable_distance/implementation.hpp +include/boost/geometry/algorithms/detail/comparable_distance/interface.hpp + +# boost/geometry/algorithms/detail/covered_by +include/boost/geometry/algorithms/detail/covered_by/implementation.hpp +include/boost/geometry/algorithms/detail/covered_by/interface.hpp + +# boost/geometry/algorithms/detail/disjoint +include/boost/geometry/algorithms/detail/disjoint/areal_areal.hpp +include/boost/geometry/algorithms/detail/disjoint/box_box.hpp +include/boost/geometry/algorithms/detail/disjoint/implementation.hpp +include/boost/geometry/algorithms/detail/disjoint/interface.hpp +include/boost/geometry/algorithms/detail/disjoint/linear_areal.hpp +include/boost/geometry/algorithms/detail/disjoint/linear_linear.hpp +include/boost/geometry/algorithms/detail/disjoint/linear_segment_or_box.hpp +include/boost/geometry/algorithms/detail/disjoint/multipoint_geometry.hpp +include/boost/geometry/algorithms/detail/disjoint/multirange_geometry.hpp +include/boost/geometry/algorithms/detail/disjoint/point_box.hpp +include/boost/geometry/algorithms/detail/disjoint/point_geometry.hpp +include/boost/geometry/algorithms/detail/disjoint/point_point.hpp +include/boost/geometry/algorithms/detail/disjoint/segment_box.hpp + +# boost/geometry/algorithms/detail/distance +include/boost/geometry/algorithms/detail/distance/backward_compatibility.hpp +include/boost/geometry/algorithms/detail/distance/box_to_box.hpp +include/boost/geometry/algorithms/detail/distance/default_strategies.hpp +include/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp +include/boost/geometry/algorithms/detail/distance/implementation.hpp +include/boost/geometry/algorithms/detail/distance/interface.hpp +include/boost/geometry/algorithms/detail/distance/is_comparable.hpp +include/boost/geometry/algorithms/detail/distance/iterator_selector.hpp +include/boost/geometry/algorithms/detail/distance/linear_or_areal_to_areal.hpp +include/boost/geometry/algorithms/detail/distance/linear_to_linear.hpp +include/boost/geometry/algorithms/detail/distance/multipoint_to_geometry.hpp +include/boost/geometry/algorithms/detail/distance/point_to_geometry.hpp +include/boost/geometry/algorithms/detail/distance/range_to_geometry_rtree.hpp +include/boost/geometry/algorithms/detail/distance/segment_to_box.hpp +include/boost/geometry/algorithms/detail/distance/segment_to_segment.hpp + +# boost/geometry/algorithms/detail/envelope +include/boost/geometry/algorithms/detail/envelope/box.hpp +include/boost/geometry/algorithms/detail/envelope/implementation.hpp +include/boost/geometry/algorithms/detail/envelope/initialize.hpp +include/boost/geometry/algorithms/detail/envelope/interface.hpp +include/boost/geometry/algorithms/detail/envelope/linear.hpp +include/boost/geometry/algorithms/detail/envelope/multipoint.hpp +include/boost/geometry/algorithms/detail/envelope/point.hpp +include/boost/geometry/algorithms/detail/envelope/range.hpp +include/boost/geometry/algorithms/detail/envelope/range_of_boxes.hpp +include/boost/geometry/algorithms/detail/envelope/segment.hpp +include/boost/geometry/algorithms/detail/envelope/transform_units.hpp + +# boost/geometry/algorithms/detail/equals +include/boost/geometry/algorithms/detail/equals/collect_vectors.hpp +include/boost/geometry/algorithms/detail/equals/implementation.hpp +include/boost/geometry/algorithms/detail/equals/interface.hpp +include/boost/geometry/algorithms/detail/equals/point_point.hpp + +# boost/geometry/algorithms/detail/expand +include/boost/geometry/algorithms/detail/expand/box.hpp +include/boost/geometry/algorithms/detail/expand/implementation.hpp +include/boost/geometry/algorithms/detail/expand/indexed.hpp +include/boost/geometry/algorithms/detail/expand/interface.hpp +include/boost/geometry/algorithms/detail/expand/point.hpp +include/boost/geometry/algorithms/detail/expand/segment.hpp + +# boost/geometry/algorithms/detail/intersection +include/boost/geometry/algorithms/detail/intersection/box_box.hpp +include/boost/geometry/algorithms/detail/intersection/implementation.hpp +include/boost/geometry/algorithms/detail/intersection/interface.hpp +include/boost/geometry/algorithms/detail/intersection/multi.hpp + +# boost/geometry/algorithms/detail/intersects +include/boost/geometry/algorithms/detail/intersects/implementation.hpp +include/boost/geometry/algorithms/detail/intersects/interface.hpp + +# boost/geometry/algorithms/detail/is_simple +include/boost/geometry/algorithms/detail/is_simple/always_simple.hpp +include/boost/geometry/algorithms/detail/is_simple/areal.hpp +include/boost/geometry/algorithms/detail/is_simple/debug_print_boundary_points.hpp +include/boost/geometry/algorithms/detail/is_simple/failure_policy.hpp +include/boost/geometry/algorithms/detail/is_simple/implementation.hpp +include/boost/geometry/algorithms/detail/is_simple/interface.hpp +include/boost/geometry/algorithms/detail/is_simple/linear.hpp +include/boost/geometry/algorithms/detail/is_simple/multipoint.hpp + +# boost/geometry/algorithms/detail/is_valid +include/boost/geometry/algorithms/detail/is_valid/box.hpp +include/boost/geometry/algorithms/detail/is_valid/complement_graph.hpp +include/boost/geometry/algorithms/detail/is_valid/debug_complement_graph.hpp +include/boost/geometry/algorithms/detail/is_valid/debug_print_turns.hpp +include/boost/geometry/algorithms/detail/is_valid/debug_validity_phase.hpp +include/boost/geometry/algorithms/detail/is_valid/has_duplicates.hpp +include/boost/geometry/algorithms/detail/is_valid/has_invalid_coordinate.hpp +include/boost/geometry/algorithms/detail/is_valid/has_spikes.hpp +include/boost/geometry/algorithms/detail/is_valid/has_valid_self_turns.hpp +include/boost/geometry/algorithms/detail/is_valid/implementation.hpp +include/boost/geometry/algorithms/detail/is_valid/interface.hpp +include/boost/geometry/algorithms/detail/is_valid/is_acceptable_turn.hpp +include/boost/geometry/algorithms/detail/is_valid/linear.hpp +include/boost/geometry/algorithms/detail/is_valid/multipolygon.hpp +include/boost/geometry/algorithms/detail/is_valid/pointlike.hpp +include/boost/geometry/algorithms/detail/is_valid/polygon.hpp +include/boost/geometry/algorithms/detail/is_valid/ring.hpp +include/boost/geometry/algorithms/detail/is_valid/segment.hpp + +# boost/geometry/algorithms/detail/overlaps +include/boost/geometry/algorithms/detail/overlaps/implementation.hpp +include/boost/geometry/algorithms/detail/overlaps/interface.hpp + +# boost/geometry/algorithms/detail/overlay +include/boost/geometry/algorithms/detail/overlay/add_rings.hpp +include/boost/geometry/algorithms/detail/overlay/aggregate_operations.hpp +include/boost/geometry/algorithms/detail/overlay/append_no_duplicates.hpp +include/boost/geometry/algorithms/detail/overlay/append_no_dups_or_spikes.hpp +include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp +include/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp +include/boost/geometry/algorithms/detail/overlay/check_enrich.hpp +include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp +include/boost/geometry/algorithms/detail/overlay/cluster_info.hpp +include/boost/geometry/algorithms/detail/overlay/convert_ring.hpp +include/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp +include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp +include/boost/geometry/algorithms/detail/overlay/debug_turn_info.hpp +include/boost/geometry/algorithms/detail/overlay/do_reverse.hpp +include/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp +include/boost/geometry/algorithms/detail/overlay/enrichment_info.hpp +include/boost/geometry/algorithms/detail/overlay/follow.hpp +include/boost/geometry/algorithms/detail/overlay/follow_linear_linear.hpp +include/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp +include/boost/geometry/algorithms/detail/overlay/get_ring.hpp +include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp +include/boost/geometry/algorithms/detail/overlay/get_turn_info_for_endpoint.hpp +include/boost/geometry/algorithms/detail/overlay/get_turn_info_helpers.hpp +include/boost/geometry/algorithms/detail/overlay/get_turn_info_la.hpp +include/boost/geometry/algorithms/detail/overlay/get_turn_info_ll.hpp +include/boost/geometry/algorithms/detail/overlay/get_turns.hpp +include/boost/geometry/algorithms/detail/overlay/handle_colocations.hpp +include/boost/geometry/algorithms/detail/overlay/handle_self_turns.hpp +include/boost/geometry/algorithms/detail/overlay/inconsistent_turns_exception.hpp +include/boost/geometry/algorithms/detail/overlay/intersection_box_box.hpp +include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp +include/boost/geometry/algorithms/detail/overlay/is_self_turn.hpp +include/boost/geometry/algorithms/detail/overlay/less_by_segment_ratio.hpp +include/boost/geometry/algorithms/detail/overlay/linear_linear.hpp +include/boost/geometry/algorithms/detail/overlay/overlay.hpp +include/boost/geometry/algorithms/detail/overlay/overlay_type.hpp +include/boost/geometry/algorithms/detail/overlay/pointlike_linear.hpp +include/boost/geometry/algorithms/detail/overlay/pointlike_pointlike.hpp +include/boost/geometry/algorithms/detail/overlay/range_in_geometry.hpp +include/boost/geometry/algorithms/detail/overlay/ring_properties.hpp +include/boost/geometry/algorithms/detail/overlay/segment_identifier.hpp +include/boost/geometry/algorithms/detail/overlay/select_rings.hpp +include/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp +include/boost/geometry/algorithms/detail/overlay/sort_by_side.hpp +include/boost/geometry/algorithms/detail/overlay/traversal.hpp +include/boost/geometry/algorithms/detail/overlay/traversal_info.hpp +include/boost/geometry/algorithms/detail/overlay/traversal_intersection_patterns.hpp +include/boost/geometry/algorithms/detail/overlay/traversal_ring_creator.hpp +include/boost/geometry/algorithms/detail/overlay/traversal_switch_detector.hpp +include/boost/geometry/algorithms/detail/overlay/traverse.hpp +include/boost/geometry/algorithms/detail/overlay/turn_info.hpp +include/boost/geometry/algorithms/detail/overlay/visit_info.hpp + +# boost/geometry/algorithms/detail/relate +include/boost/geometry/algorithms/detail/relate/areal_areal.hpp +include/boost/geometry/algorithms/detail/relate/boundary_checker.hpp +include/boost/geometry/algorithms/detail/relate/de9im.hpp +include/boost/geometry/algorithms/detail/relate/follow_helpers.hpp +include/boost/geometry/algorithms/detail/relate/implementation.hpp +include/boost/geometry/algorithms/detail/relate/interface.hpp +include/boost/geometry/algorithms/detail/relate/less.hpp +include/boost/geometry/algorithms/detail/relate/linear_areal.hpp +include/boost/geometry/algorithms/detail/relate/linear_linear.hpp +include/boost/geometry/algorithms/detail/relate/multi_point_geometry.hpp +include/boost/geometry/algorithms/detail/relate/point_geometry.hpp +include/boost/geometry/algorithms/detail/relate/point_point.hpp +include/boost/geometry/algorithms/detail/relate/relate_impl.hpp +include/boost/geometry/algorithms/detail/relate/result.hpp +include/boost/geometry/algorithms/detail/relate/topology_check.hpp +include/boost/geometry/algorithms/detail/relate/turns.hpp + +# boost/geometry/algorithms/detail/relation +include/boost/geometry/algorithms/detail/relation/implementation.hpp +include/boost/geometry/algorithms/detail/relation/interface.hpp + +# boost/geometry/algorithms/detail/sections +include/boost/geometry/algorithms/detail/sections/range_by_section.hpp +include/boost/geometry/algorithms/detail/sections/section_box_policies.hpp +include/boost/geometry/algorithms/detail/sections/section_functions.hpp +include/boost/geometry/algorithms/detail/sections/sectionalize.hpp + +# boost/geometry/algorithms/detail/touches +include/boost/geometry/algorithms/detail/touches/implementation.hpp +include/boost/geometry/algorithms/detail/touches/interface.hpp + +# boost/geometry/algorithms/detail/turns +include/boost/geometry/algorithms/detail/turns/compare_turns.hpp +include/boost/geometry/algorithms/detail/turns/debug_turn.hpp +include/boost/geometry/algorithms/detail/turns/filter_continue_turns.hpp +include/boost/geometry/algorithms/detail/turns/remove_duplicate_turns.hpp + +# boost/geometry/algorithms/detail/within +include/boost/geometry/algorithms/detail/within/implementation.hpp +include/boost/geometry/algorithms/detail/within/interface.hpp +include/boost/geometry/algorithms/detail/within/multi_point.hpp +include/boost/geometry/algorithms/detail/within/point_in_geometry.hpp + +# boost/geometry/algorithms/dispatch +include/boost/geometry/algorithms/dispatch/disjoint.hpp +include/boost/geometry/algorithms/dispatch/distance.hpp +include/boost/geometry/algorithms/dispatch/envelope.hpp +include/boost/geometry/algorithms/dispatch/expand.hpp +include/boost/geometry/algorithms/dispatch/is_simple.hpp +include/boost/geometry/algorithms/dispatch/is_valid.hpp + +# boost/geometry/arithmetic +include/boost/geometry/arithmetic/arithmetic.hpp +include/boost/geometry/arithmetic/cross_product.hpp +include/boost/geometry/arithmetic/determinant.hpp +include/boost/geometry/arithmetic/dot_product.hpp +include/boost/geometry/arithmetic/normalize.hpp + +# boost/geometry/core +include/boost/geometry/core/access.hpp +include/boost/geometry/core/assert.hpp +include/boost/geometry/core/closure.hpp +include/boost/geometry/core/coordinate_dimension.hpp +include/boost/geometry/core/coordinate_system.hpp +include/boost/geometry/core/coordinate_type.hpp +include/boost/geometry/core/cs.hpp +include/boost/geometry/core/exception.hpp +include/boost/geometry/core/exterior_ring.hpp +include/boost/geometry/core/geometry_id.hpp +include/boost/geometry/core/interior_rings.hpp +include/boost/geometry/core/interior_type.hpp +include/boost/geometry/core/is_areal.hpp +include/boost/geometry/core/mutable_range.hpp +include/boost/geometry/core/point_order.hpp +include/boost/geometry/core/point_type.hpp +include/boost/geometry/core/radian_access.hpp +include/boost/geometry/core/radius.hpp +include/boost/geometry/core/reverse_dispatch.hpp +include/boost/geometry/core/ring_type.hpp +include/boost/geometry/core/srs.hpp +include/boost/geometry/core/tag.hpp +include/boost/geometry/core/tag_cast.hpp +include/boost/geometry/core/tags.hpp +include/boost/geometry/core/topological_dimension.hpp + +# boost/geometry/formulas +include/boost/geometry/formulas/andoyer_inverse.hpp +include/boost/geometry/formulas/area_formulas.hpp +include/boost/geometry/formulas/differential_quantities.hpp +include/boost/geometry/formulas/flattening.hpp +include/boost/geometry/formulas/result_inverse.hpp +include/boost/geometry/formulas/sjoberg_intersection.hpp +include/boost/geometry/formulas/spherical.hpp +include/boost/geometry/formulas/thomas_inverse.hpp +include/boost/geometry/formulas/vertex_latitude.hpp +include/boost/geometry/formulas/vertex_longitude.hpp +include/boost/geometry/formulas/vincenty_inverse.hpp + +# boost/geometry/geometries +include/boost/geometry/geometries/box.hpp +include/boost/geometry/geometries/geometries.hpp +include/boost/geometry/geometries/helper_geometry.hpp +include/boost/geometry/geometries/linestring.hpp +include/boost/geometry/geometries/multi_linestring.hpp +include/boost/geometry/geometries/multi_point.hpp +include/boost/geometry/geometries/multi_polygon.hpp +include/boost/geometry/geometries/point.hpp +include/boost/geometry/geometries/point_xy.hpp +include/boost/geometry/geometries/pointing_segment.hpp +include/boost/geometry/geometries/polygon.hpp +include/boost/geometry/geometries/ring.hpp +include/boost/geometry/geometries/segment.hpp +include/boost/geometry/geometries/variant.hpp + +# boost/geometry/geometries/concepts +include/boost/geometry/geometries/concepts/box_concept.hpp +include/boost/geometry/geometries/concepts/check.hpp +include/boost/geometry/geometries/concepts/linestring_concept.hpp +include/boost/geometry/geometries/concepts/multi_linestring_concept.hpp +include/boost/geometry/geometries/concepts/multi_point_concept.hpp +include/boost/geometry/geometries/concepts/multi_polygon_concept.hpp +include/boost/geometry/geometries/concepts/point_concept.hpp +include/boost/geometry/geometries/concepts/polygon_concept.hpp +include/boost/geometry/geometries/concepts/ring_concept.hpp +include/boost/geometry/geometries/concepts/segment_concept.hpp + +# boost/geometry/geometries/register +include/boost/geometry/geometries/register/box.hpp +include/boost/geometry/geometries/register/point.hpp + +# boost/geometry/index +include/boost/geometry/index/distance_predicates.hpp +include/boost/geometry/index/equal_to.hpp +include/boost/geometry/index/indexable.hpp +include/boost/geometry/index/inserter.hpp +include/boost/geometry/index/parameters.hpp +include/boost/geometry/index/predicates.hpp +include/boost/geometry/index/rtree.hpp + +# boost/geometry/index/adaptors +include/boost/geometry/index/adaptors/query.hpp + +# boost/geometry/index/detail +include/boost/geometry/index/detail/assert.hpp +include/boost/geometry/index/detail/bounded_view.hpp +include/boost/geometry/index/detail/config_begin.hpp +include/boost/geometry/index/detail/config_end.hpp +include/boost/geometry/index/detail/distance_predicates.hpp +include/boost/geometry/index/detail/exception.hpp +include/boost/geometry/index/detail/is_bounding_geometry.hpp +include/boost/geometry/index/detail/is_indexable.hpp +include/boost/geometry/index/detail/meta.hpp +include/boost/geometry/index/detail/predicates.hpp +include/boost/geometry/index/detail/serialization.hpp +include/boost/geometry/index/detail/tags.hpp +include/boost/geometry/index/detail/translator.hpp +include/boost/geometry/index/detail/tuples.hpp +include/boost/geometry/index/detail/utilities.hpp +include/boost/geometry/index/detail/varray.hpp +include/boost/geometry/index/detail/varray_detail.hpp + +# boost/geometry/index/detail/algorithms +include/boost/geometry/index/detail/algorithms/bounds.hpp +include/boost/geometry/index/detail/algorithms/comparable_distance_centroid.hpp +include/boost/geometry/index/detail/algorithms/comparable_distance_far.hpp +include/boost/geometry/index/detail/algorithms/comparable_distance_near.hpp +include/boost/geometry/index/detail/algorithms/content.hpp +include/boost/geometry/index/detail/algorithms/diff_abs.hpp +include/boost/geometry/index/detail/algorithms/intersection_content.hpp +include/boost/geometry/index/detail/algorithms/is_valid.hpp +include/boost/geometry/index/detail/algorithms/margin.hpp +include/boost/geometry/index/detail/algorithms/nth_element.hpp +include/boost/geometry/index/detail/algorithms/path_intersection.hpp +include/boost/geometry/index/detail/algorithms/segment_intersection.hpp +include/boost/geometry/index/detail/algorithms/sum_for_indexable.hpp +include/boost/geometry/index/detail/algorithms/union_content.hpp + +# boost/geometry/index/detail/rtree +include/boost/geometry/index/detail/rtree/adaptors.hpp +include/boost/geometry/index/detail/rtree/iterators.hpp +include/boost/geometry/index/detail/rtree/options.hpp +include/boost/geometry/index/detail/rtree/pack_create.hpp +include/boost/geometry/index/detail/rtree/query_iterators.hpp + +# boost/geometry/index/detail/rtree/linear +include/boost/geometry/index/detail/rtree/linear/linear.hpp +include/boost/geometry/index/detail/rtree/linear/redistribute_elements.hpp + +# boost/geometry/index/detail/rtree/node +include/boost/geometry/index/detail/rtree/node/concept.hpp +include/boost/geometry/index/detail/rtree/node/node.hpp +include/boost/geometry/index/detail/rtree/node/node_elements.hpp +include/boost/geometry/index/detail/rtree/node/pairs.hpp +include/boost/geometry/index/detail/rtree/node/scoped_deallocator.hpp +include/boost/geometry/index/detail/rtree/node/subtree_destroyer.hpp +include/boost/geometry/index/detail/rtree/node/variant_dynamic.hpp +include/boost/geometry/index/detail/rtree/node/variant_static.hpp +include/boost/geometry/index/detail/rtree/node/variant_visitor.hpp + +# boost/geometry/index/detail/rtree/quadratic +include/boost/geometry/index/detail/rtree/quadratic/quadratic.hpp +include/boost/geometry/index/detail/rtree/quadratic/redistribute_elements.hpp + +# boost/geometry/index/detail/rtree/rstar +include/boost/geometry/index/detail/rtree/rstar/choose_next_node.hpp +include/boost/geometry/index/detail/rtree/rstar/insert.hpp +include/boost/geometry/index/detail/rtree/rstar/redistribute_elements.hpp +include/boost/geometry/index/detail/rtree/rstar/rstar.hpp + +# boost/geometry/index/detail/rtree/utilities +include/boost/geometry/index/detail/rtree/utilities/view.hpp + +# boost/geometry/index/detail/rtree/visitors +include/boost/geometry/index/detail/rtree/visitors/children_box.hpp +include/boost/geometry/index/detail/rtree/visitors/copy.hpp +include/boost/geometry/index/detail/rtree/visitors/count.hpp +include/boost/geometry/index/detail/rtree/visitors/destroy.hpp +include/boost/geometry/index/detail/rtree/visitors/distance_query.hpp +include/boost/geometry/index/detail/rtree/visitors/insert.hpp +include/boost/geometry/index/detail/rtree/visitors/is_leaf.hpp +include/boost/geometry/index/detail/rtree/visitors/iterator.hpp +include/boost/geometry/index/detail/rtree/visitors/remove.hpp +include/boost/geometry/index/detail/rtree/visitors/spatial_query.hpp + +# boost/geometry/io +include/boost/geometry/io/io.hpp + +# boost/geometry/io/dsv +include/boost/geometry/io/dsv/write.hpp + +# boost/geometry/io/svg +include/boost/geometry/io/svg/svg_mapper.hpp +include/boost/geometry/io/svg/write.hpp + +# boost/geometry/io/wkt +include/boost/geometry/io/wkt/read.hpp +include/boost/geometry/io/wkt/wkt.hpp +include/boost/geometry/io/wkt/write.hpp + +# boost/geometry/io/wkt/detail +include/boost/geometry/io/wkt/detail/prefix.hpp + +# boost/geometry/iterators +include/boost/geometry/iterators/base.hpp +include/boost/geometry/iterators/closing_iterator.hpp +include/boost/geometry/iterators/concatenate_iterator.hpp +include/boost/geometry/iterators/ever_circling_iterator.hpp +include/boost/geometry/iterators/flatten_iterator.hpp +include/boost/geometry/iterators/has_one_element.hpp +include/boost/geometry/iterators/point_iterator.hpp +include/boost/geometry/iterators/segment_iterator.hpp + +# boost/geometry/iterators/detail/point_iterator +include/boost/geometry/iterators/detail/point_iterator/inner_range_type.hpp +include/boost/geometry/iterators/detail/point_iterator/iterator_type.hpp +include/boost/geometry/iterators/detail/point_iterator/value_type.hpp + +# boost/geometry/iterators/detail/segment_iterator +include/boost/geometry/iterators/detail/segment_iterator/iterator_type.hpp +include/boost/geometry/iterators/detail/segment_iterator/range_segment_iterator.hpp +include/boost/geometry/iterators/detail/segment_iterator/value_type.hpp + +# boost/geometry/iterators/dispatch +include/boost/geometry/iterators/dispatch/point_iterator.hpp +include/boost/geometry/iterators/dispatch/segment_iterator.hpp + +# boost/geometry/multi/geometries +include/boost/geometry/multi/geometries/multi_polygon.hpp + +# boost/geometry/policies +include/boost/geometry/policies/compare.hpp +include/boost/geometry/policies/disjoint_interrupt_policy.hpp +include/boost/geometry/policies/predicate_based_interrupt_policy.hpp + +# boost/geometry/policies/is_valid +include/boost/geometry/policies/is_valid/default_policy.hpp +include/boost/geometry/policies/is_valid/failing_reason_policy.hpp +include/boost/geometry/policies/is_valid/failure_type_policy.hpp + +# boost/geometry/policies/relate +include/boost/geometry/policies/relate/direction.hpp +include/boost/geometry/policies/relate/intersection_points.hpp +include/boost/geometry/policies/relate/tupled.hpp + +# boost/geometry/policies/robustness +include/boost/geometry/policies/robustness/get_rescale_policy.hpp +include/boost/geometry/policies/robustness/no_rescale_policy.hpp +include/boost/geometry/policies/robustness/rescale_policy.hpp +include/boost/geometry/policies/robustness/robust_point_type.hpp +include/boost/geometry/policies/robustness/robust_type.hpp +include/boost/geometry/policies/robustness/segment_ratio.hpp +include/boost/geometry/policies/robustness/segment_ratio_type.hpp + +# boost/geometry/strategies +include/boost/geometry/strategies/area.hpp +include/boost/geometry/strategies/azimuth.hpp +include/boost/geometry/strategies/buffer.hpp +include/boost/geometry/strategies/centroid.hpp +include/boost/geometry/strategies/comparable_distance_result.hpp +include/boost/geometry/strategies/compare.hpp +include/boost/geometry/strategies/convex_hull.hpp +include/boost/geometry/strategies/covered_by.hpp +include/boost/geometry/strategies/default_area_result.hpp +include/boost/geometry/strategies/default_comparable_distance_result.hpp +include/boost/geometry/strategies/default_distance_result.hpp +include/boost/geometry/strategies/default_length_result.hpp +include/boost/geometry/strategies/default_strategy.hpp +include/boost/geometry/strategies/disjoint.hpp +include/boost/geometry/strategies/distance.hpp +include/boost/geometry/strategies/distance_result.hpp +include/boost/geometry/strategies/envelope.hpp +include/boost/geometry/strategies/intersection.hpp +include/boost/geometry/strategies/intersection_result.hpp +include/boost/geometry/strategies/intersection_strategies.hpp +include/boost/geometry/strategies/relate.hpp +include/boost/geometry/strategies/side.hpp +include/boost/geometry/strategies/side_info.hpp +include/boost/geometry/strategies/strategies.hpp +include/boost/geometry/strategies/strategy_transform.hpp +include/boost/geometry/strategies/tags.hpp +include/boost/geometry/strategies/transform.hpp +include/boost/geometry/strategies/within.hpp + +# boost/geometry/strategies/agnostic +include/boost/geometry/strategies/agnostic/buffer_distance_asymmetric.hpp +include/boost/geometry/strategies/agnostic/buffer_distance_symmetric.hpp +include/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp +include/boost/geometry/strategies/agnostic/point_in_box_by_side.hpp +include/boost/geometry/strategies/agnostic/point_in_point.hpp +include/boost/geometry/strategies/agnostic/point_in_poly_winding.hpp +include/boost/geometry/strategies/agnostic/simplify_douglas_peucker.hpp + +# boost/geometry/strategies/cartesian +include/boost/geometry/strategies/cartesian/area_surveyor.hpp +include/boost/geometry/strategies/cartesian/azimuth.hpp +include/boost/geometry/strategies/cartesian/box_in_box.hpp +include/boost/geometry/strategies/cartesian/buffer_end_flat.hpp +include/boost/geometry/strategies/cartesian/buffer_end_round.hpp +include/boost/geometry/strategies/cartesian/buffer_join_miter.hpp +include/boost/geometry/strategies/cartesian/buffer_join_round.hpp +include/boost/geometry/strategies/cartesian/buffer_join_round_by_divide.hpp +include/boost/geometry/strategies/cartesian/buffer_point_circle.hpp +include/boost/geometry/strategies/cartesian/buffer_point_square.hpp +include/boost/geometry/strategies/cartesian/buffer_side_straight.hpp +include/boost/geometry/strategies/cartesian/centroid_average.hpp +include/boost/geometry/strategies/cartesian/centroid_bashein_detmer.hpp +include/boost/geometry/strategies/cartesian/centroid_weighted_length.hpp +include/boost/geometry/strategies/cartesian/disjoint_segment_box.hpp +include/boost/geometry/strategies/cartesian/distance_projected_point.hpp +include/boost/geometry/strategies/cartesian/distance_projected_point_ax.hpp +include/boost/geometry/strategies/cartesian/distance_pythagoras.hpp +include/boost/geometry/strategies/cartesian/distance_pythagoras_box_box.hpp +include/boost/geometry/strategies/cartesian/distance_pythagoras_point_box.hpp +include/boost/geometry/strategies/cartesian/envelope_segment.hpp +include/boost/geometry/strategies/cartesian/intersection.hpp +include/boost/geometry/strategies/cartesian/point_in_box.hpp +include/boost/geometry/strategies/cartesian/point_in_poly_crossings_multiply.hpp +include/boost/geometry/strategies/cartesian/point_in_poly_franklin.hpp +include/boost/geometry/strategies/cartesian/side_by_triangle.hpp +include/boost/geometry/strategies/cartesian/side_of_intersection.hpp + +# boost/geometry/strategies/concepts +include/boost/geometry/strategies/concepts/area_concept.hpp +include/boost/geometry/strategies/concepts/centroid_concept.hpp +include/boost/geometry/strategies/concepts/convex_hull_concept.hpp +include/boost/geometry/strategies/concepts/distance_concept.hpp +include/boost/geometry/strategies/concepts/simplify_concept.hpp +include/boost/geometry/strategies/concepts/within_concept.hpp + +# boost/geometry/strategies/geographic +include/boost/geometry/strategies/geographic/area.hpp +include/boost/geometry/strategies/geographic/azimuth.hpp +include/boost/geometry/strategies/geographic/disjoint_segment_box.hpp +include/boost/geometry/strategies/geographic/distance.hpp +include/boost/geometry/strategies/geographic/distance_andoyer.hpp +include/boost/geometry/strategies/geographic/distance_thomas.hpp +include/boost/geometry/strategies/geographic/distance_vincenty.hpp +include/boost/geometry/strategies/geographic/envelope_segment.hpp +include/boost/geometry/strategies/geographic/intersection.hpp +include/boost/geometry/strategies/geographic/parameters.hpp +include/boost/geometry/strategies/geographic/side.hpp +include/boost/geometry/strategies/geographic/side_andoyer.hpp +include/boost/geometry/strategies/geographic/side_thomas.hpp +include/boost/geometry/strategies/geographic/side_vincenty.hpp + +# boost/geometry/strategies/spherical +include/boost/geometry/strategies/spherical/area.hpp +include/boost/geometry/strategies/spherical/azimuth.hpp +include/boost/geometry/strategies/spherical/compare_circular.hpp +include/boost/geometry/strategies/spherical/disjoint_segment_box.hpp +include/boost/geometry/strategies/spherical/distance_cross_track.hpp +include/boost/geometry/strategies/spherical/distance_cross_track_point_box.hpp +include/boost/geometry/strategies/spherical/distance_haversine.hpp +include/boost/geometry/strategies/spherical/envelope_segment.hpp +include/boost/geometry/strategies/spherical/intersection.hpp +include/boost/geometry/strategies/spherical/ssf.hpp + +# boost/geometry/strategies/transform +include/boost/geometry/strategies/transform/inverse_transformer.hpp +include/boost/geometry/strategies/transform/map_transformer.hpp +include/boost/geometry/strategies/transform/matrix_transformers.hpp + +# boost/geometry/util +include/boost/geometry/util/add_const_if_c.hpp +include/boost/geometry/util/bare_type.hpp +include/boost/geometry/util/calculation_type.hpp +include/boost/geometry/util/combine_if.hpp +include/boost/geometry/util/compress_variant.hpp +include/boost/geometry/util/condition.hpp +include/boost/geometry/util/coordinate_cast.hpp +include/boost/geometry/util/for_each_coordinate.hpp +include/boost/geometry/util/has_nan_coordinate.hpp +include/boost/geometry/util/has_non_finite_coordinate.hpp +include/boost/geometry/util/math.hpp +include/boost/geometry/util/normalize_spheroidal_box_coordinates.hpp +include/boost/geometry/util/normalize_spheroidal_coordinates.hpp +include/boost/geometry/util/order_as_direction.hpp +include/boost/geometry/util/parameter_type_of.hpp +include/boost/geometry/util/promote_floating_point.hpp +include/boost/geometry/util/promote_integral.hpp +include/boost/geometry/util/range.hpp +include/boost/geometry/util/select_calculation_type.hpp +include/boost/geometry/util/select_coordinate_type.hpp +include/boost/geometry/util/select_most_precise.hpp +include/boost/geometry/util/transform_variant.hpp + +# boost/geometry/views +include/boost/geometry/views/box_view.hpp +include/boost/geometry/views/closeable_view.hpp +include/boost/geometry/views/identity_view.hpp +include/boost/geometry/views/reversible_view.hpp +include/boost/geometry/views/segment_view.hpp + +# boost/geometry/views/detail +include/boost/geometry/views/detail/boundary_view.hpp +include/boost/geometry/views/detail/indexed_point_view.hpp +include/boost/geometry/views/detail/normalized_view.hpp +include/boost/geometry/views/detail/points_view.hpp +include/boost/geometry/views/detail/range_type.hpp +include/boost/geometry/views/detail/two_dimensional_view.hpp + +# boost/geometry/views/detail/boundary_view +include/boost/geometry/views/detail/boundary_view/implementation.hpp +include/boost/geometry/views/detail/boundary_view/interface.hpp + +# boost/heap +include/boost/heap/fibonacci_heap.hpp +include/boost/heap/heap_concepts.hpp +include/boost/heap/heap_merge.hpp +include/boost/heap/policies.hpp + +# boost/heap/detail +include/boost/heap/detail/heap_comparison.hpp +include/boost/heap/detail/heap_node.hpp +include/boost/heap/detail/stable_heap.hpp +include/boost/heap/detail/tree_iterator.hpp + +# boost/integer +include/boost/integer/common_factor_ct.hpp +include/boost/integer/common_factor_rt.hpp +include/boost/integer/static_log2.hpp +include/boost/integer/static_min_max.hpp + +# boost/intrusive +include/boost/intrusive/circular_list_algorithms.hpp +include/boost/intrusive/intrusive_fwd.hpp +include/boost/intrusive/link_mode.hpp +include/boost/intrusive/list.hpp +include/boost/intrusive/list_hook.hpp +include/boost/intrusive/options.hpp +include/boost/intrusive/pack_options.hpp +include/boost/intrusive/pointer_rebind.hpp +include/boost/intrusive/pointer_traits.hpp + +# boost/intrusive/detail +include/boost/intrusive/detail/algo_type.hpp +include/boost/intrusive/detail/algorithm.hpp +include/boost/intrusive/detail/array_initializer.hpp +include/boost/intrusive/detail/assert.hpp +include/boost/intrusive/detail/config_begin.hpp +include/boost/intrusive/detail/config_end.hpp +include/boost/intrusive/detail/default_header_holder.hpp +include/boost/intrusive/detail/ebo_functor_holder.hpp +include/boost/intrusive/detail/equal_to_value.hpp +include/boost/intrusive/detail/exception_disposer.hpp +include/boost/intrusive/detail/function_detector.hpp +include/boost/intrusive/detail/generic_hook.hpp +include/boost/intrusive/detail/get_value_traits.hpp +include/boost/intrusive/detail/has_member_function_callable_with.hpp +include/boost/intrusive/detail/hook_traits.hpp +include/boost/intrusive/detail/iiterator.hpp +include/boost/intrusive/detail/is_stateful_value_traits.hpp +include/boost/intrusive/detail/iterator.hpp +include/boost/intrusive/detail/key_nodeptr_comp.hpp +include/boost/intrusive/detail/list_iterator.hpp +include/boost/intrusive/detail/list_node.hpp +include/boost/intrusive/detail/minimal_less_equal_header.hpp +include/boost/intrusive/detail/mpl.hpp +include/boost/intrusive/detail/node_holder.hpp +include/boost/intrusive/detail/parent_from_member.hpp +include/boost/intrusive/detail/reverse_iterator.hpp +include/boost/intrusive/detail/simple_disposers.hpp +include/boost/intrusive/detail/size_holder.hpp +include/boost/intrusive/detail/std_fwd.hpp +include/boost/intrusive/detail/tree_value_compare.hpp +include/boost/intrusive/detail/uncast.hpp +include/boost/intrusive/detail/workaround.hpp + +# boost/io +include/boost/io/ios_state.hpp + +# boost/io/detail +include/boost/io/detail/quoted_manip.hpp + +# boost/iostreams +include/boost/iostreams/categories.hpp +include/boost/iostreams/chain.hpp +include/boost/iostreams/char_traits.hpp +include/boost/iostreams/checked_operations.hpp +include/boost/iostreams/close.hpp +include/boost/iostreams/concepts.hpp +include/boost/iostreams/constants.hpp +include/boost/iostreams/copy.hpp +include/boost/iostreams/filtering_stream.hpp +include/boost/iostreams/filtering_streambuf.hpp +include/boost/iostreams/flush.hpp +include/boost/iostreams/get.hpp +include/boost/iostreams/imbue.hpp +include/boost/iostreams/input_sequence.hpp +include/boost/iostreams/operations.hpp +include/boost/iostreams/operations_fwd.hpp +include/boost/iostreams/optimal_buffer_size.hpp +include/boost/iostreams/output_sequence.hpp +include/boost/iostreams/pipeline.hpp +include/boost/iostreams/positioning.hpp +include/boost/iostreams/put.hpp +include/boost/iostreams/putback.hpp +include/boost/iostreams/read.hpp +include/boost/iostreams/seek.hpp +include/boost/iostreams/stream.hpp +include/boost/iostreams/stream_buffer.hpp +include/boost/iostreams/traits.hpp +include/boost/iostreams/traits_fwd.hpp +include/boost/iostreams/write.hpp + +# boost/iostreams/detail +include/boost/iostreams/detail/access_control.hpp +include/boost/iostreams/detail/bool_trait_def.hpp +include/boost/iostreams/detail/buffer.hpp +include/boost/iostreams/detail/call_traits.hpp +include/boost/iostreams/detail/char_traits.hpp +include/boost/iostreams/detail/default_arg.hpp +include/boost/iostreams/detail/dispatch.hpp +include/boost/iostreams/detail/double_object.hpp +include/boost/iostreams/detail/enable_if_stream.hpp +include/boost/iostreams/detail/error.hpp +include/boost/iostreams/detail/execute.hpp +include/boost/iostreams/detail/forward.hpp +include/boost/iostreams/detail/functional.hpp +include/boost/iostreams/detail/ios.hpp +include/boost/iostreams/detail/iostream.hpp +include/boost/iostreams/detail/is_dereferenceable.hpp +include/boost/iostreams/detail/is_iterator_range.hpp +include/boost/iostreams/detail/optional.hpp +include/boost/iostreams/detail/push.hpp +include/boost/iostreams/detail/push_params.hpp +include/boost/iostreams/detail/resolve.hpp +include/boost/iostreams/detail/select.hpp +include/boost/iostreams/detail/select_by_size.hpp +include/boost/iostreams/detail/streambuf.hpp +include/boost/iostreams/detail/template_params.hpp +include/boost/iostreams/detail/translate_int_type.hpp +include/boost/iostreams/detail/wrap_unwrap.hpp + +# boost/iostreams/detail/adapter +include/boost/iostreams/detail/adapter/concept_adapter.hpp +include/boost/iostreams/detail/adapter/mode_adapter.hpp +include/boost/iostreams/detail/adapter/non_blocking_adapter.hpp +include/boost/iostreams/detail/adapter/output_iterator_adapter.hpp +include/boost/iostreams/detail/adapter/range_adapter.hpp + +# boost/iostreams/detail/broken_overload_resolution +include/boost/iostreams/detail/broken_overload_resolution/forward.hpp +include/boost/iostreams/detail/broken_overload_resolution/stream.hpp +include/boost/iostreams/detail/broken_overload_resolution/stream_buffer.hpp + +# boost/iostreams/detail/config +include/boost/iostreams/detail/config/auto_link.hpp +include/boost/iostreams/detail/config/codecvt.hpp +include/boost/iostreams/detail/config/disable_warnings.hpp +include/boost/iostreams/detail/config/dyn_link.hpp +include/boost/iostreams/detail/config/enable_warnings.hpp +include/boost/iostreams/detail/config/fpos.hpp +include/boost/iostreams/detail/config/gcc.hpp +include/boost/iostreams/detail/config/limits.hpp +include/boost/iostreams/detail/config/overload_resolution.hpp +include/boost/iostreams/detail/config/unreachable_return.hpp +include/boost/iostreams/detail/config/wide_streams.hpp +include/boost/iostreams/detail/config/zlib.hpp + +# boost/iostreams/detail/streambuf +include/boost/iostreams/detail/streambuf/chainbuf.hpp +include/boost/iostreams/detail/streambuf/direct_streambuf.hpp +include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp +include/boost/iostreams/detail/streambuf/linked_streambuf.hpp + +# boost/iostreams/device +include/boost/iostreams/device/array.hpp +include/boost/iostreams/device/back_inserter.hpp +include/boost/iostreams/device/null.hpp + +# boost/iostreams/filter +include/boost/iostreams/filter/gzip.hpp +include/boost/iostreams/filter/symmetric.hpp +include/boost/iostreams/filter/zlib.hpp + +# boost/iterator +include/boost/iterator/advance.hpp +include/boost/iterator/filter_iterator.hpp +include/boost/iterator/interoperable.hpp +include/boost/iterator/iterator_adaptor.hpp +include/boost/iterator/iterator_categories.hpp +include/boost/iterator/iterator_concepts.hpp +include/boost/iterator/iterator_facade.hpp +include/boost/iterator/iterator_traits.hpp +include/boost/iterator/minimum_category.hpp +include/boost/iterator/reverse_iterator.hpp +include/boost/iterator/transform_iterator.hpp + +# boost/iterator/detail +include/boost/iterator/detail/config_def.hpp +include/boost/iterator/detail/config_undef.hpp +include/boost/iterator/detail/enable_if.hpp +include/boost/iterator/detail/facade_iterator_category.hpp + +# boost/lexical_cast +include/boost/lexical_cast/bad_lexical_cast.hpp +include/boost/lexical_cast/try_lexical_convert.hpp + +# boost/lexical_cast/detail +include/boost/lexical_cast/detail/converter_lexical.hpp +include/boost/lexical_cast/detail/converter_lexical_streams.hpp +include/boost/lexical_cast/detail/converter_numeric.hpp +include/boost/lexical_cast/detail/inf_nan.hpp +include/boost/lexical_cast/detail/is_character.hpp +include/boost/lexical_cast/detail/lcast_char_constants.hpp +include/boost/lexical_cast/detail/lcast_unsigned_converters.hpp +include/boost/lexical_cast/detail/widest_char.hpp + +# boost/locale +include/boost/locale/definitions.hpp +include/boost/locale/encoding_errors.hpp +include/boost/locale/encoding_utf.hpp +include/boost/locale/utf.hpp + +# boost/math +include/boost/math/common_factor_ct.hpp +include/boost/math/common_factor_rt.hpp + +# boost/math/constants +include/boost/math/constants/calculate_constants.hpp +include/boost/math/constants/constants.hpp + +# boost/math/policies +include/boost/math/policies/error_handling.hpp +include/boost/math/policies/policy.hpp + +# boost/math/special_functions +include/boost/math/special_functions/atanh.hpp +include/boost/math/special_functions/fpclassify.hpp +include/boost/math/special_functions/hypot.hpp +include/boost/math/special_functions/log1p.hpp +include/boost/math/special_functions/math_fwd.hpp +include/boost/math/special_functions/next.hpp +include/boost/math/special_functions/sign.hpp +include/boost/math/special_functions/trunc.hpp + +# boost/math/special_functions/detail +include/boost/math/special_functions/detail/fp_traits.hpp +include/boost/math/special_functions/detail/round_fwd.hpp + +# boost/math/tools +include/boost/math/tools/big_constant.hpp +include/boost/math/tools/config.hpp +include/boost/math/tools/convert_from_string.hpp +include/boost/math/tools/precision.hpp +include/boost/math/tools/promotion.hpp +include/boost/math/tools/rational.hpp +include/boost/math/tools/real_cast.hpp +include/boost/math/tools/series.hpp +include/boost/math/tools/user.hpp + +# boost/math/tools/detail +include/boost/math/tools/detail/polynomial_horner1_10.hpp +include/boost/math/tools/detail/polynomial_horner1_11.hpp +include/boost/math/tools/detail/polynomial_horner1_12.hpp +include/boost/math/tools/detail/polynomial_horner1_13.hpp +include/boost/math/tools/detail/polynomial_horner1_14.hpp +include/boost/math/tools/detail/polynomial_horner1_15.hpp +include/boost/math/tools/detail/polynomial_horner1_16.hpp +include/boost/math/tools/detail/polynomial_horner1_17.hpp +include/boost/math/tools/detail/polynomial_horner1_18.hpp +include/boost/math/tools/detail/polynomial_horner1_19.hpp +include/boost/math/tools/detail/polynomial_horner1_2.hpp +include/boost/math/tools/detail/polynomial_horner1_20.hpp +include/boost/math/tools/detail/polynomial_horner1_3.hpp +include/boost/math/tools/detail/polynomial_horner1_4.hpp +include/boost/math/tools/detail/polynomial_horner1_5.hpp +include/boost/math/tools/detail/polynomial_horner1_6.hpp +include/boost/math/tools/detail/polynomial_horner1_7.hpp +include/boost/math/tools/detail/polynomial_horner1_8.hpp +include/boost/math/tools/detail/polynomial_horner1_9.hpp +include/boost/math/tools/detail/polynomial_horner2_10.hpp +include/boost/math/tools/detail/polynomial_horner2_11.hpp +include/boost/math/tools/detail/polynomial_horner2_12.hpp +include/boost/math/tools/detail/polynomial_horner2_13.hpp +include/boost/math/tools/detail/polynomial_horner2_14.hpp +include/boost/math/tools/detail/polynomial_horner2_15.hpp +include/boost/math/tools/detail/polynomial_horner2_16.hpp +include/boost/math/tools/detail/polynomial_horner2_17.hpp +include/boost/math/tools/detail/polynomial_horner2_18.hpp +include/boost/math/tools/detail/polynomial_horner2_19.hpp +include/boost/math/tools/detail/polynomial_horner2_2.hpp +include/boost/math/tools/detail/polynomial_horner2_20.hpp +include/boost/math/tools/detail/polynomial_horner2_3.hpp +include/boost/math/tools/detail/polynomial_horner2_4.hpp +include/boost/math/tools/detail/polynomial_horner2_5.hpp +include/boost/math/tools/detail/polynomial_horner2_6.hpp +include/boost/math/tools/detail/polynomial_horner2_7.hpp +include/boost/math/tools/detail/polynomial_horner2_8.hpp +include/boost/math/tools/detail/polynomial_horner2_9.hpp +include/boost/math/tools/detail/polynomial_horner3_10.hpp +include/boost/math/tools/detail/polynomial_horner3_11.hpp +include/boost/math/tools/detail/polynomial_horner3_12.hpp +include/boost/math/tools/detail/polynomial_horner3_13.hpp +include/boost/math/tools/detail/polynomial_horner3_14.hpp +include/boost/math/tools/detail/polynomial_horner3_15.hpp +include/boost/math/tools/detail/polynomial_horner3_16.hpp +include/boost/math/tools/detail/polynomial_horner3_17.hpp +include/boost/math/tools/detail/polynomial_horner3_18.hpp +include/boost/math/tools/detail/polynomial_horner3_19.hpp +include/boost/math/tools/detail/polynomial_horner3_2.hpp +include/boost/math/tools/detail/polynomial_horner3_20.hpp +include/boost/math/tools/detail/polynomial_horner3_3.hpp +include/boost/math/tools/detail/polynomial_horner3_4.hpp +include/boost/math/tools/detail/polynomial_horner3_5.hpp +include/boost/math/tools/detail/polynomial_horner3_6.hpp +include/boost/math/tools/detail/polynomial_horner3_7.hpp +include/boost/math/tools/detail/polynomial_horner3_8.hpp +include/boost/math/tools/detail/polynomial_horner3_9.hpp +include/boost/math/tools/detail/rational_horner1_10.hpp +include/boost/math/tools/detail/rational_horner1_11.hpp +include/boost/math/tools/detail/rational_horner1_12.hpp +include/boost/math/tools/detail/rational_horner1_13.hpp +include/boost/math/tools/detail/rational_horner1_14.hpp +include/boost/math/tools/detail/rational_horner1_15.hpp +include/boost/math/tools/detail/rational_horner1_16.hpp +include/boost/math/tools/detail/rational_horner1_17.hpp +include/boost/math/tools/detail/rational_horner1_18.hpp +include/boost/math/tools/detail/rational_horner1_19.hpp +include/boost/math/tools/detail/rational_horner1_2.hpp +include/boost/math/tools/detail/rational_horner1_20.hpp +include/boost/math/tools/detail/rational_horner1_3.hpp +include/boost/math/tools/detail/rational_horner1_4.hpp +include/boost/math/tools/detail/rational_horner1_5.hpp +include/boost/math/tools/detail/rational_horner1_6.hpp +include/boost/math/tools/detail/rational_horner1_7.hpp +include/boost/math/tools/detail/rational_horner1_8.hpp +include/boost/math/tools/detail/rational_horner1_9.hpp +include/boost/math/tools/detail/rational_horner2_10.hpp +include/boost/math/tools/detail/rational_horner2_11.hpp +include/boost/math/tools/detail/rational_horner2_12.hpp +include/boost/math/tools/detail/rational_horner2_13.hpp +include/boost/math/tools/detail/rational_horner2_14.hpp +include/boost/math/tools/detail/rational_horner2_15.hpp +include/boost/math/tools/detail/rational_horner2_16.hpp +include/boost/math/tools/detail/rational_horner2_17.hpp +include/boost/math/tools/detail/rational_horner2_18.hpp +include/boost/math/tools/detail/rational_horner2_19.hpp +include/boost/math/tools/detail/rational_horner2_2.hpp +include/boost/math/tools/detail/rational_horner2_20.hpp +include/boost/math/tools/detail/rational_horner2_3.hpp +include/boost/math/tools/detail/rational_horner2_4.hpp +include/boost/math/tools/detail/rational_horner2_5.hpp +include/boost/math/tools/detail/rational_horner2_6.hpp +include/boost/math/tools/detail/rational_horner2_7.hpp +include/boost/math/tools/detail/rational_horner2_8.hpp +include/boost/math/tools/detail/rational_horner2_9.hpp +include/boost/math/tools/detail/rational_horner3_10.hpp +include/boost/math/tools/detail/rational_horner3_11.hpp +include/boost/math/tools/detail/rational_horner3_12.hpp +include/boost/math/tools/detail/rational_horner3_13.hpp +include/boost/math/tools/detail/rational_horner3_14.hpp +include/boost/math/tools/detail/rational_horner3_15.hpp +include/boost/math/tools/detail/rational_horner3_16.hpp +include/boost/math/tools/detail/rational_horner3_17.hpp +include/boost/math/tools/detail/rational_horner3_18.hpp +include/boost/math/tools/detail/rational_horner3_19.hpp +include/boost/math/tools/detail/rational_horner3_2.hpp +include/boost/math/tools/detail/rational_horner3_20.hpp +include/boost/math/tools/detail/rational_horner3_3.hpp +include/boost/math/tools/detail/rational_horner3_4.hpp +include/boost/math/tools/detail/rational_horner3_5.hpp +include/boost/math/tools/detail/rational_horner3_6.hpp +include/boost/math/tools/detail/rational_horner3_7.hpp +include/boost/math/tools/detail/rational_horner3_8.hpp +include/boost/math/tools/detail/rational_horner3_9.hpp + +# boost/move +include/boost/move/adl_move_swap.hpp +include/boost/move/algorithm.hpp +include/boost/move/core.hpp +include/boost/move/iterator.hpp +include/boost/move/move.hpp +include/boost/move/traits.hpp +include/boost/move/utility.hpp +include/boost/move/utility_core.hpp + +# boost/move/algo +include/boost/move/algo/adaptive_merge.hpp +include/boost/move/algo/move.hpp +include/boost/move/algo/predicate.hpp +include/boost/move/algo/unique.hpp + +# boost/move/algo/detail +include/boost/move/algo/detail/adaptive_sort_merge.hpp +include/boost/move/algo/detail/basic_op.hpp +include/boost/move/algo/detail/insertion_sort.hpp +include/boost/move/algo/detail/merge.hpp +include/boost/move/algo/detail/merge_sort.hpp + +# boost/move/detail +include/boost/move/detail/config_begin.hpp +include/boost/move/detail/config_end.hpp +include/boost/move/detail/destruct_n.hpp +include/boost/move/detail/fwd_macros.hpp +include/boost/move/detail/iterator_to_raw_pointer.hpp +include/boost/move/detail/iterator_traits.hpp +include/boost/move/detail/meta_utils.hpp +include/boost/move/detail/meta_utils_core.hpp +include/boost/move/detail/move_helpers.hpp +include/boost/move/detail/placement_new.hpp +include/boost/move/detail/pointer_element.hpp +include/boost/move/detail/reverse_iterator.hpp +include/boost/move/detail/std_ns_begin.hpp +include/boost/move/detail/std_ns_end.hpp +include/boost/move/detail/to_raw_pointer.hpp +include/boost/move/detail/type_traits.hpp +include/boost/move/detail/workaround.hpp + +# boost/mpl +include/boost/mpl/O1_size.hpp +include/boost/mpl/O1_size_fwd.hpp +include/boost/mpl/advance.hpp +include/boost/mpl/advance_fwd.hpp +include/boost/mpl/always.hpp +include/boost/mpl/and.hpp +include/boost/mpl/apply.hpp +include/boost/mpl/apply_fwd.hpp +include/boost/mpl/apply_wrap.hpp +include/boost/mpl/arg.hpp +include/boost/mpl/arg_fwd.hpp +include/boost/mpl/assert.hpp +include/boost/mpl/at.hpp +include/boost/mpl/at_fwd.hpp +include/boost/mpl/back.hpp +include/boost/mpl/back_fwd.hpp +include/boost/mpl/back_inserter.hpp +include/boost/mpl/base.hpp +include/boost/mpl/begin.hpp +include/boost/mpl/begin_end.hpp +include/boost/mpl/begin_end_fwd.hpp +include/boost/mpl/bind.hpp +include/boost/mpl/bind_fwd.hpp +include/boost/mpl/bitand.hpp +include/boost/mpl/bitxor.hpp +include/boost/mpl/bool.hpp +include/boost/mpl/bool_fwd.hpp +include/boost/mpl/clear.hpp +include/boost/mpl/clear_fwd.hpp +include/boost/mpl/comparison.hpp +include/boost/mpl/contains.hpp +include/boost/mpl/contains_fwd.hpp +include/boost/mpl/copy.hpp +include/boost/mpl/deref.hpp +include/boost/mpl/distance.hpp +include/boost/mpl/distance_fwd.hpp +include/boost/mpl/empty.hpp +include/boost/mpl/empty_base.hpp +include/boost/mpl/empty_fwd.hpp +include/boost/mpl/end.hpp +include/boost/mpl/equal.hpp +include/boost/mpl/equal_to.hpp +include/boost/mpl/erase.hpp +include/boost/mpl/erase_fwd.hpp +include/boost/mpl/erase_key.hpp +include/boost/mpl/erase_key_fwd.hpp +include/boost/mpl/eval_if.hpp +include/boost/mpl/find.hpp +include/boost/mpl/find_if.hpp +include/boost/mpl/fold.hpp +include/boost/mpl/for_each.hpp +include/boost/mpl/front.hpp +include/boost/mpl/front_fwd.hpp +include/boost/mpl/front_inserter.hpp +include/boost/mpl/greater.hpp +include/boost/mpl/greater_equal.hpp +include/boost/mpl/has_key.hpp +include/boost/mpl/has_key_fwd.hpp +include/boost/mpl/has_xxx.hpp +include/boost/mpl/identity.hpp +include/boost/mpl/if.hpp +include/boost/mpl/inherit.hpp +include/boost/mpl/insert.hpp +include/boost/mpl/insert_fwd.hpp +include/boost/mpl/insert_range.hpp +include/boost/mpl/insert_range_fwd.hpp +include/boost/mpl/inserter.hpp +include/boost/mpl/int.hpp +include/boost/mpl/int_fwd.hpp +include/boost/mpl/integral_c.hpp +include/boost/mpl/integral_c_fwd.hpp +include/boost/mpl/integral_c_tag.hpp +include/boost/mpl/is_placeholder.hpp +include/boost/mpl/is_sequence.hpp +include/boost/mpl/iter_fold.hpp +include/boost/mpl/iter_fold_if.hpp +include/boost/mpl/iterator_category.hpp +include/boost/mpl/iterator_range.hpp +include/boost/mpl/iterator_tags.hpp +include/boost/mpl/joint_view.hpp +include/boost/mpl/key_type_fwd.hpp +include/boost/mpl/lambda.hpp +include/boost/mpl/lambda_fwd.hpp +include/boost/mpl/less.hpp +include/boost/mpl/less_equal.hpp +include/boost/mpl/list.hpp +include/boost/mpl/logical.hpp +include/boost/mpl/long.hpp +include/boost/mpl/long_fwd.hpp +include/boost/mpl/map.hpp +include/boost/mpl/max.hpp +include/boost/mpl/max_element.hpp +include/boost/mpl/min.hpp +include/boost/mpl/min_max.hpp +include/boost/mpl/minus.hpp +include/boost/mpl/multiplies.hpp +include/boost/mpl/negate.hpp +include/boost/mpl/next.hpp +include/boost/mpl/next_prior.hpp +include/boost/mpl/not.hpp +include/boost/mpl/not_equal_to.hpp +include/boost/mpl/numeric_cast.hpp +include/boost/mpl/or.hpp +include/boost/mpl/order_fwd.hpp +include/boost/mpl/pair.hpp +include/boost/mpl/pair_view.hpp +include/boost/mpl/placeholders.hpp +include/boost/mpl/plus.hpp +include/boost/mpl/pop_back.hpp +include/boost/mpl/pop_back_fwd.hpp +include/boost/mpl/pop_front.hpp +include/boost/mpl/pop_front_fwd.hpp +include/boost/mpl/prior.hpp +include/boost/mpl/protect.hpp +include/boost/mpl/push_back.hpp +include/boost/mpl/push_back_fwd.hpp +include/boost/mpl/push_front.hpp +include/boost/mpl/push_front_fwd.hpp +include/boost/mpl/quote.hpp +include/boost/mpl/remove.hpp +include/boost/mpl/remove_if.hpp +include/boost/mpl/reverse_fold.hpp +include/boost/mpl/reverse_iter_fold.hpp +include/boost/mpl/same_as.hpp +include/boost/mpl/sequence_tag.hpp +include/boost/mpl/sequence_tag_fwd.hpp +include/boost/mpl/set.hpp +include/boost/mpl/single_view.hpp +include/boost/mpl/size.hpp +include/boost/mpl/size_fwd.hpp +include/boost/mpl/size_t.hpp +include/boost/mpl/size_t_fwd.hpp +include/boost/mpl/sizeof.hpp +include/boost/mpl/tag.hpp +include/boost/mpl/times.hpp +include/boost/mpl/transform.hpp +include/boost/mpl/transform_view.hpp +include/boost/mpl/unpack_args.hpp +include/boost/mpl/value_type_fwd.hpp +include/boost/mpl/vector.hpp +include/boost/mpl/vector_c.hpp +include/boost/mpl/void.hpp +include/boost/mpl/void_fwd.hpp +include/boost/mpl/zip_view.hpp + +# boost/mpl/aux_ +include/boost/mpl/aux_/O1_size_impl.hpp +include/boost/mpl/aux_/adl_barrier.hpp +include/boost/mpl/aux_/advance_backward.hpp +include/boost/mpl/aux_/advance_forward.hpp +include/boost/mpl/aux_/arg_typedef.hpp +include/boost/mpl/aux_/arithmetic_op.hpp +include/boost/mpl/aux_/arity.hpp +include/boost/mpl/aux_/arity_spec.hpp +include/boost/mpl/aux_/at_impl.hpp +include/boost/mpl/aux_/back_impl.hpp +include/boost/mpl/aux_/begin_end_impl.hpp +include/boost/mpl/aux_/clear_impl.hpp +include/boost/mpl/aux_/common_name_wknd.hpp +include/boost/mpl/aux_/comparison_op.hpp +include/boost/mpl/aux_/contains_impl.hpp +include/boost/mpl/aux_/count_args.hpp +include/boost/mpl/aux_/empty_impl.hpp +include/boost/mpl/aux_/erase_impl.hpp +include/boost/mpl/aux_/erase_key_impl.hpp +include/boost/mpl/aux_/find_if_pred.hpp +include/boost/mpl/aux_/fold_impl.hpp +include/boost/mpl/aux_/fold_impl_body.hpp +include/boost/mpl/aux_/front_impl.hpp +include/boost/mpl/aux_/full_lambda.hpp +include/boost/mpl/aux_/has_apply.hpp +include/boost/mpl/aux_/has_begin.hpp +include/boost/mpl/aux_/has_key_impl.hpp +include/boost/mpl/aux_/has_rebind.hpp +include/boost/mpl/aux_/has_size.hpp +include/boost/mpl/aux_/has_tag.hpp +include/boost/mpl/aux_/has_type.hpp +include/boost/mpl/aux_/include_preprocessed.hpp +include/boost/mpl/aux_/insert_impl.hpp +include/boost/mpl/aux_/insert_range_impl.hpp +include/boost/mpl/aux_/inserter_algorithm.hpp +include/boost/mpl/aux_/integral_wrapper.hpp +include/boost/mpl/aux_/is_msvc_eti_arg.hpp +include/boost/mpl/aux_/iter_apply.hpp +include/boost/mpl/aux_/iter_fold_if_impl.hpp +include/boost/mpl/aux_/iter_fold_impl.hpp +include/boost/mpl/aux_/iter_push_front.hpp +include/boost/mpl/aux_/joint_iter.hpp +include/boost/mpl/aux_/lambda_arity_param.hpp +include/boost/mpl/aux_/lambda_no_ctps.hpp +include/boost/mpl/aux_/lambda_spec.hpp +include/boost/mpl/aux_/lambda_support.hpp +include/boost/mpl/aux_/largest_int.hpp +include/boost/mpl/aux_/logical_op.hpp +include/boost/mpl/aux_/msvc_dtw.hpp +include/boost/mpl/aux_/msvc_eti_base.hpp +include/boost/mpl/aux_/msvc_is_class.hpp +include/boost/mpl/aux_/msvc_never_true.hpp +include/boost/mpl/aux_/msvc_type.hpp +include/boost/mpl/aux_/na.hpp +include/boost/mpl/aux_/na_assert.hpp +include/boost/mpl/aux_/na_fwd.hpp +include/boost/mpl/aux_/na_spec.hpp +include/boost/mpl/aux_/nested_type_wknd.hpp +include/boost/mpl/aux_/nttp_decl.hpp +include/boost/mpl/aux_/numeric_cast_utils.hpp +include/boost/mpl/aux_/numeric_op.hpp +include/boost/mpl/aux_/order_impl.hpp +include/boost/mpl/aux_/overload_names.hpp +include/boost/mpl/aux_/pop_back_impl.hpp +include/boost/mpl/aux_/pop_front_impl.hpp +include/boost/mpl/aux_/ptr_to_ref.hpp +include/boost/mpl/aux_/push_back_impl.hpp +include/boost/mpl/aux_/push_front_impl.hpp +include/boost/mpl/aux_/reverse_fold_impl.hpp +include/boost/mpl/aux_/reverse_fold_impl_body.hpp +include/boost/mpl/aux_/reverse_iter_fold_impl.hpp +include/boost/mpl/aux_/sequence_wrapper.hpp +include/boost/mpl/aux_/single_element_iter.hpp +include/boost/mpl/aux_/size_impl.hpp +include/boost/mpl/aux_/static_cast.hpp +include/boost/mpl/aux_/template_arity.hpp +include/boost/mpl/aux_/template_arity_fwd.hpp +include/boost/mpl/aux_/traits_lambda_spec.hpp +include/boost/mpl/aux_/transform_iter.hpp +include/boost/mpl/aux_/type_wrapper.hpp +include/boost/mpl/aux_/unwrap.hpp +include/boost/mpl/aux_/value_wknd.hpp +include/boost/mpl/aux_/yes_no.hpp + +# boost/mpl/aux_/config +include/boost/mpl/aux_/config/adl.hpp +include/boost/mpl/aux_/config/arrays.hpp +include/boost/mpl/aux_/config/bcc.hpp +include/boost/mpl/aux_/config/bind.hpp +include/boost/mpl/aux_/config/compiler.hpp +include/boost/mpl/aux_/config/ctps.hpp +include/boost/mpl/aux_/config/dmc_ambiguous_ctps.hpp +include/boost/mpl/aux_/config/dtp.hpp +include/boost/mpl/aux_/config/eti.hpp +include/boost/mpl/aux_/config/forwarding.hpp +include/boost/mpl/aux_/config/gcc.hpp +include/boost/mpl/aux_/config/gpu.hpp +include/boost/mpl/aux_/config/has_apply.hpp +include/boost/mpl/aux_/config/has_xxx.hpp +include/boost/mpl/aux_/config/integral.hpp +include/boost/mpl/aux_/config/intel.hpp +include/boost/mpl/aux_/config/lambda.hpp +include/boost/mpl/aux_/config/msvc.hpp +include/boost/mpl/aux_/config/msvc_typename.hpp +include/boost/mpl/aux_/config/nttp.hpp +include/boost/mpl/aux_/config/operators.hpp +include/boost/mpl/aux_/config/overload_resolution.hpp +include/boost/mpl/aux_/config/pp_counter.hpp +include/boost/mpl/aux_/config/preprocessor.hpp +include/boost/mpl/aux_/config/static_constant.hpp +include/boost/mpl/aux_/config/ttp.hpp +include/boost/mpl/aux_/config/typeof.hpp +include/boost/mpl/aux_/config/use_preprocessed.hpp +include/boost/mpl/aux_/config/workaround.hpp + +# boost/mpl/aux_/preprocessed/bcc +include/boost/mpl/aux_/preprocessed/bcc/advance_backward.hpp +include/boost/mpl/aux_/preprocessed/bcc/advance_forward.hpp +include/boost/mpl/aux_/preprocessed/bcc/and.hpp +include/boost/mpl/aux_/preprocessed/bcc/apply.hpp +include/boost/mpl/aux_/preprocessed/bcc/apply_fwd.hpp +include/boost/mpl/aux_/preprocessed/bcc/apply_wrap.hpp +include/boost/mpl/aux_/preprocessed/bcc/arg.hpp +include/boost/mpl/aux_/preprocessed/bcc/basic_bind.hpp +include/boost/mpl/aux_/preprocessed/bcc/bind.hpp +include/boost/mpl/aux_/preprocessed/bcc/bind_fwd.hpp +include/boost/mpl/aux_/preprocessed/bcc/bitand.hpp +include/boost/mpl/aux_/preprocessed/bcc/bitor.hpp +include/boost/mpl/aux_/preprocessed/bcc/bitxor.hpp +include/boost/mpl/aux_/preprocessed/bcc/deque.hpp +include/boost/mpl/aux_/preprocessed/bcc/divides.hpp +include/boost/mpl/aux_/preprocessed/bcc/equal_to.hpp +include/boost/mpl/aux_/preprocessed/bcc/fold_impl.hpp +include/boost/mpl/aux_/preprocessed/bcc/full_lambda.hpp +include/boost/mpl/aux_/preprocessed/bcc/greater.hpp +include/boost/mpl/aux_/preprocessed/bcc/greater_equal.hpp +include/boost/mpl/aux_/preprocessed/bcc/inherit.hpp +include/boost/mpl/aux_/preprocessed/bcc/iter_fold_if_impl.hpp +include/boost/mpl/aux_/preprocessed/bcc/iter_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/bcc/lambda_no_ctps.hpp +include/boost/mpl/aux_/preprocessed/bcc/less.hpp +include/boost/mpl/aux_/preprocessed/bcc/less_equal.hpp +include/boost/mpl/aux_/preprocessed/bcc/list.hpp +include/boost/mpl/aux_/preprocessed/bcc/list_c.hpp +include/boost/mpl/aux_/preprocessed/bcc/map.hpp +include/boost/mpl/aux_/preprocessed/bcc/minus.hpp +include/boost/mpl/aux_/preprocessed/bcc/modulus.hpp +include/boost/mpl/aux_/preprocessed/bcc/not_equal_to.hpp +include/boost/mpl/aux_/preprocessed/bcc/or.hpp +include/boost/mpl/aux_/preprocessed/bcc/placeholders.hpp +include/boost/mpl/aux_/preprocessed/bcc/plus.hpp +include/boost/mpl/aux_/preprocessed/bcc/quote.hpp +include/boost/mpl/aux_/preprocessed/bcc/reverse_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/bcc/reverse_iter_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/bcc/set.hpp +include/boost/mpl/aux_/preprocessed/bcc/set_c.hpp +include/boost/mpl/aux_/preprocessed/bcc/shift_left.hpp +include/boost/mpl/aux_/preprocessed/bcc/shift_right.hpp +include/boost/mpl/aux_/preprocessed/bcc/template_arity.hpp +include/boost/mpl/aux_/preprocessed/bcc/times.hpp +include/boost/mpl/aux_/preprocessed/bcc/unpack_args.hpp +include/boost/mpl/aux_/preprocessed/bcc/vector.hpp +include/boost/mpl/aux_/preprocessed/bcc/vector_c.hpp + +# boost/mpl/aux_/preprocessed/bcc551 +include/boost/mpl/aux_/preprocessed/bcc551/advance_backward.hpp +include/boost/mpl/aux_/preprocessed/bcc551/advance_forward.hpp +include/boost/mpl/aux_/preprocessed/bcc551/and.hpp +include/boost/mpl/aux_/preprocessed/bcc551/apply.hpp +include/boost/mpl/aux_/preprocessed/bcc551/apply_fwd.hpp +include/boost/mpl/aux_/preprocessed/bcc551/apply_wrap.hpp +include/boost/mpl/aux_/preprocessed/bcc551/arg.hpp +include/boost/mpl/aux_/preprocessed/bcc551/basic_bind.hpp +include/boost/mpl/aux_/preprocessed/bcc551/bind.hpp +include/boost/mpl/aux_/preprocessed/bcc551/bind_fwd.hpp +include/boost/mpl/aux_/preprocessed/bcc551/bitand.hpp +include/boost/mpl/aux_/preprocessed/bcc551/bitor.hpp +include/boost/mpl/aux_/preprocessed/bcc551/bitxor.hpp +include/boost/mpl/aux_/preprocessed/bcc551/deque.hpp +include/boost/mpl/aux_/preprocessed/bcc551/divides.hpp +include/boost/mpl/aux_/preprocessed/bcc551/equal_to.hpp +include/boost/mpl/aux_/preprocessed/bcc551/fold_impl.hpp +include/boost/mpl/aux_/preprocessed/bcc551/full_lambda.hpp +include/boost/mpl/aux_/preprocessed/bcc551/greater.hpp +include/boost/mpl/aux_/preprocessed/bcc551/greater_equal.hpp +include/boost/mpl/aux_/preprocessed/bcc551/inherit.hpp +include/boost/mpl/aux_/preprocessed/bcc551/iter_fold_if_impl.hpp +include/boost/mpl/aux_/preprocessed/bcc551/iter_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/bcc551/lambda_no_ctps.hpp +include/boost/mpl/aux_/preprocessed/bcc551/less.hpp +include/boost/mpl/aux_/preprocessed/bcc551/less_equal.hpp +include/boost/mpl/aux_/preprocessed/bcc551/list.hpp +include/boost/mpl/aux_/preprocessed/bcc551/list_c.hpp +include/boost/mpl/aux_/preprocessed/bcc551/map.hpp +include/boost/mpl/aux_/preprocessed/bcc551/minus.hpp +include/boost/mpl/aux_/preprocessed/bcc551/modulus.hpp +include/boost/mpl/aux_/preprocessed/bcc551/not_equal_to.hpp +include/boost/mpl/aux_/preprocessed/bcc551/or.hpp +include/boost/mpl/aux_/preprocessed/bcc551/placeholders.hpp +include/boost/mpl/aux_/preprocessed/bcc551/plus.hpp +include/boost/mpl/aux_/preprocessed/bcc551/quote.hpp +include/boost/mpl/aux_/preprocessed/bcc551/reverse_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/bcc551/reverse_iter_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/bcc551/set.hpp +include/boost/mpl/aux_/preprocessed/bcc551/set_c.hpp +include/boost/mpl/aux_/preprocessed/bcc551/shift_left.hpp +include/boost/mpl/aux_/preprocessed/bcc551/shift_right.hpp +include/boost/mpl/aux_/preprocessed/bcc551/template_arity.hpp +include/boost/mpl/aux_/preprocessed/bcc551/times.hpp +include/boost/mpl/aux_/preprocessed/bcc551/unpack_args.hpp +include/boost/mpl/aux_/preprocessed/bcc551/vector.hpp +include/boost/mpl/aux_/preprocessed/bcc551/vector_c.hpp + +# boost/mpl/aux_/preprocessed/bcc_pre590 +include/boost/mpl/aux_/preprocessed/bcc_pre590/advance_backward.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/advance_forward.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/and.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/apply.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/apply_fwd.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/apply_wrap.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/arg.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/basic_bind.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/bind.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/bind_fwd.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/bitand.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/bitor.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/bitxor.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/deque.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/divides.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/equal_to.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/fold_impl.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/full_lambda.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/greater.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/greater_equal.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/inherit.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/iter_fold_if_impl.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/iter_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/lambda_no_ctps.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/less.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/less_equal.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/list.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/list_c.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/map.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/minus.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/modulus.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/not_equal_to.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/or.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/placeholders.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/plus.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/quote.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/reverse_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/reverse_iter_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/set.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/set_c.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/shift_left.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/shift_right.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/template_arity.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/times.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/unpack_args.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/vector.hpp +include/boost/mpl/aux_/preprocessed/bcc_pre590/vector_c.hpp + +# boost/mpl/aux_/preprocessed/dmc +include/boost/mpl/aux_/preprocessed/dmc/advance_backward.hpp +include/boost/mpl/aux_/preprocessed/dmc/advance_forward.hpp +include/boost/mpl/aux_/preprocessed/dmc/and.hpp +include/boost/mpl/aux_/preprocessed/dmc/apply.hpp +include/boost/mpl/aux_/preprocessed/dmc/apply_fwd.hpp +include/boost/mpl/aux_/preprocessed/dmc/apply_wrap.hpp +include/boost/mpl/aux_/preprocessed/dmc/arg.hpp +include/boost/mpl/aux_/preprocessed/dmc/basic_bind.hpp +include/boost/mpl/aux_/preprocessed/dmc/bind.hpp +include/boost/mpl/aux_/preprocessed/dmc/bind_fwd.hpp +include/boost/mpl/aux_/preprocessed/dmc/bitand.hpp +include/boost/mpl/aux_/preprocessed/dmc/bitor.hpp +include/boost/mpl/aux_/preprocessed/dmc/bitxor.hpp +include/boost/mpl/aux_/preprocessed/dmc/deque.hpp +include/boost/mpl/aux_/preprocessed/dmc/divides.hpp +include/boost/mpl/aux_/preprocessed/dmc/equal_to.hpp +include/boost/mpl/aux_/preprocessed/dmc/fold_impl.hpp +include/boost/mpl/aux_/preprocessed/dmc/full_lambda.hpp +include/boost/mpl/aux_/preprocessed/dmc/greater.hpp +include/boost/mpl/aux_/preprocessed/dmc/greater_equal.hpp +include/boost/mpl/aux_/preprocessed/dmc/inherit.hpp +include/boost/mpl/aux_/preprocessed/dmc/iter_fold_if_impl.hpp +include/boost/mpl/aux_/preprocessed/dmc/iter_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/dmc/lambda_no_ctps.hpp +include/boost/mpl/aux_/preprocessed/dmc/less.hpp +include/boost/mpl/aux_/preprocessed/dmc/less_equal.hpp +include/boost/mpl/aux_/preprocessed/dmc/list.hpp +include/boost/mpl/aux_/preprocessed/dmc/list_c.hpp +include/boost/mpl/aux_/preprocessed/dmc/map.hpp +include/boost/mpl/aux_/preprocessed/dmc/minus.hpp +include/boost/mpl/aux_/preprocessed/dmc/modulus.hpp +include/boost/mpl/aux_/preprocessed/dmc/not_equal_to.hpp +include/boost/mpl/aux_/preprocessed/dmc/or.hpp +include/boost/mpl/aux_/preprocessed/dmc/placeholders.hpp +include/boost/mpl/aux_/preprocessed/dmc/plus.hpp +include/boost/mpl/aux_/preprocessed/dmc/quote.hpp +include/boost/mpl/aux_/preprocessed/dmc/reverse_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/dmc/reverse_iter_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/dmc/set.hpp +include/boost/mpl/aux_/preprocessed/dmc/set_c.hpp +include/boost/mpl/aux_/preprocessed/dmc/shift_left.hpp +include/boost/mpl/aux_/preprocessed/dmc/shift_right.hpp +include/boost/mpl/aux_/preprocessed/dmc/template_arity.hpp +include/boost/mpl/aux_/preprocessed/dmc/times.hpp +include/boost/mpl/aux_/preprocessed/dmc/unpack_args.hpp +include/boost/mpl/aux_/preprocessed/dmc/vector.hpp +include/boost/mpl/aux_/preprocessed/dmc/vector_c.hpp + +# boost/mpl/aux_/preprocessed/gcc +include/boost/mpl/aux_/preprocessed/gcc/advance_backward.hpp +include/boost/mpl/aux_/preprocessed/gcc/advance_forward.hpp +include/boost/mpl/aux_/preprocessed/gcc/and.hpp +include/boost/mpl/aux_/preprocessed/gcc/apply.hpp +include/boost/mpl/aux_/preprocessed/gcc/apply_fwd.hpp +include/boost/mpl/aux_/preprocessed/gcc/apply_wrap.hpp +include/boost/mpl/aux_/preprocessed/gcc/arg.hpp +include/boost/mpl/aux_/preprocessed/gcc/basic_bind.hpp +include/boost/mpl/aux_/preprocessed/gcc/bind.hpp +include/boost/mpl/aux_/preprocessed/gcc/bind_fwd.hpp +include/boost/mpl/aux_/preprocessed/gcc/bitand.hpp +include/boost/mpl/aux_/preprocessed/gcc/bitor.hpp +include/boost/mpl/aux_/preprocessed/gcc/bitxor.hpp +include/boost/mpl/aux_/preprocessed/gcc/deque.hpp +include/boost/mpl/aux_/preprocessed/gcc/divides.hpp +include/boost/mpl/aux_/preprocessed/gcc/equal_to.hpp +include/boost/mpl/aux_/preprocessed/gcc/fold_impl.hpp +include/boost/mpl/aux_/preprocessed/gcc/full_lambda.hpp +include/boost/mpl/aux_/preprocessed/gcc/greater.hpp +include/boost/mpl/aux_/preprocessed/gcc/greater_equal.hpp +include/boost/mpl/aux_/preprocessed/gcc/inherit.hpp +include/boost/mpl/aux_/preprocessed/gcc/iter_fold_if_impl.hpp +include/boost/mpl/aux_/preprocessed/gcc/iter_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/gcc/lambda_no_ctps.hpp +include/boost/mpl/aux_/preprocessed/gcc/less.hpp +include/boost/mpl/aux_/preprocessed/gcc/less_equal.hpp +include/boost/mpl/aux_/preprocessed/gcc/list.hpp +include/boost/mpl/aux_/preprocessed/gcc/list_c.hpp +include/boost/mpl/aux_/preprocessed/gcc/map.hpp +include/boost/mpl/aux_/preprocessed/gcc/minus.hpp +include/boost/mpl/aux_/preprocessed/gcc/modulus.hpp +include/boost/mpl/aux_/preprocessed/gcc/not_equal_to.hpp +include/boost/mpl/aux_/preprocessed/gcc/or.hpp +include/boost/mpl/aux_/preprocessed/gcc/placeholders.hpp +include/boost/mpl/aux_/preprocessed/gcc/plus.hpp +include/boost/mpl/aux_/preprocessed/gcc/quote.hpp +include/boost/mpl/aux_/preprocessed/gcc/reverse_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/gcc/reverse_iter_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/gcc/set.hpp +include/boost/mpl/aux_/preprocessed/gcc/set_c.hpp +include/boost/mpl/aux_/preprocessed/gcc/shift_left.hpp +include/boost/mpl/aux_/preprocessed/gcc/shift_right.hpp +include/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp +include/boost/mpl/aux_/preprocessed/gcc/times.hpp +include/boost/mpl/aux_/preprocessed/gcc/unpack_args.hpp +include/boost/mpl/aux_/preprocessed/gcc/vector.hpp +include/boost/mpl/aux_/preprocessed/gcc/vector_c.hpp + +# boost/mpl/aux_/preprocessed/msvc60 +include/boost/mpl/aux_/preprocessed/msvc60/advance_backward.hpp +include/boost/mpl/aux_/preprocessed/msvc60/advance_forward.hpp +include/boost/mpl/aux_/preprocessed/msvc60/and.hpp +include/boost/mpl/aux_/preprocessed/msvc60/apply.hpp +include/boost/mpl/aux_/preprocessed/msvc60/apply_fwd.hpp +include/boost/mpl/aux_/preprocessed/msvc60/apply_wrap.hpp +include/boost/mpl/aux_/preprocessed/msvc60/arg.hpp +include/boost/mpl/aux_/preprocessed/msvc60/basic_bind.hpp +include/boost/mpl/aux_/preprocessed/msvc60/bind.hpp +include/boost/mpl/aux_/preprocessed/msvc60/bind_fwd.hpp +include/boost/mpl/aux_/preprocessed/msvc60/bitand.hpp +include/boost/mpl/aux_/preprocessed/msvc60/bitor.hpp +include/boost/mpl/aux_/preprocessed/msvc60/bitxor.hpp +include/boost/mpl/aux_/preprocessed/msvc60/deque.hpp +include/boost/mpl/aux_/preprocessed/msvc60/divides.hpp +include/boost/mpl/aux_/preprocessed/msvc60/equal_to.hpp +include/boost/mpl/aux_/preprocessed/msvc60/fold_impl.hpp +include/boost/mpl/aux_/preprocessed/msvc60/full_lambda.hpp +include/boost/mpl/aux_/preprocessed/msvc60/greater.hpp +include/boost/mpl/aux_/preprocessed/msvc60/greater_equal.hpp +include/boost/mpl/aux_/preprocessed/msvc60/inherit.hpp +include/boost/mpl/aux_/preprocessed/msvc60/iter_fold_if_impl.hpp +include/boost/mpl/aux_/preprocessed/msvc60/iter_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/msvc60/lambda_no_ctps.hpp +include/boost/mpl/aux_/preprocessed/msvc60/less.hpp +include/boost/mpl/aux_/preprocessed/msvc60/less_equal.hpp +include/boost/mpl/aux_/preprocessed/msvc60/list.hpp +include/boost/mpl/aux_/preprocessed/msvc60/list_c.hpp +include/boost/mpl/aux_/preprocessed/msvc60/map.hpp +include/boost/mpl/aux_/preprocessed/msvc60/minus.hpp +include/boost/mpl/aux_/preprocessed/msvc60/modulus.hpp +include/boost/mpl/aux_/preprocessed/msvc60/not_equal_to.hpp +include/boost/mpl/aux_/preprocessed/msvc60/or.hpp +include/boost/mpl/aux_/preprocessed/msvc60/placeholders.hpp +include/boost/mpl/aux_/preprocessed/msvc60/plus.hpp +include/boost/mpl/aux_/preprocessed/msvc60/quote.hpp +include/boost/mpl/aux_/preprocessed/msvc60/reverse_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/msvc60/reverse_iter_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/msvc60/set.hpp +include/boost/mpl/aux_/preprocessed/msvc60/set_c.hpp +include/boost/mpl/aux_/preprocessed/msvc60/shift_left.hpp +include/boost/mpl/aux_/preprocessed/msvc60/shift_right.hpp +include/boost/mpl/aux_/preprocessed/msvc60/template_arity.hpp +include/boost/mpl/aux_/preprocessed/msvc60/times.hpp +include/boost/mpl/aux_/preprocessed/msvc60/unpack_args.hpp +include/boost/mpl/aux_/preprocessed/msvc60/vector.hpp +include/boost/mpl/aux_/preprocessed/msvc60/vector_c.hpp + +# boost/mpl/aux_/preprocessed/msvc70 +include/boost/mpl/aux_/preprocessed/msvc70/advance_backward.hpp +include/boost/mpl/aux_/preprocessed/msvc70/advance_forward.hpp +include/boost/mpl/aux_/preprocessed/msvc70/and.hpp +include/boost/mpl/aux_/preprocessed/msvc70/apply.hpp +include/boost/mpl/aux_/preprocessed/msvc70/apply_fwd.hpp +include/boost/mpl/aux_/preprocessed/msvc70/apply_wrap.hpp +include/boost/mpl/aux_/preprocessed/msvc70/arg.hpp +include/boost/mpl/aux_/preprocessed/msvc70/basic_bind.hpp +include/boost/mpl/aux_/preprocessed/msvc70/bind.hpp +include/boost/mpl/aux_/preprocessed/msvc70/bind_fwd.hpp +include/boost/mpl/aux_/preprocessed/msvc70/bitand.hpp +include/boost/mpl/aux_/preprocessed/msvc70/bitor.hpp +include/boost/mpl/aux_/preprocessed/msvc70/bitxor.hpp +include/boost/mpl/aux_/preprocessed/msvc70/deque.hpp +include/boost/mpl/aux_/preprocessed/msvc70/divides.hpp +include/boost/mpl/aux_/preprocessed/msvc70/equal_to.hpp +include/boost/mpl/aux_/preprocessed/msvc70/fold_impl.hpp +include/boost/mpl/aux_/preprocessed/msvc70/full_lambda.hpp +include/boost/mpl/aux_/preprocessed/msvc70/greater.hpp +include/boost/mpl/aux_/preprocessed/msvc70/greater_equal.hpp +include/boost/mpl/aux_/preprocessed/msvc70/inherit.hpp +include/boost/mpl/aux_/preprocessed/msvc70/iter_fold_if_impl.hpp +include/boost/mpl/aux_/preprocessed/msvc70/iter_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/msvc70/lambda_no_ctps.hpp +include/boost/mpl/aux_/preprocessed/msvc70/less.hpp +include/boost/mpl/aux_/preprocessed/msvc70/less_equal.hpp +include/boost/mpl/aux_/preprocessed/msvc70/list.hpp +include/boost/mpl/aux_/preprocessed/msvc70/list_c.hpp +include/boost/mpl/aux_/preprocessed/msvc70/map.hpp +include/boost/mpl/aux_/preprocessed/msvc70/minus.hpp +include/boost/mpl/aux_/preprocessed/msvc70/modulus.hpp +include/boost/mpl/aux_/preprocessed/msvc70/not_equal_to.hpp +include/boost/mpl/aux_/preprocessed/msvc70/or.hpp +include/boost/mpl/aux_/preprocessed/msvc70/placeholders.hpp +include/boost/mpl/aux_/preprocessed/msvc70/plus.hpp +include/boost/mpl/aux_/preprocessed/msvc70/quote.hpp +include/boost/mpl/aux_/preprocessed/msvc70/reverse_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/msvc70/reverse_iter_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/msvc70/set.hpp +include/boost/mpl/aux_/preprocessed/msvc70/set_c.hpp +include/boost/mpl/aux_/preprocessed/msvc70/shift_left.hpp +include/boost/mpl/aux_/preprocessed/msvc70/shift_right.hpp +include/boost/mpl/aux_/preprocessed/msvc70/template_arity.hpp +include/boost/mpl/aux_/preprocessed/msvc70/times.hpp +include/boost/mpl/aux_/preprocessed/msvc70/unpack_args.hpp +include/boost/mpl/aux_/preprocessed/msvc70/vector.hpp +include/boost/mpl/aux_/preprocessed/msvc70/vector_c.hpp + +# boost/mpl/aux_/preprocessed/mwcw +include/boost/mpl/aux_/preprocessed/mwcw/advance_backward.hpp +include/boost/mpl/aux_/preprocessed/mwcw/advance_forward.hpp +include/boost/mpl/aux_/preprocessed/mwcw/and.hpp +include/boost/mpl/aux_/preprocessed/mwcw/apply.hpp +include/boost/mpl/aux_/preprocessed/mwcw/apply_fwd.hpp +include/boost/mpl/aux_/preprocessed/mwcw/apply_wrap.hpp +include/boost/mpl/aux_/preprocessed/mwcw/arg.hpp +include/boost/mpl/aux_/preprocessed/mwcw/basic_bind.hpp +include/boost/mpl/aux_/preprocessed/mwcw/bind.hpp +include/boost/mpl/aux_/preprocessed/mwcw/bind_fwd.hpp +include/boost/mpl/aux_/preprocessed/mwcw/bitand.hpp +include/boost/mpl/aux_/preprocessed/mwcw/bitor.hpp +include/boost/mpl/aux_/preprocessed/mwcw/bitxor.hpp +include/boost/mpl/aux_/preprocessed/mwcw/deque.hpp +include/boost/mpl/aux_/preprocessed/mwcw/divides.hpp +include/boost/mpl/aux_/preprocessed/mwcw/equal_to.hpp +include/boost/mpl/aux_/preprocessed/mwcw/fold_impl.hpp +include/boost/mpl/aux_/preprocessed/mwcw/full_lambda.hpp +include/boost/mpl/aux_/preprocessed/mwcw/greater.hpp +include/boost/mpl/aux_/preprocessed/mwcw/greater_equal.hpp +include/boost/mpl/aux_/preprocessed/mwcw/inherit.hpp +include/boost/mpl/aux_/preprocessed/mwcw/iter_fold_if_impl.hpp +include/boost/mpl/aux_/preprocessed/mwcw/iter_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/mwcw/lambda_no_ctps.hpp +include/boost/mpl/aux_/preprocessed/mwcw/less.hpp +include/boost/mpl/aux_/preprocessed/mwcw/less_equal.hpp +include/boost/mpl/aux_/preprocessed/mwcw/list.hpp +include/boost/mpl/aux_/preprocessed/mwcw/list_c.hpp +include/boost/mpl/aux_/preprocessed/mwcw/map.hpp +include/boost/mpl/aux_/preprocessed/mwcw/minus.hpp +include/boost/mpl/aux_/preprocessed/mwcw/modulus.hpp +include/boost/mpl/aux_/preprocessed/mwcw/not_equal_to.hpp +include/boost/mpl/aux_/preprocessed/mwcw/or.hpp +include/boost/mpl/aux_/preprocessed/mwcw/placeholders.hpp +include/boost/mpl/aux_/preprocessed/mwcw/plus.hpp +include/boost/mpl/aux_/preprocessed/mwcw/quote.hpp +include/boost/mpl/aux_/preprocessed/mwcw/reverse_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/mwcw/reverse_iter_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/mwcw/set.hpp +include/boost/mpl/aux_/preprocessed/mwcw/set_c.hpp +include/boost/mpl/aux_/preprocessed/mwcw/shift_left.hpp +include/boost/mpl/aux_/preprocessed/mwcw/shift_right.hpp +include/boost/mpl/aux_/preprocessed/mwcw/template_arity.hpp +include/boost/mpl/aux_/preprocessed/mwcw/times.hpp +include/boost/mpl/aux_/preprocessed/mwcw/unpack_args.hpp +include/boost/mpl/aux_/preprocessed/mwcw/vector.hpp +include/boost/mpl/aux_/preprocessed/mwcw/vector_c.hpp + +# boost/mpl/aux_/preprocessed/no_ctps +include/boost/mpl/aux_/preprocessed/no_ctps/advance_backward.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/advance_forward.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/and.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/apply.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/apply_fwd.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/apply_wrap.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/arg.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/basic_bind.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/bind.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/bind_fwd.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/bitand.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/bitor.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/bitxor.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/deque.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/divides.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/equal_to.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/fold_impl.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/full_lambda.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/greater.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/greater_equal.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/inherit.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/iter_fold_if_impl.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/iter_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/lambda_no_ctps.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/less.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/less_equal.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/list.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/list_c.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/map.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/minus.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/modulus.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/not_equal_to.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/or.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/placeholders.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/plus.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/quote.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/reverse_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/reverse_iter_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/set.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/set_c.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/shift_left.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/shift_right.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/template_arity.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/times.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/unpack_args.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/vector.hpp +include/boost/mpl/aux_/preprocessed/no_ctps/vector_c.hpp + +# boost/mpl/aux_/preprocessed/no_ttp +include/boost/mpl/aux_/preprocessed/no_ttp/advance_backward.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/advance_forward.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/and.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/apply.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/apply_fwd.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/apply_wrap.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/arg.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/basic_bind.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/bind.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/bind_fwd.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/bitand.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/bitor.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/bitxor.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/deque.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/divides.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/equal_to.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/fold_impl.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/full_lambda.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/greater.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/greater_equal.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/inherit.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/iter_fold_if_impl.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/iter_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/lambda_no_ctps.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/less.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/less_equal.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/list.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/list_c.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/map.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/minus.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/modulus.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/not_equal_to.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/or.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/placeholders.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/plus.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/quote.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/reverse_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/reverse_iter_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/set.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/set_c.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/shift_left.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/shift_right.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/template_arity.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/times.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/unpack_args.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/vector.hpp +include/boost/mpl/aux_/preprocessed/no_ttp/vector_c.hpp + +# boost/mpl/aux_/preprocessed/plain +include/boost/mpl/aux_/preprocessed/plain/advance_backward.hpp +include/boost/mpl/aux_/preprocessed/plain/advance_forward.hpp +include/boost/mpl/aux_/preprocessed/plain/and.hpp +include/boost/mpl/aux_/preprocessed/plain/apply.hpp +include/boost/mpl/aux_/preprocessed/plain/apply_fwd.hpp +include/boost/mpl/aux_/preprocessed/plain/apply_wrap.hpp +include/boost/mpl/aux_/preprocessed/plain/arg.hpp +include/boost/mpl/aux_/preprocessed/plain/basic_bind.hpp +include/boost/mpl/aux_/preprocessed/plain/bind.hpp +include/boost/mpl/aux_/preprocessed/plain/bind_fwd.hpp +include/boost/mpl/aux_/preprocessed/plain/bitand.hpp +include/boost/mpl/aux_/preprocessed/plain/bitor.hpp +include/boost/mpl/aux_/preprocessed/plain/bitxor.hpp +include/boost/mpl/aux_/preprocessed/plain/deque.hpp +include/boost/mpl/aux_/preprocessed/plain/divides.hpp +include/boost/mpl/aux_/preprocessed/plain/equal_to.hpp +include/boost/mpl/aux_/preprocessed/plain/fold_impl.hpp +include/boost/mpl/aux_/preprocessed/plain/full_lambda.hpp +include/boost/mpl/aux_/preprocessed/plain/greater.hpp +include/boost/mpl/aux_/preprocessed/plain/greater_equal.hpp +include/boost/mpl/aux_/preprocessed/plain/inherit.hpp +include/boost/mpl/aux_/preprocessed/plain/iter_fold_if_impl.hpp +include/boost/mpl/aux_/preprocessed/plain/iter_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/plain/lambda_no_ctps.hpp +include/boost/mpl/aux_/preprocessed/plain/less.hpp +include/boost/mpl/aux_/preprocessed/plain/less_equal.hpp +include/boost/mpl/aux_/preprocessed/plain/list.hpp +include/boost/mpl/aux_/preprocessed/plain/list_c.hpp +include/boost/mpl/aux_/preprocessed/plain/map.hpp +include/boost/mpl/aux_/preprocessed/plain/minus.hpp +include/boost/mpl/aux_/preprocessed/plain/modulus.hpp +include/boost/mpl/aux_/preprocessed/plain/not_equal_to.hpp +include/boost/mpl/aux_/preprocessed/plain/or.hpp +include/boost/mpl/aux_/preprocessed/plain/placeholders.hpp +include/boost/mpl/aux_/preprocessed/plain/plus.hpp +include/boost/mpl/aux_/preprocessed/plain/quote.hpp +include/boost/mpl/aux_/preprocessed/plain/reverse_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/plain/reverse_iter_fold_impl.hpp +include/boost/mpl/aux_/preprocessed/plain/set.hpp +include/boost/mpl/aux_/preprocessed/plain/set_c.hpp +include/boost/mpl/aux_/preprocessed/plain/shift_left.hpp +include/boost/mpl/aux_/preprocessed/plain/shift_right.hpp +include/boost/mpl/aux_/preprocessed/plain/template_arity.hpp +include/boost/mpl/aux_/preprocessed/plain/times.hpp +include/boost/mpl/aux_/preprocessed/plain/unpack_args.hpp +include/boost/mpl/aux_/preprocessed/plain/vector.hpp +include/boost/mpl/aux_/preprocessed/plain/vector_c.hpp + +# boost/mpl/aux_/preprocessor +include/boost/mpl/aux_/preprocessor/add.hpp +include/boost/mpl/aux_/preprocessor/def_params_tail.hpp +include/boost/mpl/aux_/preprocessor/default_params.hpp +include/boost/mpl/aux_/preprocessor/enum.hpp +include/boost/mpl/aux_/preprocessor/ext_params.hpp +include/boost/mpl/aux_/preprocessor/filter_params.hpp +include/boost/mpl/aux_/preprocessor/is_seq.hpp +include/boost/mpl/aux_/preprocessor/params.hpp +include/boost/mpl/aux_/preprocessor/partial_spec_params.hpp +include/boost/mpl/aux_/preprocessor/range.hpp +include/boost/mpl/aux_/preprocessor/repeat.hpp +include/boost/mpl/aux_/preprocessor/sub.hpp +include/boost/mpl/aux_/preprocessor/token_equal.hpp +include/boost/mpl/aux_/preprocessor/tuple.hpp + +# boost/mpl/limits +include/boost/mpl/limits/arity.hpp +include/boost/mpl/limits/list.hpp +include/boost/mpl/limits/map.hpp +include/boost/mpl/limits/set.hpp +include/boost/mpl/limits/unrolling.hpp +include/boost/mpl/limits/vector.hpp + +# boost/mpl/list +include/boost/mpl/list/list0.hpp +include/boost/mpl/list/list0_c.hpp +include/boost/mpl/list/list10.hpp +include/boost/mpl/list/list10_c.hpp +include/boost/mpl/list/list20.hpp +include/boost/mpl/list/list20_c.hpp +include/boost/mpl/list/list30.hpp +include/boost/mpl/list/list30_c.hpp +include/boost/mpl/list/list40.hpp +include/boost/mpl/list/list40_c.hpp +include/boost/mpl/list/list50.hpp +include/boost/mpl/list/list50_c.hpp + +# boost/mpl/list/aux_ +include/boost/mpl/list/aux_/O1_size.hpp +include/boost/mpl/list/aux_/begin_end.hpp +include/boost/mpl/list/aux_/clear.hpp +include/boost/mpl/list/aux_/empty.hpp +include/boost/mpl/list/aux_/front.hpp +include/boost/mpl/list/aux_/include_preprocessed.hpp +include/boost/mpl/list/aux_/item.hpp +include/boost/mpl/list/aux_/iterator.hpp +include/boost/mpl/list/aux_/numbered.hpp +include/boost/mpl/list/aux_/numbered_c.hpp +include/boost/mpl/list/aux_/pop_front.hpp +include/boost/mpl/list/aux_/push_back.hpp +include/boost/mpl/list/aux_/push_front.hpp +include/boost/mpl/list/aux_/size.hpp +include/boost/mpl/list/aux_/tag.hpp + +# boost/mpl/list/aux_/preprocessed/plain +include/boost/mpl/list/aux_/preprocessed/plain/list10.hpp +include/boost/mpl/list/aux_/preprocessed/plain/list10_c.hpp +include/boost/mpl/list/aux_/preprocessed/plain/list20.hpp +include/boost/mpl/list/aux_/preprocessed/plain/list20_c.hpp +include/boost/mpl/list/aux_/preprocessed/plain/list30.hpp +include/boost/mpl/list/aux_/preprocessed/plain/list30_c.hpp +include/boost/mpl/list/aux_/preprocessed/plain/list40.hpp +include/boost/mpl/list/aux_/preprocessed/plain/list40_c.hpp +include/boost/mpl/list/aux_/preprocessed/plain/list50.hpp +include/boost/mpl/list/aux_/preprocessed/plain/list50_c.hpp + +# boost/mpl/map +include/boost/mpl/map/map0.hpp +include/boost/mpl/map/map10.hpp +include/boost/mpl/map/map20.hpp +include/boost/mpl/map/map30.hpp +include/boost/mpl/map/map40.hpp +include/boost/mpl/map/map50.hpp + +# boost/mpl/map/aux_ +include/boost/mpl/map/aux_/at_impl.hpp +include/boost/mpl/map/aux_/begin_end_impl.hpp +include/boost/mpl/map/aux_/clear_impl.hpp +include/boost/mpl/map/aux_/contains_impl.hpp +include/boost/mpl/map/aux_/empty_impl.hpp +include/boost/mpl/map/aux_/erase_impl.hpp +include/boost/mpl/map/aux_/erase_key_impl.hpp +include/boost/mpl/map/aux_/has_key_impl.hpp +include/boost/mpl/map/aux_/include_preprocessed.hpp +include/boost/mpl/map/aux_/insert_impl.hpp +include/boost/mpl/map/aux_/insert_range_impl.hpp +include/boost/mpl/map/aux_/item.hpp +include/boost/mpl/map/aux_/iterator.hpp +include/boost/mpl/map/aux_/key_type_impl.hpp +include/boost/mpl/map/aux_/map0.hpp +include/boost/mpl/map/aux_/numbered.hpp +include/boost/mpl/map/aux_/size_impl.hpp +include/boost/mpl/map/aux_/tag.hpp +include/boost/mpl/map/aux_/value_type_impl.hpp + +# boost/mpl/map/aux_/preprocessed/no_ctps +include/boost/mpl/map/aux_/preprocessed/no_ctps/map10.hpp +include/boost/mpl/map/aux_/preprocessed/no_ctps/map20.hpp +include/boost/mpl/map/aux_/preprocessed/no_ctps/map30.hpp +include/boost/mpl/map/aux_/preprocessed/no_ctps/map40.hpp +include/boost/mpl/map/aux_/preprocessed/no_ctps/map50.hpp + +# boost/mpl/map/aux_/preprocessed/plain +include/boost/mpl/map/aux_/preprocessed/plain/map10.hpp +include/boost/mpl/map/aux_/preprocessed/plain/map20.hpp +include/boost/mpl/map/aux_/preprocessed/plain/map30.hpp +include/boost/mpl/map/aux_/preprocessed/plain/map40.hpp +include/boost/mpl/map/aux_/preprocessed/plain/map50.hpp + +# boost/mpl/map/aux_/preprocessed/typeof_based +include/boost/mpl/map/aux_/preprocessed/typeof_based/map10.hpp +include/boost/mpl/map/aux_/preprocessed/typeof_based/map20.hpp +include/boost/mpl/map/aux_/preprocessed/typeof_based/map30.hpp +include/boost/mpl/map/aux_/preprocessed/typeof_based/map40.hpp +include/boost/mpl/map/aux_/preprocessed/typeof_based/map50.hpp + +# boost/mpl/set +include/boost/mpl/set/set0.hpp +include/boost/mpl/set/set0_c.hpp +include/boost/mpl/set/set10.hpp +include/boost/mpl/set/set10_c.hpp +include/boost/mpl/set/set20.hpp +include/boost/mpl/set/set20_c.hpp +include/boost/mpl/set/set30.hpp +include/boost/mpl/set/set30_c.hpp +include/boost/mpl/set/set40.hpp +include/boost/mpl/set/set40_c.hpp +include/boost/mpl/set/set50.hpp +include/boost/mpl/set/set50_c.hpp + +# boost/mpl/set/aux_ +include/boost/mpl/set/aux_/at_impl.hpp +include/boost/mpl/set/aux_/begin_end_impl.hpp +include/boost/mpl/set/aux_/clear_impl.hpp +include/boost/mpl/set/aux_/empty_impl.hpp +include/boost/mpl/set/aux_/erase_impl.hpp +include/boost/mpl/set/aux_/erase_key_impl.hpp +include/boost/mpl/set/aux_/has_key_impl.hpp +include/boost/mpl/set/aux_/include_preprocessed.hpp +include/boost/mpl/set/aux_/insert_impl.hpp +include/boost/mpl/set/aux_/insert_range_impl.hpp +include/boost/mpl/set/aux_/item.hpp +include/boost/mpl/set/aux_/iterator.hpp +include/boost/mpl/set/aux_/key_type_impl.hpp +include/boost/mpl/set/aux_/numbered.hpp +include/boost/mpl/set/aux_/numbered_c.hpp +include/boost/mpl/set/aux_/set0.hpp +include/boost/mpl/set/aux_/size_impl.hpp +include/boost/mpl/set/aux_/tag.hpp +include/boost/mpl/set/aux_/value_type_impl.hpp + +# boost/mpl/set/aux_/preprocessed/plain +include/boost/mpl/set/aux_/preprocessed/plain/set10.hpp +include/boost/mpl/set/aux_/preprocessed/plain/set10_c.hpp +include/boost/mpl/set/aux_/preprocessed/plain/set20.hpp +include/boost/mpl/set/aux_/preprocessed/plain/set20_c.hpp +include/boost/mpl/set/aux_/preprocessed/plain/set30.hpp +include/boost/mpl/set/aux_/preprocessed/plain/set30_c.hpp +include/boost/mpl/set/aux_/preprocessed/plain/set40.hpp +include/boost/mpl/set/aux_/preprocessed/plain/set40_c.hpp +include/boost/mpl/set/aux_/preprocessed/plain/set50.hpp +include/boost/mpl/set/aux_/preprocessed/plain/set50_c.hpp + +# boost/mpl/vector +include/boost/mpl/vector/vector0.hpp +include/boost/mpl/vector/vector0_c.hpp +include/boost/mpl/vector/vector10.hpp +include/boost/mpl/vector/vector10_c.hpp +include/boost/mpl/vector/vector20.hpp +include/boost/mpl/vector/vector20_c.hpp +include/boost/mpl/vector/vector30.hpp +include/boost/mpl/vector/vector30_c.hpp +include/boost/mpl/vector/vector40.hpp +include/boost/mpl/vector/vector40_c.hpp +include/boost/mpl/vector/vector50.hpp +include/boost/mpl/vector/vector50_c.hpp + +# boost/mpl/vector/aux_ +include/boost/mpl/vector/aux_/O1_size.hpp +include/boost/mpl/vector/aux_/at.hpp +include/boost/mpl/vector/aux_/back.hpp +include/boost/mpl/vector/aux_/begin_end.hpp +include/boost/mpl/vector/aux_/clear.hpp +include/boost/mpl/vector/aux_/empty.hpp +include/boost/mpl/vector/aux_/front.hpp +include/boost/mpl/vector/aux_/include_preprocessed.hpp +include/boost/mpl/vector/aux_/item.hpp +include/boost/mpl/vector/aux_/iterator.hpp +include/boost/mpl/vector/aux_/numbered.hpp +include/boost/mpl/vector/aux_/numbered_c.hpp +include/boost/mpl/vector/aux_/pop_back.hpp +include/boost/mpl/vector/aux_/pop_front.hpp +include/boost/mpl/vector/aux_/push_back.hpp +include/boost/mpl/vector/aux_/push_front.hpp +include/boost/mpl/vector/aux_/size.hpp +include/boost/mpl/vector/aux_/tag.hpp +include/boost/mpl/vector/aux_/vector0.hpp + +# boost/mpl/vector/aux_/preprocessed/no_ctps +include/boost/mpl/vector/aux_/preprocessed/no_ctps/vector10.hpp +include/boost/mpl/vector/aux_/preprocessed/no_ctps/vector10_c.hpp +include/boost/mpl/vector/aux_/preprocessed/no_ctps/vector20.hpp +include/boost/mpl/vector/aux_/preprocessed/no_ctps/vector20_c.hpp +include/boost/mpl/vector/aux_/preprocessed/no_ctps/vector30.hpp +include/boost/mpl/vector/aux_/preprocessed/no_ctps/vector30_c.hpp +include/boost/mpl/vector/aux_/preprocessed/no_ctps/vector40.hpp +include/boost/mpl/vector/aux_/preprocessed/no_ctps/vector40_c.hpp +include/boost/mpl/vector/aux_/preprocessed/no_ctps/vector50.hpp +include/boost/mpl/vector/aux_/preprocessed/no_ctps/vector50_c.hpp + +# boost/mpl/vector/aux_/preprocessed/plain +include/boost/mpl/vector/aux_/preprocessed/plain/vector10.hpp +include/boost/mpl/vector/aux_/preprocessed/plain/vector10_c.hpp +include/boost/mpl/vector/aux_/preprocessed/plain/vector20.hpp +include/boost/mpl/vector/aux_/preprocessed/plain/vector20_c.hpp +include/boost/mpl/vector/aux_/preprocessed/plain/vector30.hpp +include/boost/mpl/vector/aux_/preprocessed/plain/vector30_c.hpp +include/boost/mpl/vector/aux_/preprocessed/plain/vector40.hpp +include/boost/mpl/vector/aux_/preprocessed/plain/vector40_c.hpp +include/boost/mpl/vector/aux_/preprocessed/plain/vector50.hpp +include/boost/mpl/vector/aux_/preprocessed/plain/vector50_c.hpp + +# boost/mpl/vector/aux_/preprocessed/typeof_based +include/boost/mpl/vector/aux_/preprocessed/typeof_based/vector10.hpp +include/boost/mpl/vector/aux_/preprocessed/typeof_based/vector10_c.hpp +include/boost/mpl/vector/aux_/preprocessed/typeof_based/vector20.hpp +include/boost/mpl/vector/aux_/preprocessed/typeof_based/vector20_c.hpp +include/boost/mpl/vector/aux_/preprocessed/typeof_based/vector30.hpp +include/boost/mpl/vector/aux_/preprocessed/typeof_based/vector30_c.hpp +include/boost/mpl/vector/aux_/preprocessed/typeof_based/vector40.hpp +include/boost/mpl/vector/aux_/preprocessed/typeof_based/vector40_c.hpp +include/boost/mpl/vector/aux_/preprocessed/typeof_based/vector50.hpp +include/boost/mpl/vector/aux_/preprocessed/typeof_based/vector50_c.hpp + +# boost/multi_index +include/boost/multi_index/hashed_index.hpp +include/boost/multi_index/hashed_index_fwd.hpp +include/boost/multi_index/identity.hpp +include/boost/multi_index/identity_fwd.hpp +include/boost/multi_index/indexed_by.hpp +include/boost/multi_index/member.hpp +include/boost/multi_index/ordered_index.hpp +include/boost/multi_index/ordered_index_fwd.hpp +include/boost/multi_index/safe_mode_errors.hpp +include/boost/multi_index/sequenced_index.hpp +include/boost/multi_index/sequenced_index_fwd.hpp +include/boost/multi_index/tag.hpp + +# boost/multi_index/detail +include/boost/multi_index/detail/access_specifier.hpp +include/boost/multi_index/detail/adl_swap.hpp +include/boost/multi_index/detail/archive_constructed.hpp +include/boost/multi_index/detail/auto_space.hpp +include/boost/multi_index/detail/base_type.hpp +include/boost/multi_index/detail/bidir_node_iterator.hpp +include/boost/multi_index/detail/bucket_array.hpp +include/boost/multi_index/detail/converter.hpp +include/boost/multi_index/detail/copy_map.hpp +include/boost/multi_index/detail/do_not_copy_elements_tag.hpp +include/boost/multi_index/detail/duplicates_iterator.hpp +include/boost/multi_index/detail/has_tag.hpp +include/boost/multi_index/detail/hash_index_args.hpp +include/boost/multi_index/detail/hash_index_iterator.hpp +include/boost/multi_index/detail/hash_index_node.hpp +include/boost/multi_index/detail/header_holder.hpp +include/boost/multi_index/detail/ignore_wstrict_aliasing.hpp +include/boost/multi_index/detail/index_base.hpp +include/boost/multi_index/detail/index_loader.hpp +include/boost/multi_index/detail/index_matcher.hpp +include/boost/multi_index/detail/index_node_base.hpp +include/boost/multi_index/detail/index_saver.hpp +include/boost/multi_index/detail/invariant_assert.hpp +include/boost/multi_index/detail/is_index_list.hpp +include/boost/multi_index/detail/is_transparent.hpp +include/boost/multi_index/detail/iter_adaptor.hpp +include/boost/multi_index/detail/modify_key_adaptor.hpp +include/boost/multi_index/detail/no_duplicate_tags.hpp +include/boost/multi_index/detail/node_type.hpp +include/boost/multi_index/detail/ord_index_args.hpp +include/boost/multi_index/detail/ord_index_impl.hpp +include/boost/multi_index/detail/ord_index_impl_fwd.hpp +include/boost/multi_index/detail/ord_index_node.hpp +include/boost/multi_index/detail/ord_index_ops.hpp +include/boost/multi_index/detail/promotes_arg.hpp +include/boost/multi_index/detail/raw_ptr.hpp +include/boost/multi_index/detail/restore_wstrict_aliasing.hpp +include/boost/multi_index/detail/safe_mode.hpp +include/boost/multi_index/detail/scope_guard.hpp +include/boost/multi_index/detail/seq_index_node.hpp +include/boost/multi_index/detail/seq_index_ops.hpp +include/boost/multi_index/detail/serialization_version.hpp +include/boost/multi_index/detail/uintptr_type.hpp +include/boost/multi_index/detail/unbounded.hpp +include/boost/multi_index/detail/value_compare.hpp +include/boost/multi_index/detail/vartempl_support.hpp + +# boost/multiprecision +include/boost/multiprecision/cpp_int.hpp +include/boost/multiprecision/number.hpp +include/boost/multiprecision/rational_adaptor.hpp + +# boost/multiprecision/cpp_int +include/boost/multiprecision/cpp_int/add.hpp +include/boost/multiprecision/cpp_int/bitwise.hpp +include/boost/multiprecision/cpp_int/checked.hpp +include/boost/multiprecision/cpp_int/comparison.hpp +include/boost/multiprecision/cpp_int/cpp_int_config.hpp +include/boost/multiprecision/cpp_int/divide.hpp +include/boost/multiprecision/cpp_int/import_export.hpp +include/boost/multiprecision/cpp_int/limits.hpp +include/boost/multiprecision/cpp_int/literals.hpp +include/boost/multiprecision/cpp_int/misc.hpp +include/boost/multiprecision/cpp_int/multiply.hpp +include/boost/multiprecision/cpp_int/serialize.hpp +include/boost/multiprecision/cpp_int/value_pack.hpp + +# boost/multiprecision/detail +include/boost/multiprecision/detail/bitscan.hpp +include/boost/multiprecision/detail/default_ops.hpp +include/boost/multiprecision/detail/et_ops.hpp +include/boost/multiprecision/detail/generic_interconvert.hpp +include/boost/multiprecision/detail/integer_ops.hpp +include/boost/multiprecision/detail/min_max.hpp +include/boost/multiprecision/detail/no_et_ops.hpp +include/boost/multiprecision/detail/number_base.hpp +include/boost/multiprecision/detail/number_compare.hpp +include/boost/multiprecision/detail/ublas_interop.hpp + +# boost/multiprecision/detail/functions +include/boost/multiprecision/detail/functions/constants.hpp +include/boost/multiprecision/detail/functions/pow.hpp +include/boost/multiprecision/detail/functions/trig.hpp + +# boost/multiprecision/traits +include/boost/multiprecision/traits/explicit_conversion.hpp +include/boost/multiprecision/traits/is_backend.hpp +include/boost/multiprecision/traits/is_byte_container.hpp +include/boost/multiprecision/traits/is_restricted_conversion.hpp + +# boost/numeric/conversion +include/boost/numeric/conversion/bounds.hpp +include/boost/numeric/conversion/cast.hpp +include/boost/numeric/conversion/conversion_traits.hpp +include/boost/numeric/conversion/converter.hpp +include/boost/numeric/conversion/converter_policies.hpp +include/boost/numeric/conversion/int_float_mixture_enum.hpp +include/boost/numeric/conversion/numeric_cast_traits.hpp +include/boost/numeric/conversion/sign_mixture_enum.hpp +include/boost/numeric/conversion/udt_builtin_mixture_enum.hpp + +# boost/numeric/conversion/detail +include/boost/numeric/conversion/detail/bounds.hpp +include/boost/numeric/conversion/detail/conversion_traits.hpp +include/boost/numeric/conversion/detail/converter.hpp +include/boost/numeric/conversion/detail/int_float_mixture.hpp +include/boost/numeric/conversion/detail/is_subranged.hpp +include/boost/numeric/conversion/detail/meta.hpp +include/boost/numeric/conversion/detail/numeric_cast_traits.hpp +include/boost/numeric/conversion/detail/old_numeric_cast.hpp +include/boost/numeric/conversion/detail/sign_mixture.hpp +include/boost/numeric/conversion/detail/udt_builtin_mixture.hpp + +# boost/numeric/conversion/detail/preprocessed +include/boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_common.hpp +include/boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_long_long.hpp + +# boost/optional +include/boost/optional/bad_optional_access.hpp +include/boost/optional/optional.hpp +include/boost/optional/optional_fwd.hpp +include/boost/optional/optional_io.hpp + +# boost/optional/detail +include/boost/optional/detail/old_optional_implementation.hpp +include/boost/optional/detail/optional_aligned_storage.hpp +include/boost/optional/detail/optional_config.hpp +include/boost/optional/detail/optional_factory_support.hpp +include/boost/optional/detail/optional_reference_spec.hpp +include/boost/optional/detail/optional_relops.hpp +include/boost/optional/detail/optional_swap.hpp + +# boost/parameter +include/boost/parameter/binding.hpp +include/boost/parameter/config.hpp +include/boost/parameter/keyword.hpp +include/boost/parameter/macros.hpp +include/boost/parameter/match.hpp +include/boost/parameter/name.hpp +include/boost/parameter/parameters.hpp +include/boost/parameter/preprocessor.hpp +include/boost/parameter/value_type.hpp + +# boost/parameter/aux_ +include/boost/parameter/aux_/arg_list.hpp +include/boost/parameter/aux_/cast.hpp +include/boost/parameter/aux_/default.hpp +include/boost/parameter/aux_/is_maybe.hpp +include/boost/parameter/aux_/overloads.hpp +include/boost/parameter/aux_/parameter_requirements.hpp +include/boost/parameter/aux_/parenthesized_type.hpp +include/boost/parameter/aux_/result_of0.hpp +include/boost/parameter/aux_/set.hpp +include/boost/parameter/aux_/tag.hpp +include/boost/parameter/aux_/tagged_argument.hpp +include/boost/parameter/aux_/template_keyword.hpp +include/boost/parameter/aux_/unwrap_cv_reference.hpp +include/boost/parameter/aux_/void.hpp +include/boost/parameter/aux_/yesno.hpp + +# boost/parameter/aux_/preprocessor +include/boost/parameter/aux_/preprocessor/flatten.hpp +include/boost/parameter/aux_/preprocessor/for_each.hpp + +# boost/phoenix +include/boost/phoenix/config.hpp +include/boost/phoenix/core.hpp +include/boost/phoenix/function.hpp +include/boost/phoenix/operator.hpp +include/boost/phoenix/version.hpp + +# boost/phoenix/core +include/boost/phoenix/core/actor.hpp +include/boost/phoenix/core/argument.hpp +include/boost/phoenix/core/as_actor.hpp +include/boost/phoenix/core/call.hpp +include/boost/phoenix/core/debug.hpp +include/boost/phoenix/core/domain.hpp +include/boost/phoenix/core/environment.hpp +include/boost/phoenix/core/expression.hpp +include/boost/phoenix/core/function_equal.hpp +include/boost/phoenix/core/is_actor.hpp +include/boost/phoenix/core/is_nullary.hpp +include/boost/phoenix/core/is_value.hpp +include/boost/phoenix/core/limits.hpp +include/boost/phoenix/core/meta_grammar.hpp +include/boost/phoenix/core/nothing.hpp +include/boost/phoenix/core/reference.hpp +include/boost/phoenix/core/terminal.hpp +include/boost/phoenix/core/terminal_fwd.hpp +include/boost/phoenix/core/v2_eval.hpp +include/boost/phoenix/core/value.hpp +include/boost/phoenix/core/visit_each.hpp + +# boost/phoenix/core/detail +include/boost/phoenix/core/detail/argument.hpp +include/boost/phoenix/core/detail/expression.hpp +include/boost/phoenix/core/detail/function_eval.hpp +include/boost/phoenix/core/detail/index_sequence.hpp +include/boost/phoenix/core/detail/phx2_result.hpp + +# boost/phoenix/core/detail/cpp03 +include/boost/phoenix/core/detail/cpp03/actor_operator.hpp +include/boost/phoenix/core/detail/cpp03/actor_result_of.hpp +include/boost/phoenix/core/detail/cpp03/assign.hpp +include/boost/phoenix/core/detail/cpp03/call.hpp +include/boost/phoenix/core/detail/cpp03/expression.hpp +include/boost/phoenix/core/detail/cpp03/function_equal.hpp +include/boost/phoenix/core/detail/cpp03/function_eval.hpp +include/boost/phoenix/core/detail/cpp03/function_eval_expr.hpp +include/boost/phoenix/core/detail/cpp03/phx2_result.hpp + +# boost/phoenix/core/detail/cpp03/preprocessed +include/boost/phoenix/core/detail/cpp03/preprocessed/actor_operator.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/actor_operator_10.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/actor_operator_20.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/actor_operator_30.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/actor_operator_40.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/actor_operator_50.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/actor_result_of.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/actor_result_of_10.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/actor_result_of_20.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/actor_result_of_30.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/actor_result_of_40.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/actor_result_of_50.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/argument.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/argument_no_predefined_10.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/argument_predefined_10.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/assign.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/assign_10.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/assign_20.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/assign_30.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/assign_40.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/assign_50.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/call.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/call_10.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/call_20.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/call_30.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/call_40.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/call_50.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/expression.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/expression_10.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/expression_20.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/expression_30.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/expression_40.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/expression_50.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/function_equal.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/function_equal_10.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/function_equal_20.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/function_equal_30.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/function_equal_40.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/function_equal_50.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/function_eval.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/function_eval_10.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/function_eval_20.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/function_eval_30.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/function_eval_40.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/function_eval_50.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/function_eval_expr.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/function_eval_expr_10.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/function_eval_expr_20.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/function_eval_expr_30.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/function_eval_expr_40.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/function_eval_expr_50.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/phx2_result.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/phx2_result_10.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/phx2_result_20.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/phx2_result_30.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/phx2_result_40.hpp +include/boost/phoenix/core/detail/cpp03/preprocessed/phx2_result_50.hpp + +# boost/phoenix/function +include/boost/phoenix/function/adapt_callable.hpp +include/boost/phoenix/function/adapt_function.hpp +include/boost/phoenix/function/function.hpp + +# boost/phoenix/function/detail/cpp03 +include/boost/phoenix/function/detail/cpp03/function_operator.hpp + +# boost/phoenix/function/detail/cpp03/preprocessed +include/boost/phoenix/function/detail/cpp03/preprocessed/function_operator.hpp +include/boost/phoenix/function/detail/cpp03/preprocessed/function_operator_10.hpp +include/boost/phoenix/function/detail/cpp03/preprocessed/function_operator_20.hpp +include/boost/phoenix/function/detail/cpp03/preprocessed/function_operator_30.hpp +include/boost/phoenix/function/detail/cpp03/preprocessed/function_operator_40.hpp +include/boost/phoenix/function/detail/cpp03/preprocessed/function_operator_50.hpp + +# boost/phoenix/operator +include/boost/phoenix/operator/arithmetic.hpp +include/boost/phoenix/operator/bitwise.hpp +include/boost/phoenix/operator/comparison.hpp +include/boost/phoenix/operator/if_else.hpp +include/boost/phoenix/operator/io.hpp +include/boost/phoenix/operator/logical.hpp +include/boost/phoenix/operator/member.hpp +include/boost/phoenix/operator/self.hpp + +# boost/phoenix/operator/detail +include/boost/phoenix/operator/detail/define_operator.hpp +include/boost/phoenix/operator/detail/undef_operator.hpp + +# boost/phoenix/operator/detail/cpp03 +include/boost/phoenix/operator/detail/cpp03/mem_fun_ptr_eval.hpp +include/boost/phoenix/operator/detail/cpp03/mem_fun_ptr_eval_result_of.hpp +include/boost/phoenix/operator/detail/cpp03/mem_fun_ptr_expr.hpp +include/boost/phoenix/operator/detail/cpp03/mem_fun_ptr_gen.hpp + +# boost/phoenix/operator/detail/cpp03/preprocessed +include/boost/phoenix/operator/detail/cpp03/preprocessed/mem_fun_ptr_eval.hpp +include/boost/phoenix/operator/detail/cpp03/preprocessed/mem_fun_ptr_eval_10.hpp +include/boost/phoenix/operator/detail/cpp03/preprocessed/mem_fun_ptr_eval_20.hpp +include/boost/phoenix/operator/detail/cpp03/preprocessed/mem_fun_ptr_eval_30.hpp +include/boost/phoenix/operator/detail/cpp03/preprocessed/mem_fun_ptr_eval_40.hpp +include/boost/phoenix/operator/detail/cpp03/preprocessed/mem_fun_ptr_eval_50.hpp +include/boost/phoenix/operator/detail/cpp03/preprocessed/mem_fun_ptr_expr.hpp +include/boost/phoenix/operator/detail/cpp03/preprocessed/mem_fun_ptr_expr_10.hpp +include/boost/phoenix/operator/detail/cpp03/preprocessed/mem_fun_ptr_expr_20.hpp +include/boost/phoenix/operator/detail/cpp03/preprocessed/mem_fun_ptr_expr_30.hpp +include/boost/phoenix/operator/detail/cpp03/preprocessed/mem_fun_ptr_expr_40.hpp +include/boost/phoenix/operator/detail/cpp03/preprocessed/mem_fun_ptr_expr_50.hpp +include/boost/phoenix/operator/detail/cpp03/preprocessed/mem_fun_ptr_gen.hpp +include/boost/phoenix/operator/detail/cpp03/preprocessed/mem_fun_ptr_gen_10.hpp +include/boost/phoenix/operator/detail/cpp03/preprocessed/mem_fun_ptr_gen_20.hpp +include/boost/phoenix/operator/detail/cpp03/preprocessed/mem_fun_ptr_gen_30.hpp +include/boost/phoenix/operator/detail/cpp03/preprocessed/mem_fun_ptr_gen_40.hpp +include/boost/phoenix/operator/detail/cpp03/preprocessed/mem_fun_ptr_gen_50.hpp + +# boost/phoenix/scope +include/boost/phoenix/scope/local_variable.hpp +include/boost/phoenix/scope/scoped_environment.hpp + +# boost/phoenix/scope/detail +include/boost/phoenix/scope/detail/local_variable.hpp + +# boost/phoenix/statement +include/boost/phoenix/statement/sequence.hpp + +# boost/phoenix/support +include/boost/phoenix/support/iterate.hpp +include/boost/phoenix/support/vector.hpp + +# boost/phoenix/support/detail +include/boost/phoenix/support/detail/iterate.hpp +include/boost/phoenix/support/detail/iterate_define.hpp +include/boost/phoenix/support/detail/iterate_undef.hpp + +# boost/phoenix/support/preprocessed +include/boost/phoenix/support/preprocessed/vector.hpp +include/boost/phoenix/support/preprocessed/vector_10.hpp +include/boost/phoenix/support/preprocessed/vector_20.hpp +include/boost/phoenix/support/preprocessed/vector_30.hpp +include/boost/phoenix/support/preprocessed/vector_40.hpp +include/boost/phoenix/support/preprocessed/vector_50.hpp + +# boost/phoenix/support/preprocessor +include/boost/phoenix/support/preprocessor/round.hpp + +# boost/predef +include/boost/predef/architecture.h +include/boost/predef/compiler.h +include/boost/predef/hardware.h +include/boost/predef/language.h +include/boost/predef/library.h +include/boost/predef/make.h +include/boost/predef/os.h +include/boost/predef/other.h +include/boost/predef/platform.h +include/boost/predef/version.h +include/boost/predef/version_number.h + +# boost/predef/architecture +include/boost/predef/architecture/alpha.h +include/boost/predef/architecture/arm.h +include/boost/predef/architecture/blackfin.h +include/boost/predef/architecture/convex.h +include/boost/predef/architecture/ia64.h +include/boost/predef/architecture/m68k.h +include/boost/predef/architecture/mips.h +include/boost/predef/architecture/parisc.h +include/boost/predef/architecture/ppc.h +include/boost/predef/architecture/pyramid.h +include/boost/predef/architecture/rs6k.h +include/boost/predef/architecture/sparc.h +include/boost/predef/architecture/superh.h +include/boost/predef/architecture/sys370.h +include/boost/predef/architecture/sys390.h +include/boost/predef/architecture/x86.h +include/boost/predef/architecture/z.h + +# boost/predef/architecture/x86 +include/boost/predef/architecture/x86/32.h +include/boost/predef/architecture/x86/64.h + +# boost/predef/compiler +include/boost/predef/compiler/borland.h +include/boost/predef/compiler/clang.h +include/boost/predef/compiler/comeau.h +include/boost/predef/compiler/compaq.h +include/boost/predef/compiler/diab.h +include/boost/predef/compiler/digitalmars.h +include/boost/predef/compiler/dignus.h +include/boost/predef/compiler/edg.h +include/boost/predef/compiler/ekopath.h +include/boost/predef/compiler/gcc.h +include/boost/predef/compiler/gcc_xml.h +include/boost/predef/compiler/greenhills.h +include/boost/predef/compiler/hp_acc.h +include/boost/predef/compiler/iar.h +include/boost/predef/compiler/ibm.h +include/boost/predef/compiler/intel.h +include/boost/predef/compiler/kai.h +include/boost/predef/compiler/llvm.h +include/boost/predef/compiler/metaware.h +include/boost/predef/compiler/metrowerks.h +include/boost/predef/compiler/microtec.h +include/boost/predef/compiler/mpw.h +include/boost/predef/compiler/palm.h +include/boost/predef/compiler/pgi.h +include/boost/predef/compiler/sgi_mipspro.h +include/boost/predef/compiler/sunpro.h +include/boost/predef/compiler/tendra.h +include/boost/predef/compiler/visualc.h +include/boost/predef/compiler/watcom.h + +# boost/predef/detail +include/boost/predef/detail/_cassert.h +include/boost/predef/detail/_exception.h +include/boost/predef/detail/comp_detected.h +include/boost/predef/detail/endian_compat.h +include/boost/predef/detail/os_detected.h +include/boost/predef/detail/platform_detected.h +include/boost/predef/detail/test.h + +# boost/predef/hardware +include/boost/predef/hardware/simd.h + +# boost/predef/hardware/simd +include/boost/predef/hardware/simd/arm.h +include/boost/predef/hardware/simd/ppc.h +include/boost/predef/hardware/simd/x86.h +include/boost/predef/hardware/simd/x86_amd.h + +# boost/predef/hardware/simd/arm +include/boost/predef/hardware/simd/arm/versions.h + +# boost/predef/hardware/simd/ppc +include/boost/predef/hardware/simd/ppc/versions.h + +# boost/predef/hardware/simd/x86 +include/boost/predef/hardware/simd/x86/versions.h + +# boost/predef/hardware/simd/x86_amd +include/boost/predef/hardware/simd/x86_amd/versions.h + +# boost/predef/language +include/boost/predef/language/objc.h +include/boost/predef/language/stdc.h +include/boost/predef/language/stdcpp.h + +# boost/predef/library +include/boost/predef/library/c.h +include/boost/predef/library/std.h + +# boost/predef/library/c +include/boost/predef/library/c/_prefix.h +include/boost/predef/library/c/gnu.h +include/boost/predef/library/c/uc.h +include/boost/predef/library/c/vms.h +include/boost/predef/library/c/zos.h + +# boost/predef/library/std +include/boost/predef/library/std/_prefix.h +include/boost/predef/library/std/cxx.h +include/boost/predef/library/std/dinkumware.h +include/boost/predef/library/std/libcomo.h +include/boost/predef/library/std/modena.h +include/boost/predef/library/std/msl.h +include/boost/predef/library/std/roguewave.h +include/boost/predef/library/std/sgi.h +include/boost/predef/library/std/stdcpp3.h +include/boost/predef/library/std/stlport.h +include/boost/predef/library/std/vacpp.h + +# boost/predef/os +include/boost/predef/os/aix.h +include/boost/predef/os/amigaos.h +include/boost/predef/os/android.h +include/boost/predef/os/beos.h +include/boost/predef/os/bsd.h +include/boost/predef/os/cygwin.h +include/boost/predef/os/haiku.h +include/boost/predef/os/hpux.h +include/boost/predef/os/ios.h +include/boost/predef/os/irix.h +include/boost/predef/os/linux.h +include/boost/predef/os/macos.h +include/boost/predef/os/os400.h +include/boost/predef/os/qnxnto.h +include/boost/predef/os/solaris.h +include/boost/predef/os/unix.h +include/boost/predef/os/vms.h +include/boost/predef/os/windows.h + +# boost/predef/os/bsd +include/boost/predef/os/bsd/bsdi.h +include/boost/predef/os/bsd/dragonfly.h +include/boost/predef/os/bsd/free.h +include/boost/predef/os/bsd/net.h +include/boost/predef/os/bsd/open.h + +# boost/predef/other +include/boost/predef/other/endian.h + +# boost/predef/platform +include/boost/predef/platform/ios.h +include/boost/predef/platform/mingw.h +include/boost/predef/platform/windows_desktop.h +include/boost/predef/platform/windows_phone.h +include/boost/predef/platform/windows_runtime.h +include/boost/predef/platform/windows_store.h + +# boost/preprocessor +include/boost/preprocessor/cat.hpp +include/boost/preprocessor/comma_if.hpp +include/boost/preprocessor/dec.hpp +include/boost/preprocessor/empty.hpp +include/boost/preprocessor/enum.hpp +include/boost/preprocessor/enum_params.hpp +include/boost/preprocessor/enum_params_with_a_default.hpp +include/boost/preprocessor/enum_shifted_params.hpp +include/boost/preprocessor/expand.hpp +include/boost/preprocessor/expr_if.hpp +include/boost/preprocessor/for.hpp +include/boost/preprocessor/identity.hpp +include/boost/preprocessor/if.hpp +include/boost/preprocessor/inc.hpp +include/boost/preprocessor/iterate.hpp +include/boost/preprocessor/repeat.hpp +include/boost/preprocessor/repeat_from_to.hpp +include/boost/preprocessor/stringize.hpp +include/boost/preprocessor/tuple.hpp + +# boost/preprocessor/arithmetic +include/boost/preprocessor/arithmetic/add.hpp +include/boost/preprocessor/arithmetic/dec.hpp +include/boost/preprocessor/arithmetic/inc.hpp +include/boost/preprocessor/arithmetic/mod.hpp +include/boost/preprocessor/arithmetic/sub.hpp + +# boost/preprocessor/arithmetic/detail +include/boost/preprocessor/arithmetic/detail/div_base.hpp + +# boost/preprocessor/array +include/boost/preprocessor/array/data.hpp +include/boost/preprocessor/array/elem.hpp +include/boost/preprocessor/array/insert.hpp +include/boost/preprocessor/array/pop_back.hpp +include/boost/preprocessor/array/pop_front.hpp +include/boost/preprocessor/array/push_back.hpp +include/boost/preprocessor/array/push_front.hpp +include/boost/preprocessor/array/remove.hpp +include/boost/preprocessor/array/replace.hpp +include/boost/preprocessor/array/size.hpp +include/boost/preprocessor/array/to_tuple.hpp + +# boost/preprocessor/array/detail +include/boost/preprocessor/array/detail/get_data.hpp + +# boost/preprocessor/comparison +include/boost/preprocessor/comparison/equal.hpp +include/boost/preprocessor/comparison/greater.hpp +include/boost/preprocessor/comparison/less.hpp +include/boost/preprocessor/comparison/less_equal.hpp +include/boost/preprocessor/comparison/not_equal.hpp + +# boost/preprocessor/config +include/boost/preprocessor/config/config.hpp + +# boost/preprocessor/control +include/boost/preprocessor/control/deduce_d.hpp +include/boost/preprocessor/control/expr_if.hpp +include/boost/preprocessor/control/expr_iif.hpp +include/boost/preprocessor/control/if.hpp +include/boost/preprocessor/control/iif.hpp +include/boost/preprocessor/control/while.hpp + +# boost/preprocessor/control/detail +include/boost/preprocessor/control/detail/while.hpp + +# boost/preprocessor/control/detail/dmc +include/boost/preprocessor/control/detail/dmc/while.hpp + +# boost/preprocessor/control/detail/edg +include/boost/preprocessor/control/detail/edg/while.hpp + +# boost/preprocessor/control/detail/msvc +include/boost/preprocessor/control/detail/msvc/while.hpp + +# boost/preprocessor/debug +include/boost/preprocessor/debug/error.hpp +include/boost/preprocessor/debug/line.hpp + +# boost/preprocessor/detail +include/boost/preprocessor/detail/auto_rec.hpp +include/boost/preprocessor/detail/check.hpp +include/boost/preprocessor/detail/is_binary.hpp +include/boost/preprocessor/detail/is_nullary.hpp +include/boost/preprocessor/detail/is_unary.hpp +include/boost/preprocessor/detail/split.hpp + +# boost/preprocessor/detail/dmc +include/boost/preprocessor/detail/dmc/auto_rec.hpp + +# boost/preprocessor/facilities +include/boost/preprocessor/facilities/empty.hpp +include/boost/preprocessor/facilities/expand.hpp +include/boost/preprocessor/facilities/identity.hpp +include/boost/preprocessor/facilities/intercept.hpp +include/boost/preprocessor/facilities/is_1.hpp +include/boost/preprocessor/facilities/is_empty.hpp +include/boost/preprocessor/facilities/is_empty_variadic.hpp +include/boost/preprocessor/facilities/overload.hpp + +# boost/preprocessor/facilities/detail +include/boost/preprocessor/facilities/detail/is_empty.hpp + +# boost/preprocessor/iteration +include/boost/preprocessor/iteration/iterate.hpp +include/boost/preprocessor/iteration/local.hpp +include/boost/preprocessor/iteration/self.hpp + +# boost/preprocessor/iteration/detail +include/boost/preprocessor/iteration/detail/finish.hpp +include/boost/preprocessor/iteration/detail/local.hpp +include/boost/preprocessor/iteration/detail/rlocal.hpp +include/boost/preprocessor/iteration/detail/self.hpp +include/boost/preprocessor/iteration/detail/start.hpp + +# boost/preprocessor/iteration/detail/bounds +include/boost/preprocessor/iteration/detail/bounds/lower1.hpp +include/boost/preprocessor/iteration/detail/bounds/lower2.hpp +include/boost/preprocessor/iteration/detail/bounds/lower3.hpp +include/boost/preprocessor/iteration/detail/bounds/lower4.hpp +include/boost/preprocessor/iteration/detail/bounds/lower5.hpp +include/boost/preprocessor/iteration/detail/bounds/upper1.hpp +include/boost/preprocessor/iteration/detail/bounds/upper2.hpp +include/boost/preprocessor/iteration/detail/bounds/upper3.hpp +include/boost/preprocessor/iteration/detail/bounds/upper4.hpp +include/boost/preprocessor/iteration/detail/bounds/upper5.hpp + +# boost/preprocessor/iteration/detail/iter +include/boost/preprocessor/iteration/detail/iter/forward1.hpp +include/boost/preprocessor/iteration/detail/iter/forward2.hpp +include/boost/preprocessor/iteration/detail/iter/forward3.hpp +include/boost/preprocessor/iteration/detail/iter/forward4.hpp +include/boost/preprocessor/iteration/detail/iter/forward5.hpp +include/boost/preprocessor/iteration/detail/iter/reverse1.hpp +include/boost/preprocessor/iteration/detail/iter/reverse2.hpp +include/boost/preprocessor/iteration/detail/iter/reverse3.hpp +include/boost/preprocessor/iteration/detail/iter/reverse4.hpp +include/boost/preprocessor/iteration/detail/iter/reverse5.hpp + +# boost/preprocessor/list +include/boost/preprocessor/list/adt.hpp +include/boost/preprocessor/list/fold_left.hpp +include/boost/preprocessor/list/fold_right.hpp +include/boost/preprocessor/list/for_each_i.hpp +include/boost/preprocessor/list/reverse.hpp + +# boost/preprocessor/list/detail +include/boost/preprocessor/list/detail/fold_left.hpp +include/boost/preprocessor/list/detail/fold_right.hpp + +# boost/preprocessor/list/detail/dmc +include/boost/preprocessor/list/detail/dmc/fold_left.hpp + +# boost/preprocessor/list/detail/edg +include/boost/preprocessor/list/detail/edg/fold_left.hpp +include/boost/preprocessor/list/detail/edg/fold_right.hpp + +# boost/preprocessor/logical +include/boost/preprocessor/logical/and.hpp +include/boost/preprocessor/logical/bitand.hpp +include/boost/preprocessor/logical/bitor.hpp +include/boost/preprocessor/logical/bool.hpp +include/boost/preprocessor/logical/compl.hpp +include/boost/preprocessor/logical/not.hpp +include/boost/preprocessor/logical/or.hpp + +# boost/preprocessor/punctuation +include/boost/preprocessor/punctuation/comma.hpp +include/boost/preprocessor/punctuation/comma_if.hpp +include/boost/preprocessor/punctuation/is_begin_parens.hpp +include/boost/preprocessor/punctuation/paren.hpp + +# boost/preprocessor/punctuation/detail +include/boost/preprocessor/punctuation/detail/is_begin_parens.hpp + +# boost/preprocessor/repetition +include/boost/preprocessor/repetition/deduce_r.hpp +include/boost/preprocessor/repetition/deduce_z.hpp +include/boost/preprocessor/repetition/enum.hpp +include/boost/preprocessor/repetition/enum_binary_params.hpp +include/boost/preprocessor/repetition/enum_params.hpp +include/boost/preprocessor/repetition/enum_params_with_a_default.hpp +include/boost/preprocessor/repetition/enum_shifted.hpp +include/boost/preprocessor/repetition/enum_shifted_params.hpp +include/boost/preprocessor/repetition/enum_trailing.hpp +include/boost/preprocessor/repetition/enum_trailing_binary_params.hpp +include/boost/preprocessor/repetition/enum_trailing_params.hpp +include/boost/preprocessor/repetition/for.hpp +include/boost/preprocessor/repetition/repeat.hpp +include/boost/preprocessor/repetition/repeat_from_to.hpp + +# boost/preprocessor/repetition/detail +include/boost/preprocessor/repetition/detail/for.hpp + +# boost/preprocessor/repetition/detail/dmc +include/boost/preprocessor/repetition/detail/dmc/for.hpp + +# boost/preprocessor/repetition/detail/edg +include/boost/preprocessor/repetition/detail/edg/for.hpp + +# boost/preprocessor/repetition/detail/msvc +include/boost/preprocessor/repetition/detail/msvc/for.hpp + +# boost/preprocessor/selection +include/boost/preprocessor/selection/max.hpp + +# boost/preprocessor/seq +include/boost/preprocessor/seq/cat.hpp +include/boost/preprocessor/seq/elem.hpp +include/boost/preprocessor/seq/enum.hpp +include/boost/preprocessor/seq/first_n.hpp +include/boost/preprocessor/seq/fold_left.hpp +include/boost/preprocessor/seq/for_each.hpp +include/boost/preprocessor/seq/for_each_i.hpp +include/boost/preprocessor/seq/for_each_product.hpp +include/boost/preprocessor/seq/pop_back.hpp +include/boost/preprocessor/seq/push_back.hpp +include/boost/preprocessor/seq/push_front.hpp +include/boost/preprocessor/seq/rest_n.hpp +include/boost/preprocessor/seq/reverse.hpp +include/boost/preprocessor/seq/seq.hpp +include/boost/preprocessor/seq/size.hpp +include/boost/preprocessor/seq/subseq.hpp +include/boost/preprocessor/seq/to_tuple.hpp +include/boost/preprocessor/seq/transform.hpp + +# boost/preprocessor/seq/detail +include/boost/preprocessor/seq/detail/is_empty.hpp +include/boost/preprocessor/seq/detail/split.hpp + +# boost/preprocessor/slot +include/boost/preprocessor/slot/slot.hpp + +# boost/preprocessor/slot/detail +include/boost/preprocessor/slot/detail/counter.hpp +include/boost/preprocessor/slot/detail/def.hpp +include/boost/preprocessor/slot/detail/shared.hpp +include/boost/preprocessor/slot/detail/slot1.hpp +include/boost/preprocessor/slot/detail/slot2.hpp +include/boost/preprocessor/slot/detail/slot3.hpp +include/boost/preprocessor/slot/detail/slot4.hpp +include/boost/preprocessor/slot/detail/slot5.hpp + +# boost/preprocessor/tuple +include/boost/preprocessor/tuple/eat.hpp +include/boost/preprocessor/tuple/elem.hpp +include/boost/preprocessor/tuple/enum.hpp +include/boost/preprocessor/tuple/insert.hpp +include/boost/preprocessor/tuple/pop_back.hpp +include/boost/preprocessor/tuple/pop_front.hpp +include/boost/preprocessor/tuple/push_back.hpp +include/boost/preprocessor/tuple/push_front.hpp +include/boost/preprocessor/tuple/rem.hpp +include/boost/preprocessor/tuple/remove.hpp +include/boost/preprocessor/tuple/replace.hpp +include/boost/preprocessor/tuple/reverse.hpp +include/boost/preprocessor/tuple/size.hpp +include/boost/preprocessor/tuple/to_array.hpp +include/boost/preprocessor/tuple/to_list.hpp +include/boost/preprocessor/tuple/to_seq.hpp + +# boost/preprocessor/tuple/detail +include/boost/preprocessor/tuple/detail/is_single_return.hpp + +# boost/preprocessor/variadic +include/boost/preprocessor/variadic/elem.hpp +include/boost/preprocessor/variadic/size.hpp +include/boost/preprocessor/variadic/to_seq.hpp + +# boost/program_options +include/boost/program_options/cmdline.hpp +include/boost/program_options/config.hpp +include/boost/program_options/errors.hpp +include/boost/program_options/option.hpp +include/boost/program_options/options_description.hpp +include/boost/program_options/parsers.hpp +include/boost/program_options/positional_options.hpp +include/boost/program_options/value_semantic.hpp +include/boost/program_options/variables_map.hpp +include/boost/program_options/version.hpp + +# boost/program_options/detail +include/boost/program_options/detail/cmdline.hpp +include/boost/program_options/detail/convert.hpp +include/boost/program_options/detail/parsers.hpp +include/boost/program_options/detail/value_semantic.hpp + +# boost/property_tree +include/boost/property_tree/exceptions.hpp +include/boost/property_tree/id_translator.hpp +include/boost/property_tree/json_parser.hpp +include/boost/property_tree/ptree.hpp +include/boost/property_tree/ptree_fwd.hpp +include/boost/property_tree/stream_translator.hpp +include/boost/property_tree/string_path.hpp + +# boost/property_tree/detail +include/boost/property_tree/detail/exception_implementation.hpp +include/boost/property_tree/detail/file_parser_error.hpp +include/boost/property_tree/detail/ptree_implementation.hpp +include/boost/property_tree/detail/ptree_utils.hpp + +# boost/property_tree/json_parser +include/boost/property_tree/json_parser/error.hpp + +# boost/property_tree/json_parser/detail +include/boost/property_tree/json_parser/detail/narrow_encoding.hpp +include/boost/property_tree/json_parser/detail/parser.hpp +include/boost/property_tree/json_parser/detail/read.hpp +include/boost/property_tree/json_parser/detail/standard_callbacks.hpp +include/boost/property_tree/json_parser/detail/wide_encoding.hpp +include/boost/property_tree/json_parser/detail/write.hpp + +# boost/proto +include/boost/proto/args.hpp +include/boost/proto/context.hpp +include/boost/proto/core.hpp +include/boost/proto/debug.hpp +include/boost/proto/deep_copy.hpp +include/boost/proto/domain.hpp +include/boost/proto/eval.hpp +include/boost/proto/expr.hpp +include/boost/proto/extends.hpp +include/boost/proto/functional.hpp +include/boost/proto/fusion.hpp +include/boost/proto/generate.hpp +include/boost/proto/literal.hpp +include/boost/proto/make_expr.hpp +include/boost/proto/matches.hpp +include/boost/proto/operators.hpp +include/boost/proto/proto.hpp +include/boost/proto/proto_fwd.hpp +include/boost/proto/repeat.hpp +include/boost/proto/tags.hpp +include/boost/proto/traits.hpp +include/boost/proto/transform.hpp + +# boost/proto/context +include/boost/proto/context/callable.hpp +include/boost/proto/context/default.hpp +include/boost/proto/context/null.hpp + +# boost/proto/context/detail +include/boost/proto/context/detail/callable_eval.hpp +include/boost/proto/context/detail/default_eval.hpp +include/boost/proto/context/detail/null_eval.hpp + +# boost/proto/context/detail/preprocessed +include/boost/proto/context/detail/preprocessed/callable_eval.hpp +include/boost/proto/context/detail/preprocessed/default_eval.hpp +include/boost/proto/context/detail/preprocessed/null_eval.hpp + +# boost/proto/detail +include/boost/proto/detail/and_n.hpp +include/boost/proto/detail/any.hpp +include/boost/proto/detail/args.hpp +include/boost/proto/detail/as_expr.hpp +include/boost/proto/detail/as_lvalue.hpp +include/boost/proto/detail/basic_expr.hpp +include/boost/proto/detail/class_member_traits.hpp +include/boost/proto/detail/decltype.hpp +include/boost/proto/detail/deduce_domain.hpp +include/boost/proto/detail/deduce_domain_n.hpp +include/boost/proto/detail/deep_copy.hpp +include/boost/proto/detail/deprecated.hpp +include/boost/proto/detail/expr.hpp +include/boost/proto/detail/expr_funop.hpp +include/boost/proto/detail/extends_funop.hpp +include/boost/proto/detail/extends_funop_const.hpp +include/boost/proto/detail/funop.hpp +include/boost/proto/detail/generate_by_value.hpp +include/boost/proto/detail/ignore_unused.hpp +include/boost/proto/detail/is_noncopyable.hpp +include/boost/proto/detail/lambda_matches.hpp +include/boost/proto/detail/local.hpp +include/boost/proto/detail/make_expr.hpp +include/boost/proto/detail/make_expr_.hpp +include/boost/proto/detail/make_expr_funop.hpp +include/boost/proto/detail/matches_.hpp +include/boost/proto/detail/memfun_funop.hpp +include/boost/proto/detail/or_n.hpp +include/boost/proto/detail/poly_function.hpp +include/boost/proto/detail/poly_function_funop.hpp +include/boost/proto/detail/poly_function_traits.hpp +include/boost/proto/detail/remove_typename.hpp +include/boost/proto/detail/static_const.hpp +include/boost/proto/detail/template_arity.hpp +include/boost/proto/detail/template_arity_helper.hpp +include/boost/proto/detail/traits.hpp +include/boost/proto/detail/unpack_expr_.hpp +include/boost/proto/detail/vararg_matches_impl.hpp + +# boost/proto/detail/preprocessed +include/boost/proto/detail/preprocessed/and_n.hpp +include/boost/proto/detail/preprocessed/args.hpp +include/boost/proto/detail/preprocessed/basic_expr.hpp +include/boost/proto/detail/preprocessed/class_member_traits.hpp +include/boost/proto/detail/preprocessed/deduce_domain_n.hpp +include/boost/proto/detail/preprocessed/deep_copy.hpp +include/boost/proto/detail/preprocessed/expr.hpp +include/boost/proto/detail/preprocessed/expr_variadic.hpp +include/boost/proto/detail/preprocessed/extends_funop.hpp +include/boost/proto/detail/preprocessed/extends_funop_const.hpp +include/boost/proto/detail/preprocessed/funop.hpp +include/boost/proto/detail/preprocessed/generate_by_value.hpp +include/boost/proto/detail/preprocessed/lambda_matches.hpp +include/boost/proto/detail/preprocessed/make_expr.hpp +include/boost/proto/detail/preprocessed/make_expr_.hpp +include/boost/proto/detail/preprocessed/make_expr_funop.hpp +include/boost/proto/detail/preprocessed/matches_.hpp +include/boost/proto/detail/preprocessed/memfun_funop.hpp +include/boost/proto/detail/preprocessed/or_n.hpp +include/boost/proto/detail/preprocessed/poly_function_funop.hpp +include/boost/proto/detail/preprocessed/poly_function_traits.hpp +include/boost/proto/detail/preprocessed/template_arity_helper.hpp +include/boost/proto/detail/preprocessed/traits.hpp +include/boost/proto/detail/preprocessed/unpack_expr_.hpp +include/boost/proto/detail/preprocessed/vararg_matches_impl.hpp + +# boost/proto/functional +include/boost/proto/functional/fusion.hpp +include/boost/proto/functional/range.hpp +include/boost/proto/functional/std.hpp + +# boost/proto/functional/fusion +include/boost/proto/functional/fusion/at.hpp +include/boost/proto/functional/fusion/pop_back.hpp +include/boost/proto/functional/fusion/pop_front.hpp +include/boost/proto/functional/fusion/push_back.hpp +include/boost/proto/functional/fusion/push_front.hpp +include/boost/proto/functional/fusion/reverse.hpp + +# boost/proto/functional/range +include/boost/proto/functional/range/begin.hpp +include/boost/proto/functional/range/empty.hpp +include/boost/proto/functional/range/end.hpp +include/boost/proto/functional/range/rbegin.hpp +include/boost/proto/functional/range/rend.hpp +include/boost/proto/functional/range/size.hpp + +# boost/proto/functional/std +include/boost/proto/functional/std/iterator.hpp +include/boost/proto/functional/std/utility.hpp + +# boost/proto/transform +include/boost/proto/transform/arg.hpp +include/boost/proto/transform/call.hpp +include/boost/proto/transform/default.hpp +include/boost/proto/transform/env.hpp +include/boost/proto/transform/fold.hpp +include/boost/proto/transform/fold_tree.hpp +include/boost/proto/transform/impl.hpp +include/boost/proto/transform/integral_c.hpp +include/boost/proto/transform/lazy.hpp +include/boost/proto/transform/make.hpp +include/boost/proto/transform/pass_through.hpp +include/boost/proto/transform/when.hpp + +# boost/proto/transform/detail +include/boost/proto/transform/detail/call.hpp +include/boost/proto/transform/detail/construct_funop.hpp +include/boost/proto/transform/detail/construct_pod_funop.hpp +include/boost/proto/transform/detail/default_function_impl.hpp +include/boost/proto/transform/detail/expand_pack.hpp +include/boost/proto/transform/detail/fold_impl.hpp +include/boost/proto/transform/detail/lazy.hpp +include/boost/proto/transform/detail/make.hpp +include/boost/proto/transform/detail/make_gcc_workaround.hpp +include/boost/proto/transform/detail/pack.hpp +include/boost/proto/transform/detail/pack_impl.hpp +include/boost/proto/transform/detail/pass_through_impl.hpp +include/boost/proto/transform/detail/when.hpp + +# boost/proto/transform/detail/preprocessed +include/boost/proto/transform/detail/preprocessed/call.hpp +include/boost/proto/transform/detail/preprocessed/construct_funop.hpp +include/boost/proto/transform/detail/preprocessed/construct_pod_funop.hpp +include/boost/proto/transform/detail/preprocessed/default_function_impl.hpp +include/boost/proto/transform/detail/preprocessed/expand_pack.hpp +include/boost/proto/transform/detail/preprocessed/fold_impl.hpp +include/boost/proto/transform/detail/preprocessed/lazy.hpp +include/boost/proto/transform/detail/preprocessed/make.hpp +include/boost/proto/transform/detail/preprocessed/make_gcc_workaround.hpp +include/boost/proto/transform/detail/preprocessed/pack_impl.hpp +include/boost/proto/transform/detail/preprocessed/pass_through_impl.hpp +include/boost/proto/transform/detail/preprocessed/when.hpp + +# boost/python +include/boost/python/arg_from_python.hpp +include/boost/python/args.hpp +include/boost/python/args_fwd.hpp +include/boost/python/back_reference.hpp +include/boost/python/base_type_traits.hpp +include/boost/python/bases.hpp +include/boost/python/borrowed.hpp +include/boost/python/call.hpp +include/boost/python/call_method.hpp +include/boost/python/cast.hpp +include/boost/python/class.hpp +include/boost/python/class_fwd.hpp +include/boost/python/copy_const_reference.hpp +include/boost/python/copy_non_const_reference.hpp +include/boost/python/data_members.hpp +include/boost/python/def.hpp +include/boost/python/def_visitor.hpp +include/boost/python/default_call_policies.hpp +include/boost/python/dict.hpp +include/boost/python/docstring_options.hpp +include/boost/python/enum.hpp +include/boost/python/errors.hpp +include/boost/python/exception_translator.hpp +include/boost/python/exec.hpp +include/boost/python/extract.hpp +include/boost/python/handle.hpp +include/boost/python/handle_fwd.hpp +include/boost/python/has_back_reference.hpp +include/boost/python/implicit.hpp +include/boost/python/import.hpp +include/boost/python/init.hpp +include/boost/python/instance_holder.hpp +include/boost/python/iterator.hpp +include/boost/python/list.hpp +include/boost/python/long.hpp +include/boost/python/lvalue_from_pytype.hpp +include/boost/python/make_constructor.hpp +include/boost/python/make_function.hpp +include/boost/python/manage_new_object.hpp +include/boost/python/module.hpp +include/boost/python/module_init.hpp +include/boost/python/object.hpp +include/boost/python/object_attributes.hpp +include/boost/python/object_call.hpp +include/boost/python/object_core.hpp +include/boost/python/object_fwd.hpp +include/boost/python/object_items.hpp +include/boost/python/object_operators.hpp +include/boost/python/object_protocol.hpp +include/boost/python/object_protocol_core.hpp +include/boost/python/object_slices.hpp +include/boost/python/opaque_pointer_converter.hpp +include/boost/python/operators.hpp +include/boost/python/other.hpp +include/boost/python/overloads.hpp +include/boost/python/override.hpp +include/boost/python/pointee.hpp +include/boost/python/proxy.hpp +include/boost/python/ptr.hpp +include/boost/python/pure_virtual.hpp +include/boost/python/raw_function.hpp +include/boost/python/refcount.hpp +include/boost/python/reference_existing_object.hpp +include/boost/python/register_ptr_to_python.hpp +include/boost/python/return_arg.hpp +include/boost/python/return_by_value.hpp +include/boost/python/return_internal_reference.hpp +include/boost/python/return_opaque_pointer.hpp +include/boost/python/return_value_policy.hpp +include/boost/python/scope.hpp +include/boost/python/self.hpp +include/boost/python/signature.hpp +include/boost/python/slice.hpp +include/boost/python/slice_nil.hpp +include/boost/python/ssize_t.hpp +include/boost/python/stl_iterator.hpp +include/boost/python/str.hpp +include/boost/python/tag.hpp +include/boost/python/to_python_converter.hpp +include/boost/python/to_python_indirect.hpp +include/boost/python/to_python_value.hpp +include/boost/python/tuple.hpp +include/boost/python/type_id.hpp +include/boost/python/with_custodian_and_ward.hpp +include/boost/python/wrapper.hpp + +# boost/python/converter +include/boost/python/converter/arg_from_python.hpp +include/boost/python/converter/arg_to_python.hpp +include/boost/python/converter/arg_to_python_base.hpp +include/boost/python/converter/as_to_python_function.hpp +include/boost/python/converter/builtin_converters.hpp +include/boost/python/converter/constructor_function.hpp +include/boost/python/converter/context_result_converter.hpp +include/boost/python/converter/convertible_function.hpp +include/boost/python/converter/from_python.hpp +include/boost/python/converter/implicit.hpp +include/boost/python/converter/obj_mgr_arg_from_python.hpp +include/boost/python/converter/object_manager.hpp +include/boost/python/converter/pointer_type_id.hpp +include/boost/python/converter/pyobject_traits.hpp +include/boost/python/converter/pyobject_type.hpp +include/boost/python/converter/pytype_function.hpp +include/boost/python/converter/pytype_object_mgr_traits.hpp +include/boost/python/converter/registered.hpp +include/boost/python/converter/registered_pointee.hpp +include/boost/python/converter/registrations.hpp +include/boost/python/converter/registry.hpp +include/boost/python/converter/return_from_python.hpp +include/boost/python/converter/rvalue_from_python_data.hpp +include/boost/python/converter/shared_ptr_deleter.hpp +include/boost/python/converter/shared_ptr_from_python.hpp +include/boost/python/converter/shared_ptr_to_python.hpp +include/boost/python/converter/to_python_function_type.hpp + +# boost/python/detail +include/boost/python/detail/borrowed_ptr.hpp +include/boost/python/detail/caller.hpp +include/boost/python/detail/config.hpp +include/boost/python/detail/construct.hpp +include/boost/python/detail/convertible.hpp +include/boost/python/detail/copy_ctor_mutates_rhs.hpp +include/boost/python/detail/cv_category.hpp +include/boost/python/detail/dealloc.hpp +include/boost/python/detail/decref_guard.hpp +include/boost/python/detail/def_helper.hpp +include/boost/python/detail/def_helper_fwd.hpp +include/boost/python/detail/defaults_def.hpp +include/boost/python/detail/defaults_gen.hpp +include/boost/python/detail/dependent.hpp +include/boost/python/detail/destroy.hpp +include/boost/python/detail/exception_handler.hpp +include/boost/python/detail/force_instantiate.hpp +include/boost/python/detail/indirect_traits.hpp +include/boost/python/detail/invoke.hpp +include/boost/python/detail/is_auto_ptr.hpp +include/boost/python/detail/is_shared_ptr.hpp +include/boost/python/detail/is_wrapper.hpp +include/boost/python/detail/is_xxx.hpp +include/boost/python/detail/make_keyword_range_fn.hpp +include/boost/python/detail/make_tuple.hpp +include/boost/python/detail/mpl_lambda.hpp +include/boost/python/detail/msvc_typeinfo.hpp +include/boost/python/detail/none.hpp +include/boost/python/detail/not_specified.hpp +include/boost/python/detail/nullary_function_adaptor.hpp +include/boost/python/detail/operator_id.hpp +include/boost/python/detail/overloads_fwd.hpp +include/boost/python/detail/prefix.hpp +include/boost/python/detail/preprocessor.hpp +include/boost/python/detail/python22_fixed.h +include/boost/python/detail/python_type.hpp +include/boost/python/detail/raw_pyobject.hpp +include/boost/python/detail/referent_storage.hpp +include/boost/python/detail/scope.hpp +include/boost/python/detail/sfinae.hpp +include/boost/python/detail/signature.hpp +include/boost/python/detail/string_literal.hpp +include/boost/python/detail/target.hpp +include/boost/python/detail/translate_exception.hpp +include/boost/python/detail/type_list.hpp +include/boost/python/detail/type_list_impl.hpp +include/boost/python/detail/type_traits.hpp +include/boost/python/detail/unwind_type.hpp +include/boost/python/detail/unwrap_type_id.hpp +include/boost/python/detail/unwrap_wrapper.hpp +include/boost/python/detail/value_arg.hpp +include/boost/python/detail/value_is_shared_ptr.hpp +include/boost/python/detail/value_is_xxx.hpp +include/boost/python/detail/void_ptr.hpp +include/boost/python/detail/void_return.hpp +include/boost/python/detail/wrap_python.hpp +include/boost/python/detail/wrapper_base.hpp + +# boost/python/object +include/boost/python/object/add_to_namespace.hpp +include/boost/python/object/class.hpp +include/boost/python/object/class_detail.hpp +include/boost/python/object/class_metadata.hpp +include/boost/python/object/class_wrapper.hpp +include/boost/python/object/enum_base.hpp +include/boost/python/object/forward.hpp +include/boost/python/object/function.hpp +include/boost/python/object/function_handle.hpp +include/boost/python/object/function_object.hpp +include/boost/python/object/inheritance.hpp +include/boost/python/object/inheritance_query.hpp +include/boost/python/object/instance.hpp +include/boost/python/object/iterator.hpp +include/boost/python/object/iterator_core.hpp +include/boost/python/object/life_support.hpp +include/boost/python/object/make_holder.hpp +include/boost/python/object/make_instance.hpp +include/boost/python/object/make_ptr_instance.hpp +include/boost/python/object/pickle_support.hpp +include/boost/python/object/pointer_holder.hpp +include/boost/python/object/py_function.hpp +include/boost/python/object/stl_iterator_core.hpp +include/boost/python/object/value_holder.hpp +include/boost/python/object/value_holder_fwd.hpp + +# boost/qvm +include/boost/qvm/assert.hpp +include/boost/qvm/deduce_mat.hpp +include/boost/qvm/deduce_scalar.hpp +include/boost/qvm/deduce_vec.hpp +include/boost/qvm/enable_if.hpp +include/boost/qvm/error.hpp +include/boost/qvm/inline.hpp +include/boost/qvm/mat.hpp +include/boost/qvm/mat_access.hpp +include/boost/qvm/mat_operations.hpp +include/boost/qvm/mat_operations2.hpp +include/boost/qvm/mat_operations3.hpp +include/boost/qvm/mat_operations4.hpp +include/boost/qvm/mat_traits.hpp +include/boost/qvm/mat_traits_array.hpp +include/boost/qvm/math.hpp +include/boost/qvm/quat_traits.hpp +include/boost/qvm/scalar_traits.hpp +include/boost/qvm/static_assert.hpp +include/boost/qvm/throw_exception.hpp +include/boost/qvm/vec_traits.hpp + +# boost/qvm/detail +include/boost/qvm/detail/cofactor_impl.hpp +include/boost/qvm/detail/determinant_impl.hpp +include/boost/qvm/detail/mat_assign.hpp +include/boost/qvm/detail/remove_const.hpp +include/boost/qvm/detail/transp_impl.hpp + +# boost/qvm/gen +include/boost/qvm/gen/mat_assign2.hpp +include/boost/qvm/gen/mat_assign3.hpp +include/boost/qvm/gen/mat_assign4.hpp +include/boost/qvm/gen/mat_operations2.hpp +include/boost/qvm/gen/mat_operations3.hpp +include/boost/qvm/gen/mat_operations4.hpp + +# boost/range +include/boost/range/as_literal.hpp +include/boost/range/begin.hpp +include/boost/range/category.hpp +include/boost/range/concepts.hpp +include/boost/range/config.hpp +include/boost/range/const_iterator.hpp +include/boost/range/const_reverse_iterator.hpp +include/boost/range/difference_type.hpp +include/boost/range/distance.hpp +include/boost/range/empty.hpp +include/boost/range/end.hpp +include/boost/range/functions.hpp +include/boost/range/has_range_iterator.hpp +include/boost/range/iterator.hpp +include/boost/range/iterator_range.hpp +include/boost/range/iterator_range_core.hpp +include/boost/range/iterator_range_io.hpp +include/boost/range/metafunctions.hpp +include/boost/range/mutable_iterator.hpp +include/boost/range/pointer.hpp +include/boost/range/range_fwd.hpp +include/boost/range/rbegin.hpp +include/boost/range/reference.hpp +include/boost/range/rend.hpp +include/boost/range/result_iterator.hpp +include/boost/range/reverse_iterator.hpp +include/boost/range/reverse_result_iterator.hpp +include/boost/range/size.hpp +include/boost/range/size_type.hpp +include/boost/range/sub_range.hpp +include/boost/range/value_type.hpp + +# boost/range/adaptor +include/boost/range/adaptor/argument_fwd.hpp +include/boost/range/adaptor/map.hpp +include/boost/range/adaptor/reversed.hpp +include/boost/range/adaptor/transformed.hpp + +# boost/range/algorithm +include/boost/range/algorithm/equal.hpp +include/boost/range/algorithm/remove_if.hpp +include/boost/range/algorithm/reverse.hpp + +# boost/range/detail +include/boost/range/detail/as_literal.hpp +include/boost/range/detail/begin.hpp +include/boost/range/detail/common.hpp +include/boost/range/detail/default_constructible_unary_fn.hpp +include/boost/range/detail/detail_str.hpp +include/boost/range/detail/end.hpp +include/boost/range/detail/extract_optional_type.hpp +include/boost/range/detail/has_member_size.hpp +include/boost/range/detail/implementation_help.hpp +include/boost/range/detail/misc_concept.hpp +include/boost/range/detail/msvc_has_iterator_workaround.hpp +include/boost/range/detail/range_return.hpp +include/boost/range/detail/remove_extent.hpp +include/boost/range/detail/safe_bool.hpp +include/boost/range/detail/sfinae.hpp +include/boost/range/detail/size_type.hpp +include/boost/range/detail/str_types.hpp +include/boost/range/detail/value_type.hpp + +# boost/regex +include/boost/regex/config.hpp +include/boost/regex/pattern_except.hpp +include/boost/regex/regex_traits.hpp +include/boost/regex/user.hpp + +# boost/regex/config +include/boost/regex/config/borland.hpp +include/boost/regex/config/cwchar.hpp + +# boost/regex/pending +include/boost/regex/pending/object_cache.hpp +include/boost/regex/pending/static_mutex.hpp +include/boost/regex/pending/unicode_iterator.hpp + +# boost/regex/v4 +include/boost/regex/v4/basic_regex.hpp +include/boost/regex/v4/basic_regex_creator.hpp +include/boost/regex/v4/basic_regex_parser.hpp +include/boost/regex/v4/c_regex_traits.hpp +include/boost/regex/v4/char_regex_traits.hpp +include/boost/regex/v4/cpp_regex_traits.hpp +include/boost/regex/v4/error_type.hpp +include/boost/regex/v4/instances.hpp +include/boost/regex/v4/iterator_category.hpp +include/boost/regex/v4/iterator_traits.hpp +include/boost/regex/v4/match_flags.hpp +include/boost/regex/v4/match_results.hpp +include/boost/regex/v4/perl_matcher.hpp +include/boost/regex/v4/perl_matcher_common.hpp +include/boost/regex/v4/perl_matcher_non_recursive.hpp +include/boost/regex/v4/perl_matcher_recursive.hpp +include/boost/regex/v4/primary_transform.hpp +include/boost/regex/v4/protected_call.hpp +include/boost/regex/v4/regbase.hpp +include/boost/regex/v4/regex.hpp +include/boost/regex/v4/regex_format.hpp +include/boost/regex/v4/regex_fwd.hpp +include/boost/regex/v4/regex_grep.hpp +include/boost/regex/v4/regex_iterator.hpp +include/boost/regex/v4/regex_match.hpp +include/boost/regex/v4/regex_merge.hpp +include/boost/regex/v4/regex_raw_buffer.hpp +include/boost/regex/v4/regex_replace.hpp +include/boost/regex/v4/regex_search.hpp +include/boost/regex/v4/regex_split.hpp +include/boost/regex/v4/regex_token_iterator.hpp +include/boost/regex/v4/regex_traits.hpp +include/boost/regex/v4/regex_traits_defaults.hpp +include/boost/regex/v4/regex_workaround.hpp +include/boost/regex/v4/states.hpp +include/boost/regex/v4/sub_match.hpp +include/boost/regex/v4/syntax_type.hpp +include/boost/regex/v4/w32_regex_traits.hpp + +# boost/serialization +include/boost/serialization/access.hpp +include/boost/serialization/base_object.hpp +include/boost/serialization/collection_size_type.hpp +include/boost/serialization/force_include.hpp +include/boost/serialization/is_bitwise_serializable.hpp +include/boost/serialization/level.hpp +include/boost/serialization/level_enum.hpp +include/boost/serialization/nvp.hpp +include/boost/serialization/serialization.hpp +include/boost/serialization/split_free.hpp +include/boost/serialization/split_member.hpp +include/boost/serialization/strong_typedef.hpp +include/boost/serialization/tracking.hpp +include/boost/serialization/tracking_enum.hpp +include/boost/serialization/traits.hpp +include/boost/serialization/type_info_implementation.hpp +include/boost/serialization/version.hpp +include/boost/serialization/void_cast_fwd.hpp +include/boost/serialization/wrapper.hpp + +# boost/smart_ptr +include/boost/smart_ptr/allocate_shared_array.hpp +include/boost/smart_ptr/bad_weak_ptr.hpp +include/boost/smart_ptr/make_shared.hpp +include/boost/smart_ptr/make_shared_array.hpp +include/boost/smart_ptr/make_shared_object.hpp +include/boost/smart_ptr/scoped_array.hpp +include/boost/smart_ptr/scoped_ptr.hpp +include/boost/smart_ptr/shared_array.hpp +include/boost/smart_ptr/shared_ptr.hpp + +# boost/smart_ptr/detail +include/boost/smart_ptr/detail/atomic_count.hpp +include/boost/smart_ptr/detail/atomic_count_gcc.hpp +include/boost/smart_ptr/detail/atomic_count_gcc_x86.hpp +include/boost/smart_ptr/detail/atomic_count_nt.hpp +include/boost/smart_ptr/detail/atomic_count_pt.hpp +include/boost/smart_ptr/detail/atomic_count_spin.hpp +include/boost/smart_ptr/detail/atomic_count_std_atomic.hpp +include/boost/smart_ptr/detail/atomic_count_sync.hpp +include/boost/smart_ptr/detail/atomic_count_win32.hpp +include/boost/smart_ptr/detail/lightweight_mutex.hpp +include/boost/smart_ptr/detail/local_counted_base.hpp +include/boost/smart_ptr/detail/local_sp_deleter.hpp +include/boost/smart_ptr/detail/lwm_nop.hpp +include/boost/smart_ptr/detail/lwm_pthreads.hpp +include/boost/smart_ptr/detail/lwm_win32_cs.hpp +include/boost/smart_ptr/detail/operator_bool.hpp +include/boost/smart_ptr/detail/quick_allocator.hpp +include/boost/smart_ptr/detail/shared_count.hpp +include/boost/smart_ptr/detail/sp_convertible.hpp +include/boost/smart_ptr/detail/sp_counted_base.hpp +include/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp +include/boost/smart_ptr/detail/sp_counted_base_aix.hpp +include/boost/smart_ptr/detail/sp_counted_base_clang.hpp +include/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp +include/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp +include/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp +include/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp +include/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp +include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp +include/boost/smart_ptr/detail/sp_counted_base_nt.hpp +include/boost/smart_ptr/detail/sp_counted_base_pt.hpp +include/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp +include/boost/smart_ptr/detail/sp_counted_base_spin.hpp +include/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp +include/boost/smart_ptr/detail/sp_counted_base_sync.hpp +include/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp +include/boost/smart_ptr/detail/sp_counted_base_w32.hpp +include/boost/smart_ptr/detail/sp_counted_impl.hpp +include/boost/smart_ptr/detail/sp_disable_deprecated.hpp +include/boost/smart_ptr/detail/sp_forward.hpp +include/boost/smart_ptr/detail/sp_has_sync.hpp +include/boost/smart_ptr/detail/sp_interlocked.hpp +include/boost/smart_ptr/detail/sp_noexcept.hpp +include/boost/smart_ptr/detail/sp_nullptr_t.hpp +include/boost/smart_ptr/detail/spinlock.hpp +include/boost/smart_ptr/detail/spinlock_gcc_arm.hpp +include/boost/smart_ptr/detail/spinlock_nt.hpp +include/boost/smart_ptr/detail/spinlock_pool.hpp +include/boost/smart_ptr/detail/spinlock_pt.hpp +include/boost/smart_ptr/detail/spinlock_std_atomic.hpp +include/boost/smart_ptr/detail/spinlock_sync.hpp +include/boost/smart_ptr/detail/spinlock_w32.hpp +include/boost/smart_ptr/detail/yield_k.hpp + +# boost/spirit/home +include/boost/spirit/home/qi.hpp + +# boost/spirit/home/qi +include/boost/spirit/home/qi/action.hpp +include/boost/spirit/home/qi/auto.hpp +include/boost/spirit/home/qi/auxiliary.hpp +include/boost/spirit/home/qi/binary.hpp +include/boost/spirit/home/qi/char.hpp +include/boost/spirit/home/qi/copy.hpp +include/boost/spirit/home/qi/directive.hpp +include/boost/spirit/home/qi/domain.hpp +include/boost/spirit/home/qi/meta_compiler.hpp +include/boost/spirit/home/qi/nonterminal.hpp +include/boost/spirit/home/qi/numeric.hpp +include/boost/spirit/home/qi/operator.hpp +include/boost/spirit/home/qi/parse.hpp +include/boost/spirit/home/qi/parse_attr.hpp +include/boost/spirit/home/qi/parser.hpp +include/boost/spirit/home/qi/reference.hpp +include/boost/spirit/home/qi/skip_flag.hpp +include/boost/spirit/home/qi/skip_over.hpp +include/boost/spirit/home/qi/stream.hpp +include/boost/spirit/home/qi/string.hpp +include/boost/spirit/home/qi/what.hpp + +# boost/spirit/home/qi/action +include/boost/spirit/home/qi/action/action.hpp + +# boost/spirit/home/qi/auto +include/boost/spirit/home/qi/auto/auto.hpp +include/boost/spirit/home/qi/auto/create_parser.hpp +include/boost/spirit/home/qi/auto/meta_create.hpp + +# boost/spirit/home/qi/auxiliary +include/boost/spirit/home/qi/auxiliary/attr.hpp +include/boost/spirit/home/qi/auxiliary/attr_cast.hpp +include/boost/spirit/home/qi/auxiliary/eoi.hpp +include/boost/spirit/home/qi/auxiliary/eol.hpp +include/boost/spirit/home/qi/auxiliary/eps.hpp +include/boost/spirit/home/qi/auxiliary/lazy.hpp + +# boost/spirit/home/qi/binary +include/boost/spirit/home/qi/binary/binary.hpp + +# boost/spirit/home/qi/char +include/boost/spirit/home/qi/char/char.hpp +include/boost/spirit/home/qi/char/char_class.hpp +include/boost/spirit/home/qi/char/char_parser.hpp + +# boost/spirit/home/qi/detail +include/boost/spirit/home/qi/detail/alternative_function.hpp +include/boost/spirit/home/qi/detail/assign_to.hpp +include/boost/spirit/home/qi/detail/attributes.hpp +include/boost/spirit/home/qi/detail/construct.hpp +include/boost/spirit/home/qi/detail/enable_lit.hpp +include/boost/spirit/home/qi/detail/expect_function.hpp +include/boost/spirit/home/qi/detail/expectation_failure.hpp +include/boost/spirit/home/qi/detail/fail_function.hpp +include/boost/spirit/home/qi/detail/parse.hpp +include/boost/spirit/home/qi/detail/parse_auto.hpp +include/boost/spirit/home/qi/detail/pass_container.hpp +include/boost/spirit/home/qi/detail/pass_function.hpp +include/boost/spirit/home/qi/detail/permute_function.hpp +include/boost/spirit/home/qi/detail/string_parse.hpp +include/boost/spirit/home/qi/detail/unused_skipper.hpp + +# boost/spirit/home/qi/directive +include/boost/spirit/home/qi/directive/as.hpp +include/boost/spirit/home/qi/directive/encoding.hpp +include/boost/spirit/home/qi/directive/expect.hpp +include/boost/spirit/home/qi/directive/hold.hpp +include/boost/spirit/home/qi/directive/lexeme.hpp +include/boost/spirit/home/qi/directive/matches.hpp +include/boost/spirit/home/qi/directive/no_case.hpp +include/boost/spirit/home/qi/directive/no_skip.hpp +include/boost/spirit/home/qi/directive/omit.hpp +include/boost/spirit/home/qi/directive/raw.hpp +include/boost/spirit/home/qi/directive/repeat.hpp +include/boost/spirit/home/qi/directive/skip.hpp + +# boost/spirit/home/qi/nonterminal +include/boost/spirit/home/qi/nonterminal/debug_handler.hpp +include/boost/spirit/home/qi/nonterminal/debug_handler_state.hpp +include/boost/spirit/home/qi/nonterminal/error_handler.hpp +include/boost/spirit/home/qi/nonterminal/grammar.hpp +include/boost/spirit/home/qi/nonterminal/nonterminal_fwd.hpp +include/boost/spirit/home/qi/nonterminal/rule.hpp +include/boost/spirit/home/qi/nonterminal/simple_trace.hpp +include/boost/spirit/home/qi/nonterminal/success_handler.hpp + +# boost/spirit/home/qi/nonterminal/detail +include/boost/spirit/home/qi/nonterminal/detail/fcall.hpp +include/boost/spirit/home/qi/nonterminal/detail/parameterized.hpp +include/boost/spirit/home/qi/nonterminal/detail/parser_binder.hpp + +# boost/spirit/home/qi/numeric +include/boost/spirit/home/qi/numeric/bool.hpp +include/boost/spirit/home/qi/numeric/bool_policies.hpp +include/boost/spirit/home/qi/numeric/int.hpp +include/boost/spirit/home/qi/numeric/numeric_utils.hpp +include/boost/spirit/home/qi/numeric/real.hpp +include/boost/spirit/home/qi/numeric/real_policies.hpp +include/boost/spirit/home/qi/numeric/uint.hpp + +# boost/spirit/home/qi/numeric/detail +include/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp +include/boost/spirit/home/qi/numeric/detail/real_impl.hpp + +# boost/spirit/home/qi/operator +include/boost/spirit/home/qi/operator/alternative.hpp +include/boost/spirit/home/qi/operator/and_predicate.hpp +include/boost/spirit/home/qi/operator/difference.hpp +include/boost/spirit/home/qi/operator/expect.hpp +include/boost/spirit/home/qi/operator/kleene.hpp +include/boost/spirit/home/qi/operator/list.hpp +include/boost/spirit/home/qi/operator/not_predicate.hpp +include/boost/spirit/home/qi/operator/optional.hpp +include/boost/spirit/home/qi/operator/permutation.hpp +include/boost/spirit/home/qi/operator/plus.hpp +include/boost/spirit/home/qi/operator/sequence.hpp +include/boost/spirit/home/qi/operator/sequence_base.hpp +include/boost/spirit/home/qi/operator/sequential_or.hpp + +# boost/spirit/home/qi/stream +include/boost/spirit/home/qi/stream/stream.hpp + +# boost/spirit/home/qi/stream/detail +include/boost/spirit/home/qi/stream/detail/iterator_source.hpp +include/boost/spirit/home/qi/stream/detail/match_manip.hpp + +# boost/spirit/home/qi/string +include/boost/spirit/home/qi/string/lit.hpp +include/boost/spirit/home/qi/string/symbols.hpp +include/boost/spirit/home/qi/string/tst.hpp + +# boost/spirit/home/qi/string/detail +include/boost/spirit/home/qi/string/detail/tst.hpp + +# boost/spirit/home/support +include/boost/spirit/home/support/action_dispatch.hpp +include/boost/spirit/home/support/argument.hpp +include/boost/spirit/home/support/assert_msg.hpp +include/boost/spirit/home/support/attributes.hpp +include/boost/spirit/home/support/attributes_fwd.hpp +include/boost/spirit/home/support/char_class.hpp +include/boost/spirit/home/support/common_terminals.hpp +include/boost/spirit/home/support/container.hpp +include/boost/spirit/home/support/context.hpp +include/boost/spirit/home/support/handles_container.hpp +include/boost/spirit/home/support/has_semantic_action.hpp +include/boost/spirit/home/support/info.hpp +include/boost/spirit/home/support/lazy.hpp +include/boost/spirit/home/support/limits.hpp +include/boost/spirit/home/support/make_component.hpp +include/boost/spirit/home/support/meta_compiler.hpp +include/boost/spirit/home/support/modify.hpp +include/boost/spirit/home/support/multi_pass_wrapper.hpp +include/boost/spirit/home/support/numeric_traits.hpp +include/boost/spirit/home/support/sequence_base_id.hpp +include/boost/spirit/home/support/string_traits.hpp +include/boost/spirit/home/support/terminal.hpp +include/boost/spirit/home/support/terminal_expression.hpp +include/boost/spirit/home/support/unused.hpp +include/boost/spirit/home/support/utf8.hpp + +# boost/spirit/home/support/algorithm +include/boost/spirit/home/support/algorithm/any_if.hpp +include/boost/spirit/home/support/algorithm/any_if_ns.hpp +include/boost/spirit/home/support/algorithm/any_ns.hpp + +# boost/spirit/home/support/auto +include/boost/spirit/home/support/auto/meta_create.hpp + +# boost/spirit/home/support/auxiliary +include/boost/spirit/home/support/auxiliary/attr_cast.hpp + +# boost/spirit/home/support/char_encoding +include/boost/spirit/home/support/char_encoding/ascii.hpp +include/boost/spirit/home/support/char_encoding/iso8859_1.hpp +include/boost/spirit/home/support/char_encoding/standard.hpp +include/boost/spirit/home/support/char_encoding/standard_wide.hpp +include/boost/spirit/home/support/char_encoding/unicode.hpp + +# boost/spirit/home/support/char_encoding/unicode +include/boost/spirit/home/support/char_encoding/unicode/category_table.hpp +include/boost/spirit/home/support/char_encoding/unicode/lowercase_table.hpp +include/boost/spirit/home/support/char_encoding/unicode/query.hpp +include/boost/spirit/home/support/char_encoding/unicode/script_table.hpp +include/boost/spirit/home/support/char_encoding/unicode/uppercase_table.hpp + +# boost/spirit/home/support/char_set +include/boost/spirit/home/support/char_set/basic_chset.hpp +include/boost/spirit/home/support/char_set/range.hpp +include/boost/spirit/home/support/char_set/range_functions.hpp +include/boost/spirit/home/support/char_set/range_run.hpp +include/boost/spirit/home/support/char_set/range_run_impl.hpp + +# boost/spirit/home/support/detail +include/boost/spirit/home/support/detail/as_variant.hpp +include/boost/spirit/home/support/detail/endian.hpp +include/boost/spirit/home/support/detail/get_encoding.hpp +include/boost/spirit/home/support/detail/hold_any.hpp +include/boost/spirit/home/support/detail/is_spirit_tag.hpp +include/boost/spirit/home/support/detail/make_cons.hpp +include/boost/spirit/home/support/detail/make_vector.hpp +include/boost/spirit/home/support/detail/pow10.hpp +include/boost/spirit/home/support/detail/scoped_enum_emulation.hpp +include/boost/spirit/home/support/detail/sign.hpp +include/boost/spirit/home/support/detail/what_function.hpp + +# boost/spirit/home/support/detail/endian +include/boost/spirit/home/support/detail/endian/cover_operators.hpp +include/boost/spirit/home/support/detail/endian/endian.hpp + +# boost/spirit/home/support/detail/math +include/boost/spirit/home/support/detail/math/fpclassify.hpp +include/boost/spirit/home/support/detail/math/signbit.hpp + +# boost/spirit/home/support/detail/math/detail +include/boost/spirit/home/support/detail/math/detail/fp_traits.hpp + +# boost/spirit/home/support/iterators +include/boost/spirit/home/support/iterators/istream_iterator.hpp +include/boost/spirit/home/support/iterators/multi_pass.hpp +include/boost/spirit/home/support/iterators/multi_pass_fwd.hpp + +# boost/spirit/home/support/iterators/detail +include/boost/spirit/home/support/iterators/detail/buf_id_check_policy.hpp +include/boost/spirit/home/support/iterators/detail/combine_policies.hpp +include/boost/spirit/home/support/iterators/detail/istream_policy.hpp +include/boost/spirit/home/support/iterators/detail/multi_pass.hpp +include/boost/spirit/home/support/iterators/detail/no_check_policy.hpp +include/boost/spirit/home/support/iterators/detail/ref_counted_policy.hpp +include/boost/spirit/home/support/iterators/detail/split_std_deque_policy.hpp + +# boost/spirit/home/support/nonterminal +include/boost/spirit/home/support/nonterminal/expand_arg.hpp +include/boost/spirit/home/support/nonterminal/extract_param.hpp +include/boost/spirit/home/support/nonterminal/locals.hpp + +# boost/spirit/home/support/utree +include/boost/spirit/home/support/utree/utree_traits_fwd.hpp + +# boost/spirit/include +include/boost/spirit/include/phoenix_core.hpp +include/boost/spirit/include/phoenix_function.hpp +include/boost/spirit/include/phoenix_limits.hpp +include/boost/spirit/include/phoenix_operator.hpp +include/boost/spirit/include/qi.hpp + +# boost/system +include/boost/system/api_config.hpp +include/boost/system/config.hpp +include/boost/system/error_code.hpp +include/boost/system/system_error.hpp + +# boost/system/detail +include/boost/system/detail/local_free_on_destruction.hpp + +# boost/tuple +include/boost/tuple/tuple.hpp + +# boost/tuple/detail +include/boost/tuple/detail/tuple_basic.hpp + +# boost/type_index +include/boost/type_index/ctti_type_index.hpp +include/boost/type_index/stl_type_index.hpp +include/boost/type_index/type_index_facade.hpp + +# boost/type_index/detail +include/boost/type_index/detail/compile_time_type_info.hpp +include/boost/type_index/detail/ctti_register_class.hpp +include/boost/type_index/detail/stl_register_class.hpp + +# boost/type_traits +include/boost/type_traits/add_const.hpp +include/boost/type_traits/add_cv.hpp +include/boost/type_traits/add_lvalue_reference.hpp +include/boost/type_traits/add_pointer.hpp +include/boost/type_traits/add_reference.hpp +include/boost/type_traits/add_rvalue_reference.hpp +include/boost/type_traits/add_volatile.hpp +include/boost/type_traits/aligned_storage.hpp +include/boost/type_traits/alignment_of.hpp +include/boost/type_traits/alignment_traits.hpp +include/boost/type_traits/common_type.hpp +include/boost/type_traits/composite_traits.hpp +include/boost/type_traits/conditional.hpp +include/boost/type_traits/conversion_traits.hpp +include/boost/type_traits/copy_cv.hpp +include/boost/type_traits/cv_traits.hpp +include/boost/type_traits/decay.hpp +include/boost/type_traits/declval.hpp +include/boost/type_traits/function_traits.hpp +include/boost/type_traits/has_left_shift.hpp +include/boost/type_traits/has_minus.hpp +include/boost/type_traits/has_minus_assign.hpp +include/boost/type_traits/has_nothrow_assign.hpp +include/boost/type_traits/has_nothrow_constructor.hpp +include/boost/type_traits/has_nothrow_copy.hpp +include/boost/type_traits/has_plus.hpp +include/boost/type_traits/has_plus_assign.hpp +include/boost/type_traits/has_right_shift.hpp +include/boost/type_traits/has_trivial_assign.hpp +include/boost/type_traits/has_trivial_constructor.hpp +include/boost/type_traits/has_trivial_copy.hpp +include/boost/type_traits/has_trivial_destructor.hpp +include/boost/type_traits/has_trivial_move_assign.hpp +include/boost/type_traits/has_trivial_move_constructor.hpp +include/boost/type_traits/integral_constant.hpp +include/boost/type_traits/intrinsics.hpp +include/boost/type_traits/is_abstract.hpp +include/boost/type_traits/is_arithmetic.hpp +include/boost/type_traits/is_array.hpp +include/boost/type_traits/is_assignable.hpp +include/boost/type_traits/is_base_and_derived.hpp +include/boost/type_traits/is_base_of.hpp +include/boost/type_traits/is_class.hpp +include/boost/type_traits/is_compound.hpp +include/boost/type_traits/is_const.hpp +include/boost/type_traits/is_constructible.hpp +include/boost/type_traits/is_convertible.hpp +include/boost/type_traits/is_copy_constructible.hpp +include/boost/type_traits/is_default_constructible.hpp +include/boost/type_traits/is_destructible.hpp +include/boost/type_traits/is_empty.hpp +include/boost/type_traits/is_enum.hpp +include/boost/type_traits/is_final.hpp +include/boost/type_traits/is_float.hpp +include/boost/type_traits/is_floating_point.hpp +include/boost/type_traits/is_function.hpp +include/boost/type_traits/is_fundamental.hpp +include/boost/type_traits/is_integral.hpp +include/boost/type_traits/is_lvalue_reference.hpp +include/boost/type_traits/is_member_function_pointer.hpp +include/boost/type_traits/is_member_object_pointer.hpp +include/boost/type_traits/is_member_pointer.hpp +include/boost/type_traits/is_nothrow_move_assignable.hpp +include/boost/type_traits/is_nothrow_move_constructible.hpp +include/boost/type_traits/is_object.hpp +include/boost/type_traits/is_pod.hpp +include/boost/type_traits/is_pointer.hpp +include/boost/type_traits/is_polymorphic.hpp +include/boost/type_traits/is_reference.hpp +include/boost/type_traits/is_rvalue_reference.hpp +include/boost/type_traits/is_same.hpp +include/boost/type_traits/is_scalar.hpp +include/boost/type_traits/is_signed.hpp +include/boost/type_traits/is_stateless.hpp +include/boost/type_traits/is_union.hpp +include/boost/type_traits/is_unsigned.hpp +include/boost/type_traits/is_void.hpp +include/boost/type_traits/is_volatile.hpp +include/boost/type_traits/make_signed.hpp +include/boost/type_traits/make_unsigned.hpp +include/boost/type_traits/object_traits.hpp +include/boost/type_traits/remove_all_extents.hpp +include/boost/type_traits/remove_bounds.hpp +include/boost/type_traits/remove_const.hpp +include/boost/type_traits/remove_cv.hpp +include/boost/type_traits/remove_extent.hpp +include/boost/type_traits/remove_pointer.hpp +include/boost/type_traits/remove_reference.hpp +include/boost/type_traits/remove_volatile.hpp +include/boost/type_traits/same_traits.hpp +include/boost/type_traits/transform_traits.hpp +include/boost/type_traits/type_identity.hpp +include/boost/type_traits/type_with_alignment.hpp + +# boost/type_traits/detail +include/boost/type_traits/detail/bool_trait_undef.hpp +include/boost/type_traits/detail/common_arithmetic_type.hpp +include/boost/type_traits/detail/common_type_impl.hpp +include/boost/type_traits/detail/composite_member_pointer_type.hpp +include/boost/type_traits/detail/composite_pointer_type.hpp +include/boost/type_traits/detail/config.hpp +include/boost/type_traits/detail/has_binary_operator.hpp +include/boost/type_traits/detail/is_function_ptr_helper.hpp +include/boost/type_traits/detail/is_function_ptr_tester.hpp +include/boost/type_traits/detail/is_mem_fun_pointer_impl.hpp +include/boost/type_traits/detail/is_mem_fun_pointer_tester.hpp +include/boost/type_traits/detail/mp_defer.hpp +include/boost/type_traits/detail/yes_no_type.hpp + +# boost/typeof +include/boost/typeof/decltype.hpp +include/boost/typeof/encode_decode.hpp +include/boost/typeof/encode_decode_params.hpp +include/boost/typeof/int_encoding.hpp +include/boost/typeof/integral_template_param.hpp +include/boost/typeof/message.hpp +include/boost/typeof/modifiers.hpp +include/boost/typeof/native.hpp +include/boost/typeof/pointers_data_members.hpp +include/boost/typeof/register_functions.hpp +include/boost/typeof/register_functions_iterate.hpp +include/boost/typeof/register_fundamental.hpp +include/boost/typeof/register_mem_functions.hpp +include/boost/typeof/template_encoding.hpp +include/boost/typeof/template_template_param.hpp +include/boost/typeof/type_encoding.hpp +include/boost/typeof/type_template_param.hpp +include/boost/typeof/typeof.hpp +include/boost/typeof/typeof_impl.hpp +include/boost/typeof/unsupported.hpp +include/boost/typeof/vector.hpp +include/boost/typeof/vector100.hpp +include/boost/typeof/vector150.hpp +include/boost/typeof/vector200.hpp +include/boost/typeof/vector50.hpp + +# boost/typeof/dmc +include/boost/typeof/dmc/typeof_impl.hpp + +# boost/typeof/msvc +include/boost/typeof/msvc/typeof_impl.hpp + +# boost/utility +include/boost/utility/addressof.hpp +include/boost/utility/base_from_member.hpp +include/boost/utility/binary.hpp +include/boost/utility/compare_pointees.hpp +include/boost/utility/declval.hpp +include/boost/utility/enable_if.hpp +include/boost/utility/identity_type.hpp +include/boost/utility/result_of.hpp +include/boost/utility/swap.hpp +include/boost/utility/value_init.hpp + +# boost/utility/detail +include/boost/utility/detail/result_of_iterate.hpp + +# boost/variant +include/boost/variant/apply_visitor.hpp +include/boost/variant/bad_visit.hpp +include/boost/variant/get.hpp +include/boost/variant/recursive_variant.hpp +include/boost/variant/recursive_wrapper.hpp +include/boost/variant/recursive_wrapper_fwd.hpp +include/boost/variant/static_visitor.hpp +include/boost/variant/variant.hpp +include/boost/variant/variant_fwd.hpp +include/boost/variant/visitor_ptr.hpp + +# boost/variant/detail +include/boost/variant/detail/apply_visitor_binary.hpp +include/boost/variant/detail/apply_visitor_delayed.hpp +include/boost/variant/detail/apply_visitor_unary.hpp +include/boost/variant/detail/backup_holder.hpp +include/boost/variant/detail/cast_storage.hpp +include/boost/variant/detail/config.hpp +include/boost/variant/detail/element_index.hpp +include/boost/variant/detail/enable_recursive.hpp +include/boost/variant/detail/enable_recursive_fwd.hpp +include/boost/variant/detail/forced_return.hpp +include/boost/variant/detail/generic_result_type.hpp +include/boost/variant/detail/has_result_type.hpp +include/boost/variant/detail/hash_variant.hpp +include/boost/variant/detail/initializer.hpp +include/boost/variant/detail/make_variant_list.hpp +include/boost/variant/detail/move.hpp +include/boost/variant/detail/over_sequence.hpp +include/boost/variant/detail/substitute.hpp +include/boost/variant/detail/substitute_fwd.hpp +include/boost/variant/detail/variant_io.hpp +include/boost/variant/detail/visitation_impl.hpp diff --git a/vendor/cheap-ruler-cpp-files.txt b/vendor/cheap-ruler-cpp-files.txt new file mode 100644 index 0000000000..2f02900d10 --- /dev/null +++ b/vendor/cheap-ruler-cpp-files.txt @@ -0,0 +1,4 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# mapbox +include/mapbox/cheap_ruler.hpp diff --git a/vendor/earcut.hpp-files.txt b/vendor/earcut.hpp-files.txt new file mode 100644 index 0000000000..d85382cdd2 --- /dev/null +++ b/vendor/earcut.hpp-files.txt @@ -0,0 +1,4 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# mapbox +include/mapbox/earcut.hpp diff --git a/vendor/eternal-files.txt b/vendor/eternal-files.txt new file mode 100644 index 0000000000..ed800967e2 --- /dev/null +++ b/vendor/eternal-files.txt @@ -0,0 +1,4 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# mapbox +include/mapbox/eternal.hpp diff --git a/vendor/expected-files.txt b/vendor/expected-files.txt new file mode 100644 index 0000000000..f32969f266 --- /dev/null +++ b/vendor/expected-files.txt @@ -0,0 +1,4 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# expected +include/expected.hpp diff --git a/vendor/geojson-vt-cpp-files.txt b/vendor/geojson-vt-cpp-files.txt new file mode 100644 index 0000000000..a0075717da --- /dev/null +++ b/vendor/geojson-vt-cpp-files.txt @@ -0,0 +1,12 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# mapbox +include/mapbox/geojsonvt.hpp + +# mapbox/geojsonvt +include/mapbox/geojsonvt/clip.hpp +include/mapbox/geojsonvt/convert.hpp +include/mapbox/geojsonvt/simplify.hpp +include/mapbox/geojsonvt/tile.hpp +include/mapbox/geojsonvt/types.hpp +include/mapbox/geojsonvt/wrap.hpp diff --git a/vendor/geojson.hpp-files.txt b/vendor/geojson.hpp-files.txt new file mode 100644 index 0000000000..ad39a6fce5 --- /dev/null +++ b/vendor/geojson.hpp-files.txt @@ -0,0 +1,8 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# mapbox +include/mapbox/geojson.hpp +include/mapbox/geojson_impl.hpp + +# mapbox/geojson +include/mapbox/geojson/rapidjson.hpp diff --git a/vendor/geometry.hpp-files.txt b/vendor/geometry.hpp-files.txt new file mode 100644 index 0000000000..6ef2aa6082 --- /dev/null +++ b/vendor/geometry.hpp-files.txt @@ -0,0 +1,20 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# mapbox +include/mapbox/feature.hpp +include/mapbox/geometry.hpp +include/mapbox/geometry_io.hpp + +# mapbox/geometry +include/mapbox/geometry/box.hpp +include/mapbox/geometry/empty.hpp +include/mapbox/geometry/envelope.hpp +include/mapbox/geometry/for_each_point.hpp +include/mapbox/geometry/geometry.hpp +include/mapbox/geometry/line_string.hpp +include/mapbox/geometry/multi_line_string.hpp +include/mapbox/geometry/multi_point.hpp +include/mapbox/geometry/multi_polygon.hpp +include/mapbox/geometry/point.hpp +include/mapbox/geometry/point_arithmetic.hpp +include/mapbox/geometry/polygon.hpp diff --git a/vendor/icu-files.txt b/vendor/icu-files.txt new file mode 100644 index 0000000000..18a8bf946b --- /dev/null +++ b/vendor/icu-files.txt @@ -0,0 +1,74 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# icu +src/cmemory.cpp +src/cmemory.h +src/cstring.cpp +src/cstring.h +src/cwchar.h +src/mutex.h +src/putilimp.h +src/uassert.h +src/ubidi.cpp +src/ubidi_props.cpp +src/ubidi_props.h +src/ubidi_props_data.h +src/ubidiimp.h +src/ubidiln.cpp +src/ubidiwrt.cpp +src/uchar.cpp +src/uchar_props_data.h +src/ucln.h +src/ucln_cmn.h +src/ucmndata.h +src/udatamem.h +src/udataswp.cpp +src/udataswp.h +src/uinvchar.cpp +src/uinvchar.h +src/umapfile.h +src/umath.cpp +src/umutex.h +src/uprops.h +src/uset_imp.h +src/ushape.cpp +src/ustr_imp.h +src/ustring.cpp +src/utf_impl.cpp +src/utrie2.cpp +src/utrie2.h +src/utrie2_impl.h +src/utypes.cpp + +# unicode +include/unicode/bytestream.h +include/unicode/char16ptr.h +include/unicode/localpointer.h +include/unicode/platform.h +include/unicode/ptypes.h +include/unicode/putil.h +include/unicode/rep.h +include/unicode/std_string.h +include/unicode/stringoptions.h +include/unicode/stringpiece.h +include/unicode/ubidi.h +include/unicode/uchar.h +include/unicode/uclean.h +include/unicode/uconfig.h +include/unicode/udata.h +include/unicode/uiter.h +include/unicode/umachine.h +include/unicode/unistr.h +include/unicode/uobject.h +include/unicode/urename.h +include/unicode/uscript.h +include/unicode/uset.h +include/unicode/ushape.h +include/unicode/ustring.h +include/unicode/utf.h +include/unicode/utf16.h +include/unicode/utf8.h +include/unicode/utf_old.h +include/unicode/utypes.h +include/unicode/uvernum.h +include/unicode/uversion.h diff --git a/vendor/jni.hpp-files.txt b/vendor/jni.hpp-files.txt new file mode 100644 index 0000000000..72943455f7 --- /dev/null +++ b/vendor/jni.hpp-files.txt @@ -0,0 +1,30 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# jni +include/jni/advanced_ownership.hpp +include/jni/array.hpp +include/jni/arraylike.hpp +include/jni/boxing.hpp +include/jni/class.hpp +include/jni/constructor.hpp +include/jni/errors.hpp +include/jni/field.hpp +include/jni/functions.hpp +include/jni/jni.hpp +include/jni/make.hpp +include/jni/method.hpp +include/jni/native_method.hpp +include/jni/npe.hpp +include/jni/object.hpp +include/jni/ownership.hpp +include/jni/static_field.hpp +include/jni/static_method.hpp +include/jni/string.hpp +include/jni/tagging.hpp +include/jni/traits.hpp +include/jni/type_signature.hpp +include/jni/typed_methods.hpp +include/jni/types.hpp +include/jni/unique.hpp +include/jni/weak_reference.hpp +include/jni/wrapping.hpp diff --git a/vendor/kdbush.hpp-files.txt b/vendor/kdbush.hpp-files.txt new file mode 100644 index 0000000000..494b762a7d --- /dev/null +++ b/vendor/kdbush.hpp-files.txt @@ -0,0 +1,4 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# kdbush.hpp +include/kdbush.hpp diff --git a/vendor/pixelmatch-cpp-files.txt b/vendor/pixelmatch-cpp-files.txt new file mode 100644 index 0000000000..15edf4752f --- /dev/null +++ b/vendor/pixelmatch-cpp-files.txt @@ -0,0 +1,4 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# mapbox +include/mapbox/pixelmatch.hpp diff --git a/vendor/pixelmatch-files.txt b/vendor/pixelmatch-files.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vendor/polylabel-files.txt b/vendor/polylabel-files.txt new file mode 100644 index 0000000000..2a72387125 --- /dev/null +++ b/vendor/polylabel-files.txt @@ -0,0 +1,4 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# mapbox +include/mapbox/polylabel.hpp diff --git a/vendor/protozero-files.txt b/vendor/protozero-files.txt new file mode 100644 index 0000000000..0bb12368ea --- /dev/null +++ b/vendor/protozero-files.txt @@ -0,0 +1,14 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# protozero +include/protozero/byteswap.hpp +include/protozero/config.hpp +include/protozero/exception.hpp +include/protozero/iterators.hpp +include/protozero/pbf_builder.hpp +include/protozero/pbf_message.hpp +include/protozero/pbf_reader.hpp +include/protozero/pbf_writer.hpp +include/protozero/types.hpp +include/protozero/varint.hpp +include/protozero/version.hpp diff --git a/vendor/rapidjson-files.txt b/vendor/rapidjson-files.txt new file mode 100644 index 0000000000..f3f92e9908 --- /dev/null +++ b/vendor/rapidjson-files.txt @@ -0,0 +1,44 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# rapidjson +include/rapidjson/allocators.h +include/rapidjson/document.h +include/rapidjson/encodedstream.h +include/rapidjson/encodings.h +include/rapidjson/filereadstream.h +include/rapidjson/filewritestream.h +include/rapidjson/fwd.h +include/rapidjson/istreamwrapper.h +include/rapidjson/memorybuffer.h +include/rapidjson/memorystream.h +include/rapidjson/ostreamwrapper.h +include/rapidjson/pointer.h +include/rapidjson/prettywriter.h +include/rapidjson/rapidjson.h +include/rapidjson/reader.h +include/rapidjson/schema.h +include/rapidjson/stream.h +include/rapidjson/stringbuffer.h +include/rapidjson/writer.h + +# rapidjson/error +include/rapidjson/error/en.h +include/rapidjson/error/error.h + +# rapidjson/internal +include/rapidjson/internal/biginteger.h +include/rapidjson/internal/diyfp.h +include/rapidjson/internal/dtoa.h +include/rapidjson/internal/ieee754.h +include/rapidjson/internal/itoa.h +include/rapidjson/internal/meta.h +include/rapidjson/internal/pow10.h +include/rapidjson/internal/regex.h +include/rapidjson/internal/stack.h +include/rapidjson/internal/strfunc.h +include/rapidjson/internal/strtod.h +include/rapidjson/internal/swap.h + +# rapidjson/msinttypes +include/rapidjson/msinttypes/inttypes.h +include/rapidjson/msinttypes/stdint.h diff --git a/vendor/shelf-pack-cpp-files.txt b/vendor/shelf-pack-cpp-files.txt new file mode 100644 index 0000000000..082401c460 --- /dev/null +++ b/vendor/shelf-pack-cpp-files.txt @@ -0,0 +1,4 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# mapbox +include/mapbox/shelf-pack.hpp diff --git a/vendor/sqlite-files.txt b/vendor/sqlite-files.txt new file mode 100644 index 0000000000..9b89bec963 --- /dev/null +++ b/vendor/sqlite-files.txt @@ -0,0 +1,5 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# sqlite +include/sqlite3.h +src/sqlite3.c diff --git a/vendor/supercluster.hpp-files.txt b/vendor/supercluster.hpp-files.txt new file mode 100644 index 0000000000..7daea251de --- /dev/null +++ b/vendor/supercluster.hpp-files.txt @@ -0,0 +1,4 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# supercluster.hpp +include/supercluster.hpp diff --git a/vendor/unique_resource-files.txt b/vendor/unique_resource-files.txt new file mode 100644 index 0000000000..8bcbf256eb --- /dev/null +++ b/vendor/unique_resource-files.txt @@ -0,0 +1,4 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# unique_resource +unique_resource.hpp diff --git a/vendor/variant-files.txt b/vendor/variant-files.txt new file mode 100644 index 0000000000..0f29646d46 --- /dev/null +++ b/vendor/variant-files.txt @@ -0,0 +1,8 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# mapbox +include/mapbox/optional.hpp +include/mapbox/recursive_wrapper.hpp +include/mapbox/variant.hpp +include/mapbox/variant_io.hpp +include/mapbox/variant_visitor.hpp diff --git a/vendor/vector-tile-files.txt b/vendor/vector-tile-files.txt new file mode 100644 index 0000000000..14e9b95fbf --- /dev/null +++ b/vendor/vector-tile-files.txt @@ -0,0 +1,8 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# mapbox +include/mapbox/vector_tile.hpp + +# mapbox/vector_tile +include/mapbox/vector_tile/vector_tile_config.hpp +include/mapbox/vector_tile/version.hpp diff --git a/vendor/wagyu-files.txt b/vendor/wagyu-files.txt new file mode 100644 index 0000000000..f1f10707ce --- /dev/null +++ b/vendor/wagyu-files.txt @@ -0,0 +1,27 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# mapbox/geometry/wagyu +include/mapbox/geometry/wagyu/active_bound_list.hpp +include/mapbox/geometry/wagyu/bound.hpp +include/mapbox/geometry/wagyu/bubble_sort.hpp +include/mapbox/geometry/wagyu/build_edges.hpp +include/mapbox/geometry/wagyu/build_local_minima_list.hpp +include/mapbox/geometry/wagyu/build_result.hpp +include/mapbox/geometry/wagyu/config.hpp +include/mapbox/geometry/wagyu/edge.hpp +include/mapbox/geometry/wagyu/intersect.hpp +include/mapbox/geometry/wagyu/intersect_util.hpp +include/mapbox/geometry/wagyu/local_minimum.hpp +include/mapbox/geometry/wagyu/local_minimum_util.hpp +include/mapbox/geometry/wagyu/point.hpp +include/mapbox/geometry/wagyu/process_horizontal.hpp +include/mapbox/geometry/wagyu/process_maxima.hpp +include/mapbox/geometry/wagyu/quick_clip.hpp +include/mapbox/geometry/wagyu/ring.hpp +include/mapbox/geometry/wagyu/ring_util.hpp +include/mapbox/geometry/wagyu/scanbeam.hpp +include/mapbox/geometry/wagyu/snap_rounding.hpp +include/mapbox/geometry/wagyu/topology_correction.hpp +include/mapbox/geometry/wagyu/util.hpp +include/mapbox/geometry/wagyu/vatti.hpp +include/mapbox/geometry/wagyu/wagyu.hpp -- cgit v1.2.1