3#include <CesiumAsync/AsyncSystem.h>
4#include <CesiumAsync/IAssetAccessor.h>
5#include <CesiumAsync/IAssetRequest.h>
6#include <CesiumAsync/IAssetResponse.h>
24 :
public std::enable_shared_from_this<CesiumIonAssetAccessor>,
46 const std::shared_ptr<spdlog::logger>& pLogger,
47 const std::shared_ptr<IAssetAccessor>& pAggregatedAccessor,
48 const std::string& assetEndpointUrl,
49 const std::vector<IAssetAccessor::THeader>& assetEndpointHeaders,
57 const std::string& url,
58 const std::vector<THeader>& headers = {})
override;
65 const std::string& verb,
66 const std::string& url,
67 const std::vector<THeader>& headers = std::vector<THeader>(),
68 const std::span<const std::byte>& contentPayload = {})
override;
73 void tick() noexcept override;
84 const
std::
string& currentAuthorizationHeader,
85 const
std::
string& currentAccessTokenQueryParameterValue);
87 std::shared_ptr<spdlog::logger> _pLogger;
89 std::
string _assetEndpointUrl;
92 _maybeUpdatedTokenCallback;
A system for managing asynchronous requests and tasks.
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
void notifyOwnerIsBeingDestroyed()
Notifies this accessor that it's owner has been destroyed. When the owner is destroyed,...
void tick() noexcept 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
A value that will be available in the future, as produced by AsyncSystem.
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.
A value that will be available in the future, as produced by AsyncSystem. Unlike Future,...
Classes that support asynchronous operations.
The details of the updated token.
std::string token
The new token.
std::string authorizationHeader
The new Authorization header containing the new token.