1 | #pragma once |
---|---|
2 | |
3 | #include <mbgl/actor/actor_ref.hpp> |
4 | #include <mbgl/storage/file_source.hpp> |
5 | #include <mbgl/util/async_request.hpp> |
6 | |
7 | #include <memory> |
8 | #include <functional> |
9 | |
10 | namespace mbgl { |
11 | |
12 | class Mailbox; |
13 | |
14 | class FileSourceRequest : public AsyncRequest { |
15 | public: |
16 | FileSourceRequest(FileSource::Callback&& callback); |
17 | ~FileSourceRequest() final; |
18 | |
19 | void onCancel(std::function<void()>&& callback); |
20 | void setResponse(const Response& res); |
21 | |
22 | ActorRef<FileSourceRequest> actor(); |
23 | |
24 | private: |
25 | FileSource::Callback responseCallback = nullptr; |
26 | std::function<void()> cancelCallback = nullptr; |
27 | |
28 | std::shared_ptr<Mailbox> mailbox; |
29 | }; |
30 | |
31 | } // namespace mbgl |
32 |