cesium-native  0.41.0
CesiumAsync::IAssetAccessor Class Referenceabstract

Provides asynchronous access to assets, usually files downloaded via HTTP. More...

#include <CesiumAsync/IAssetAccessor.h>

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

Public Types

typedef std::pair< std::string, std::string > THeader
 An HTTP header represented as a key/value pair.
 

Public Member Functions

virtual CesiumAsync::Future< std::shared_ptr< IAssetRequest > > get (const AsyncSystem &asyncSystem, const std::string &url, const std::vector< THeader > &headers={})=0
 Starts a new request for the asset with the given URL. The request proceeds asynchronously without blocking the calling thread. More...
 
virtual CesiumAsync::Future< std::shared_ptr< IAssetRequest > > request (const AsyncSystem &asyncSystem, const std::string &verb, const std::string &url, const std::vector< THeader > &headers=std::vector< THeader >(), const gsl::span< const std::byte > &contentPayload={})=0
 Starts a new request to the given URL, using the provided HTTP verb and the provided content payload. More...
 
virtual void tick () noexcept=0
 Ticks the asset accessor system while the main thread is blocked. More...
 

Detailed Description

Provides asynchronous access to assets, usually files downloaded via HTTP.

Definition at line 22 of file IAssetAccessor.h.

Member Function Documentation

◆ get()

virtual CesiumAsync::Future<std::shared_ptr<IAssetRequest> > CesiumAsync::IAssetAccessor::get ( const AsyncSystem asyncSystem,
const std::string &  url,
const std::vector< THeader > &  headers = {} 
)
pure virtual

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.

Implemented in CesiumAsync::GunzipAssetAccessor, and CesiumAsync::CachingAssetAccessor.

◆ request()

virtual CesiumAsync::Future<std::shared_ptr<IAssetRequest> > CesiumAsync::IAssetAccessor::request ( const AsyncSystem asyncSystem,
const std::string &  verb,
const std::string &  url,
const std::vector< THeader > &  headers = std::vector< THeader >(),
const gsl::span< const std::byte > &  contentPayload = {} 
)
pure virtual

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.

Implemented in CesiumAsync::GunzipAssetAccessor, and CesiumAsync::CachingAssetAccessor.

◆ tick()

virtual void CesiumAsync::IAssetAccessor::tick ( )
pure virtualnoexcept

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.

Implemented in CesiumAsync::GunzipAssetAccessor, and CesiumAsync::CachingAssetAccessor.


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