cesium-native  0.41.0
CesiumAsync::GunzipAssetAccessor Class Reference

A decorator for an IAssetAccessor that automatically unzips gzipped asset responses from the underlying Asset Accessor. More...

#include <CesiumAsync/GunzipAssetAccessor.h>

Inheritance diagram for CesiumAsync::GunzipAssetAccessor:
CesiumAsync::IAssetAccessor

Public Member Functions

 GunzipAssetAccessor (const std::shared_ptr< IAssetAccessor > &pAssetAccessor)
 Constructs a new instance. More...
 
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 blocking the calling thread. More...
 
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. More...
 
virtual void tick () noexcept override
 Ticks the asset accessor system while the main thread is blocked. More...
 

Additional Inherited Members

- Public Types inherited from CesiumAsync::IAssetAccessor
typedef std::pair< std::string, std::string > THeader
 An HTTP header represented as a key/value pair.
 

Detailed Description

A decorator for an IAssetAccessor that automatically unzips gzipped asset responses from the underlying Asset Accessor.

Definition at line 13 of file GunzipAssetAccessor.h.

Constructor & Destructor Documentation

◆ GunzipAssetAccessor()

CesiumAsync::GunzipAssetAccessor::GunzipAssetAccessor ( const std::shared_ptr< IAssetAccessor > &  pAssetAccessor)

Constructs a new instance.

Parameters
pAssetAccessorThe underlying IAssetAccessor used to retrieve assets that may or may not be zipped.

Member Function Documentation

◆ get()

virtual Future<std::shared_ptr<IAssetRequest> > CesiumAsync::GunzipAssetAccessor::get ( const AsyncSystem asyncSystem,
const std::string &  url,
const std::vector< THeader > &  headers 
)
overridevirtual

Starts a new request for the asset with the given URL. The request proceeds asynchronously without blocking the calling thread.

Parameters
asyncSystemThe async system used to do work in threads.
urlThe URL of the asset.
headersThe headers to include in the request.
Returns
The in-progress asset request.

Implements CesiumAsync::IAssetAccessor.

◆ request()

virtual Future<std::shared_ptr<IAssetRequest> > CesiumAsync::GunzipAssetAccessor::request ( const AsyncSystem asyncSystem,
const std::string &  verb,
const std::string &  url,
const std::vector< THeader > &  headers,
const gsl::span< const std::byte > &  contentPayload 
)
overridevirtual

Starts a new request to the given URL, using the provided HTTP verb and the provided content payload.

The request proceeds asynchronously without blocking the calling thread.

Parameters
asyncSystemThe async system used to do work in threads.
verbThe HTTP verb to use, such as "POST" or "PATCH".
urlThe URL of the asset.
headersThe headers to include in the request.
contentPayloadThe payload data to include in the request.
Returns
The in-progress asset request.

Implements CesiumAsync::IAssetAccessor.

◆ tick()

virtual void CesiumAsync::GunzipAssetAccessor::tick ( )
overridevirtualnoexcept

Ticks the asset accessor system while the main thread is blocked.

If the asset accessor is not dependent on the main thread to dispatch requests, this method does not need to do anything.

Implements CesiumAsync::IAssetAccessor.


The documentation for this class was generated from the following file: