cesium-native 0.50.0
Loading...
Searching...
No Matches
CesiumCurl::CurlAssetAccessor Class Reference

An implementation of IAssetAccessor that can make network and local requests to a variety of servers using libcurl. More...

#include <CesiumCurl/CurlAssetAccessor.h>

Inheritance diagram for CesiumCurl::CurlAssetAccessor:
CesiumAsync::IAssetAccessor

Public Member Functions

 CurlAssetAccessor (const CurlAssetAccessorOptions &options={})
 Constructs a new instance.
 
const CurlAssetAccessorOptionsgetOptions () const
 Gets the options that were used to construct this accessor.
 
CesiumAsync::Future< std::shared_ptr< CesiumAsync::IAssetRequest > > get (const CesiumAsync::AsyncSystem &asyncSystem, const std::string &url, const std::vector< CesiumAsync::IAssetAccessor::THeader > &headers) override
 
CesiumAsync::Future< std::shared_ptr< CesiumAsync::IAssetRequest > > request (const CesiumAsync::AsyncSystem &asyncSystem, const std::string &verb, const std::string &url, const std::vector< CesiumAsync::IAssetAccessor::THeader > &headers, const std::span< const std::byte > &contentPayload) override
 
void tick () noexcept override
 

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 implementation of IAssetAccessor that can make network and local requests to a variety of servers using libcurl.

Definition at line 89 of file CurlAssetAccessor.h.

Constructor & Destructor Documentation

◆ CurlAssetAccessor()

CesiumCurl::CurlAssetAccessor::CurlAssetAccessor ( const CurlAssetAccessorOptions & options = {})

Constructs a new instance.

Parameters
optionsThe options with which to construct this instance.

Member Function Documentation

◆ get()

CesiumAsync::Future< std::shared_ptr< CesiumAsync::IAssetRequest > > CesiumCurl::CurlAssetAccessor::get ( const CesiumAsync::AsyncSystem & asyncSystem,
const std::string & url,
const std::vector< CesiumAsync::IAssetAccessor::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()

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