[core] Use expected.hpp from mapbox-base

This commit is contained in:
Mikhail Pozdnyakov
2019-11-07 18:31:40 +02:00
parent 2e8a350d68
commit 55e18a6f81
18 changed files with 22 additions and 1782 deletions

View File

@@ -10,7 +10,6 @@ target_include_directories(mbgl-core
target_link_libraries(mbgl-core PRIVATE
mbgl-vendor-earcut.hpp
mbgl-vendor-eternal
mbgl-vendor-expected
mbgl-vendor-geojson-vt-cpp
mbgl-vendor-shelf-pack-cpp
mbgl-vendor-unique_resource
@@ -32,6 +31,7 @@ target_link_libraries(mbgl-core PUBLIC
mbgl-vendor-polylabel
mbgl-vendor-protozero
Mapbox::Base::Extras::rapidjson
Mapbox::Base::Extras::expected-lite
mbgl-vendor-vector-tile
)

View File

@@ -10,7 +10,7 @@ target_include_directories(mbgl-filesource
target_link_libraries(mbgl-filesource
PUBLIC mbgl-core
PUBLIC mbgl-vendor-expected
PUBLIC Mapbox::Base::Extras::expected-lite
)
mbgl_filesource()

View File

@@ -49,7 +49,7 @@ target_link_libraries(
mbgl-core
mbgl-filesource
Mapbox::Base::Extras::args
mbgl-vendor-expected
Mapbox::Base::Extras::expected-lite
Mapbox::Base::Extras::filesystem
Mapbox::Base::pixelmatch-cpp
Mapbox::Base::Extras::rapidjson

View File

@@ -8,7 +8,6 @@ include(${CMAKE_SOURCE_DIR}/vendor/boost.cmake)
include(${CMAKE_SOURCE_DIR}/vendor/cheap-ruler-cpp.cmake)
include(${CMAKE_SOURCE_DIR}/vendor/earcut.hpp.cmake)
include(${CMAKE_SOURCE_DIR}/vendor/eternal.cmake)
include(${CMAKE_SOURCE_DIR}/vendor/expected.cmake)
include(${CMAKE_SOURCE_DIR}/vendor/geojson-vt-cpp.cmake)
include(${CMAKE_SOURCE_DIR}/vendor/googletest.cmake)
include(${CMAKE_SOURCE_DIR}/vendor/icu.cmake)

View File

@@ -32,12 +32,12 @@ public:
OfflineTilePyramidRegionDefinition(std::string, LatLngBounds, double, double, float, bool);
/* Private */
const std::string styleURL;
const LatLngBounds bounds;
const double minZoom;
const double maxZoom;
const float pixelRatio;
const bool includeIdeographs;
std::string styleURL;
LatLngBounds bounds;
double minZoom;
double maxZoom;
float pixelRatio;
bool includeIdeographs;
};
/*
@@ -56,12 +56,12 @@ public:
OfflineGeometryRegionDefinition(std::string styleURL, Geometry<double>, double minZoom, double maxZoom, float pixelRatio, bool includeIdeographs);
/* Private */
const std::string styleURL;
const Geometry<double> geometry;
const double minZoom;
const double maxZoom;
const float pixelRatio;
const bool includeIdeographs;
std::string styleURL;
Geometry<double> geometry;
double minZoom;
double maxZoom;
float pixelRatio;
bool includeIdeographs;
};
/*
@@ -211,14 +211,8 @@ public:
class OfflineRegion {
public:
// Move-only; not publicly constructible.
OfflineRegion(OfflineRegion&&);
~OfflineRegion();
OfflineRegion() = delete;
OfflineRegion(const OfflineRegion&) = delete;
OfflineRegion& operator=(OfflineRegion&&) = delete;
OfflineRegion& operator=(const OfflineRegion&) = delete;
int64_t getID() const;
const OfflineRegionDefinition& getDefinition() const;
@@ -231,9 +225,9 @@ private:
OfflineRegionDefinition,
OfflineRegionMetadata);
const int64_t id;
const OfflineRegionDefinition definition;
const OfflineRegionMetadata metadata;
int64_t id;
OfflineRegionDefinition definition;
OfflineRegionMetadata metadata;
};
using OfflineRegions = std::vector<OfflineRegion>;

View File

@@ -1,6 +1,6 @@
#pragma once
#include <expected.hpp>
#include <nonstd/expected.hpp>
namespace mbgl {

View File

@@ -41,7 +41,6 @@ mbgl_vendor_library("icu")
mbgl_vendor_library("boost")
mbgl_vendor_library("cheap-ruler-cpp")
mbgl_vendor_library("earcut.hpp")
mbgl_vendor_library("expected")
mbgl_vendor_library("eternal")
mbgl_vendor_library("geojson-vt-cpp")
mbgl_vendor_library("mapbox-base")

View File

@@ -890,7 +890,6 @@ endif(NOT TARGET mapbox-base)
include(${PROJECT_SOURCE_DIR}/vendor/boost.cmake)
include(${PROJECT_SOURCE_DIR}/vendor/earcut.hpp.cmake)
include(${PROJECT_SOURCE_DIR}/vendor/eternal.cmake)
include(${PROJECT_SOURCE_DIR}/vendor/expected.cmake)
include(${PROJECT_SOURCE_DIR}/vendor/geojson-vt-cpp.cmake)
include(${PROJECT_SOURCE_DIR}/vendor/polylabel.cmake)
include(${PROJECT_SOURCE_DIR}/vendor/protozero.cmake)
@@ -915,6 +914,7 @@ target_link_libraries(
mbgl-vendor-vector-tile
mbgl-vendor-wagyu
PUBLIC
Mapbox::Base::Extras::expected-lite
Mapbox::Base::Extras::rapidjson
Mapbox::Base::geojson.hpp
Mapbox::Base::geometry.hpp
@@ -923,7 +923,6 @@ target_link_libraries(
Mapbox::Base::value
Mapbox::Base::variant
Mapbox::Base::weak
mbgl-vendor-expected
)
set_property(TARGET mbgl-core PROPERTY FOLDER Core)

View File

@@ -150,7 +150,6 @@ OfflineRegion::OfflineRegion(int64_t id_,
metadata(std::move(metadata_)) {
}
OfflineRegion::OfflineRegion(OfflineRegion&&) = default;
OfflineRegion::~OfflineRegion() = default;
const OfflineRegionDefinition& OfflineRegion::getDefinition() const {

View File

@@ -130,12 +130,12 @@ generateFileList('vendor/boost-files.json', [ 'vendor/boost' ], vendorRegex, [ "
generateFileList('vendor/cheap-ruler-cpp-files.json', [ 'vendor/cheap-ruler-cpp' ], vendorRegex, [ "include/**/*.hpp" ]);
generateFileList('vendor/earcut.hpp-files.json', [ 'vendor/earcut.hpp' ], vendorRegex, [ "include/**/*.hpp" ]);
generateFileList('vendor/eternal-files.json', [ 'vendor/eternal' ], vendorRegex, [ "include/**/*.hpp" ]);
generateFileList('vendor/expected-files.json', [ 'vendor/expected' ], vendorRegex, [ "include/expected.hpp" ]);
generateFileList('vendor/geojson-vt-cpp-files.json', [ 'vendor/geojson-vt-cpp' ], vendorRegex, [ "include/**/*.hpp" ]);
generateFileList('vendor/icu-files.json', [ 'vendor/icu' ], vendorRegex, [ "include/**/*.h", "src/*.h", "src/*.cpp" ]);
generateFileList('vendor/mapbox-base-files.json',
[ 'vendor/mapbox-base/extras/kdbush.hpp',
'vendor/mapbox-base/extras/filesystem',
'vendor/mapbox-base/extras/expected-lite',
'vendor/mapbox-base/extras/rapidjson',
'vendor/mapbox-base/mapbox/pixelmatch-cpp',
'vendor/mapbox-base/mapbox/geometry.hpp',

View File

@@ -53,7 +53,6 @@ rsync -rR $(git ls-files \
echo ">> Copying vendored files..."
rsync -rR $(git ls-files \
"vendor/expected" \
"vendor/icu" \
"vendor/nunicode" \
"vendor/sqlite" \

View File

@@ -1,8 +0,0 @@
{
"//": "This file is generated. Do not edit. Regenerate it with scripts/generate-file-lists.js",
"sources": [],
"public_headers": {
"expected.hpp": "vendor/expected/include/expected.hpp"
},
"private_headers": {}
}

View File

@@ -1,9 +0,0 @@
if(TARGET mbgl-vendor-expected)
return()
endif()
add_library(mbgl-vendor-expected INTERFACE)
target_include_directories(mbgl-vendor-expected SYSTEM INTERFACE
${CMAKE_CURRENT_LIST_DIR}/expected/include
)

View File

@@ -1,23 +0,0 @@
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

View File

@@ -1 +0,0 @@
include/expected.hpp

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
a2359cf61478d735a308e952b1c9840714f61386

View File

@@ -2,6 +2,7 @@
"//": "This file is generated. Do not edit. Regenerate it with scripts/generate-file-lists.js",
"sources": [],
"public_headers": {
"nonstd/expected.hpp": "vendor/mapbox-base/extras/expected-lite/include/nonstd/expected.hpp",
"ghc/filesystem.hpp": "vendor/mapbox-base/extras/filesystem/include/ghc/filesystem.hpp",
"ghc/fs_fwd.hpp": "vendor/mapbox-base/extras/filesystem/include/ghc/fs_fwd.hpp",
"ghc/fs_impl.hpp": "vendor/mapbox-base/extras/filesystem/include/ghc/fs_impl.hpp",