diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-01-19 15:57:17 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-01-21 11:22:11 -0800 |
commit | 1c21d0fd4cd30cbf6c5b863fd0179b227c28bc0b (patch) | |
tree | dfb6b788285d2b28f7060138ae28734ece13942e /src/mbgl/map | |
parent | c33ed50c98c57ce2f2cf3b971bcf72c4208bf120 (diff) | |
download | qtlocation-mapboxgl-1c21d0fd4cd30cbf6c5b863fd0179b227c28bc0b.tar.gz |
[core] Use better types for modified / expires / etag
Diffstat (limited to 'src/mbgl/map')
-rw-r--r-- | src/mbgl/map/geometry_tile.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/map/tile_data.hpp | 5 | ||||
-rw-r--r-- | src/mbgl/map/vector_tile_data.cpp | 4 |
3 files changed, 7 insertions, 6 deletions
diff --git a/src/mbgl/map/geometry_tile.hpp b/src/mbgl/map/geometry_tile.hpp index dd9a21bc62..e906fed8f3 100644 --- a/src/mbgl/map/geometry_tile.hpp +++ b/src/mbgl/map/geometry_tile.hpp @@ -55,8 +55,8 @@ public: using Callback = std::function<void (std::exception_ptr, std::unique_ptr<GeometryTile>, - Seconds modified, - Seconds expires)>; + optional<SystemTimePoint> modified, + optional<SystemTimePoint> expires)>; /* * Monitor the tile held by this object for changes. When the tile is loaded for the first time, * or updates, the callback is executed. If an error occurs, the first parameter will be set. diff --git a/src/mbgl/map/tile_data.hpp b/src/mbgl/map/tile_data.hpp index 1067c86d3d..fec8ba4901 100644 --- a/src/mbgl/map/tile_data.hpp +++ b/src/mbgl/map/tile_data.hpp @@ -3,6 +3,7 @@ #include <mbgl/util/noncopyable.hpp> #include <mbgl/util/chrono.hpp> +#include <mbgl/util/optional.hpp> #include <mbgl/map/tile_id.hpp> #include <mbgl/renderer/bucket.hpp> #include <mbgl/text/placement_config.hpp> @@ -91,8 +92,8 @@ public: void dumpDebugLogs() const; const TileID id; - Seconds modified = Seconds::zero(); - Seconds expires = Seconds::zero(); + optional<SystemTimePoint> modified; + optional<SystemTimePoint> expires; // Contains the tile ID string for painting debug information. std::unique_ptr<DebugBucket> debugBucket; diff --git a/src/mbgl/map/vector_tile_data.cpp b/src/mbgl/map/vector_tile_data.cpp index 9e1390decd..fa08432b20 100644 --- a/src/mbgl/map/vector_tile_data.cpp +++ b/src/mbgl/map/vector_tile_data.cpp @@ -29,8 +29,8 @@ VectorTileData::VectorTileData(const TileID& id_, state = State::loading; tileRequest = monitor->monitorTile([callback, this](std::exception_ptr err, std::unique_ptr<GeometryTile> tile, - Seconds modified_, - Seconds expires_) { + optional<SystemTimePoint> modified_, + optional<SystemTimePoint> expires_) { if (err) { callback(err); return; |