Files
MapLibreParticleLab/src/mbgl/storage/request_base.hpp
John Firebaugh 7fb5e973ed [core] Eliminate FileCache interface
There is only one implementation and we're unlikely to add more.
2016-01-14 13:46:03 -08:00

35 lines
671 B
C++

#ifndef MBGL_STORAGE_REQUEST_BASE
#define MBGL_STORAGE_REQUEST_BASE
#include <mbgl/util/noncopyable.hpp>
#include <memory>
#include <functional>
#include <utility>
#include <string>
namespace mbgl {
class Response;
class RequestBase : private util::noncopyable {
public:
using Callback = std::function<void (std::shared_ptr<const Response> response)>;
RequestBase(const std::string& url_, Callback notify_)
: url(url_)
, notify(std::move(notify_)) {
}
virtual ~RequestBase() = default;
virtual void cancel() = 0;
protected:
std::string url;
Callback notify;
};
} // namespace mbgl
#endif // MBGL_STORAGE_REQUEST_BASE