cesium-native 0.50.0
Loading...
Searching...
No Matches
CesiumAsync::CesiumIonAssetAccessor Class Reference

An IAssetAccessor that wraps another one and handles Cesium ion token refresh when an asset returns a 401 error. More...

#include <CesiumAsync/CesiumIonAssetAccessor.h>

Inheritance diagram for CesiumAsync::CesiumIonAssetAccessor:
CesiumAsync::IAssetAccessor

Classes

struct  UpdatedToken
 The details of the updated token. More...
 

Public Member Functions

 CesiumIonAssetAccessor (const std::shared_ptr< spdlog::logger > &pLogger, const std::shared_ptr< IAssetAccessor > &pAggregatedAccessor, const std::string &assetEndpointUrl, const std::vector< IAssetAccessor::THeader > &assetEndpointHeaders, std::function< Future< void >(const UpdatedToken &)> updatedTokenCallback)
 Creates a new instance.
 
Future< std::shared_ptr< IAssetRequest > > get (const AsyncSystem &asyncSystem, const std::string &url, const std::vector< THeader > &headers={}) override
 
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 std::span< const std::byte > &contentPayload={}) override
 
void tick () noexcept override
 
void notifyOwnerIsBeingDestroyed ()
 Notifies this accessor that it's owner has been destroyed. When the owner is destroyed, the token will no longer be refreshed.
 

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

An IAssetAccessor that wraps another one and handles Cesium ion token refresh when an asset returns a 401 error.

It's rarely necessary to use this class directly. It's created by Cesium3DTilesSelection::CesiumIonTilesetContentLoaderFactory and CesiumRasterOverlays::IonRasterOverlay as needed.

Definition at line 23 of file CesiumIonAssetAccessor.h.

Member Function Documentation

◆ get()

Future< std::shared_ptr< IAssetRequest > > CesiumAsync::CesiumIonAssetAccessor::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()

Future< std::shared_ptr< IAssetRequest > > CesiumAsync::CesiumIonAssetAccessor::request ( const AsyncSystem & asyncSystem,
const std::string & verb,
const std::string & url,
const std::vector< THeader > & headers = std::vector< THeader >(),
const std::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()

void CesiumAsync::CesiumIonAssetAccessor::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: