cesium-native  0.41.0
GunzipAssetAccessor.h
1 #pragma once
2 
3 #include "IAssetAccessor.h"
4 #include "IAssetRequest.h"
5 
6 namespace CesiumAsync {
7 class AsyncSystem;
8 
14 public:
21  GunzipAssetAccessor(const std::shared_ptr<IAssetAccessor>& pAssetAccessor);
22 
23  virtual ~GunzipAssetAccessor() noexcept override;
24 
26  virtual Future<std::shared_ptr<IAssetRequest>>
27  get(const AsyncSystem& asyncSystem,
28  const std::string& url,
29  const std::vector<THeader>& headers) override;
30 
31  virtual Future<std::shared_ptr<IAssetRequest>> request(
32  const AsyncSystem& asyncSystem,
33  const std::string& verb,
34  const std::string& url,
35  const std::vector<THeader>& headers,
36  const gsl::span<const std::byte>& contentPayload) override;
37 
39  virtual void tick() noexcept override;
40 
41 private:
42  std::shared_ptr<IAssetAccessor> _pAssetAccessor;
43 };
44 } // namespace CesiumAsync
A system for managing asynchronous requests and tasks.
Definition: AsyncSystem.h:36
A value that will be available in the future, as produced by AsyncSystem.
Definition: Future.h:29
A decorator for an IAssetAccessor that automatically unzips gzipped asset responses from the underlyi...
virtual void tick() noexcept override
Ticks the asset accessor system while the main thread is blocked.
virtual Future< std::shared_ptr< IAssetRequest > > request(const AsyncSystem &asyncSystem, const std::string &verb, const std::string &url, const std::vector< THeader > &headers, const gsl::span< const std::byte > &contentPayload) override
Starts a new request to the given URL, using the provided HTTP verb and the provided content payload.
GunzipAssetAccessor(const std::shared_ptr< IAssetAccessor > &pAssetAccessor)
Constructs a new instance.
virtual Future< std::shared_ptr< IAssetRequest > > get(const AsyncSystem &asyncSystem, const std::string &url, const std::vector< THeader > &headers) override
Starts a new request for the asset with the given URL. The request proceeds asynchronously without bl...
Provides asynchronous access to assets, usually files downloaded via HTTP.
std::pair< std::string, std::string > THeader
An HTTP header represented as a key/value pair.
An asynchronous request for an asset, usually a file downloaded via HTTP.
Definition: IAssetRequest.h:17
Classes that support asynchronous operations.