cesium-native 0.50.0
|
An IAssetAccessor that wraps another one and handles Cesium ion token refresh when an asset returns a 401 error. More...
#include <CesiumAsync/CesiumIonAssetAccessor.h>
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 | |
![]() | |
typedef std::pair< std::string, std::string > | THeader |
An HTTP header represented as a key/value pair. | |
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.
|
overridevirtual |
Starts a new request for the asset with the given URL. The request proceeds asynchronously without blocking the calling thread.
asyncSystem | The async system used to do work in threads. |
url | The URL of the asset. |
headers | The headers to include in the request. |
Implements CesiumAsync::IAssetAccessor.
|
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.
asyncSystem | The async system used to do work in threads. |
verb | The HTTP verb to use, such as "POST" or "PATCH". |
url | The URL of the asset. |
headers | The headers to include in the request. |
contentPayload | The payload data to include in the request. |
Implements CesiumAsync::IAssetAccessor.
|
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.