add tile-specific platform HTTP request

This commit is contained in:
Justin R. Miller
2014-02-19 17:23:54 -08:00
parent 2bb6163f64
commit fded15dab0

View File

@@ -12,6 +12,8 @@ namespace llmr {
class Tile;
typedef std::shared_ptr<Tile> tile_ptr;
namespace platform {
// Restarts painting. This could for example trigger the event loop of the controlling application.
@@ -25,6 +27,9 @@ struct Response {
// Makes an HTTP request of a URL on a background thread, calls a function with the results on the same thread, and finally calls a callback function on the main thread.
void request_http(std::string url, std::function<void(Response&)> background_function, std::function<void()> foreground_callback);
// Makes a tile-specific HTTP request of a URL on a background thread, calls a function with the results on the same thread, and finally calls a callback function on the main thread. Access to the tile object is provided via a shared pointer.
void request_http_tile(std::string tile_template_url, tile_ptr tile_object, std::function<void(Response&)> background_function, std::function<void()> foreground_callback);
// Returns a relative timestamp in seconds. This value must be monotonic.
double time();