cesium-native
0.41.0
|
Provides asynchronous access to assets, usually files downloaded via HTTP. More...
#include <CesiumAsync/IAssetAccessor.h>
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... | |
Provides asynchronous access to assets, usually files downloaded via HTTP.
Definition at line 22 of file IAssetAccessor.h.
|
pure virtual |
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. |
Implemented in CesiumAsync::GunzipAssetAccessor, and CesiumAsync::CachingAssetAccessor.
|
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.
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. |
Implemented in CesiumAsync::GunzipAssetAccessor, and CesiumAsync::CachingAssetAccessor.
|
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.