cesium-native 0.43.0
Loading...
Searching...
No Matches
NetworkAssetDescriptor.h
1#pragma once
2
3#include <CesiumAsync/IAssetAccessor.h>
4#include <CesiumUtility/Result.h>
5
6#include <cstddef>
7#include <memory>
8#include <string>
9#include <vector>
10
11namespace CesiumAsync {
12
13class AsyncSystem;
14
24 std::string url;
25
29 std::vector<IAssetAccessor::THeader> headers;
30
34 bool operator==(const NetworkAssetDescriptor& rhs) const noexcept;
35
45 const CesiumAsync::AsyncSystem& asyncSystem,
46 const std::shared_ptr<IAssetAccessor>& pAssetAccessor) const;
47
58 const CesiumAsync::AsyncSystem& asyncSystem,
59 const std::shared_ptr<IAssetAccessor>& pAssetAccessor) const;
60};
61
62} // namespace CesiumAsync
63
65template <> struct std::hash<CesiumAsync::NetworkAssetDescriptor> {
68 std::size_t
70};
A system for managing asynchronous requests and tasks.
Definition AsyncSystem.h:36
A value that will be available in the future, as produced by AsyncSystem.
Definition Promise.h:11
Classes that support asynchronous operations.
A description of an asset that can be loaded from the network using an IAssetAccessor....
std::string url
The URL from which this network asset is downloaded.
Future< CesiumUtility::Result< std::vector< std::byte > > > loadBytesFromNetwork(const CesiumAsync::AsyncSystem &asyncSystem, const std::shared_ptr< IAssetAccessor > &pAssetAccessor) const
Request this asset from the network using the provided asset accessor and return the downloaded bytes...
Future< std::shared_ptr< CesiumAsync::IAssetRequest > > loadFromNetwork(const CesiumAsync::AsyncSystem &asyncSystem, const std::shared_ptr< IAssetAccessor > &pAssetAccessor) const
Request this asset from the network using the provided asset accessor.
bool operator==(const NetworkAssetDescriptor &rhs) const noexcept
Determines if this descriptor is identical to another one.
std::vector< IAssetAccessor::THeader > headers
The HTTP headers used in requesting this asset.
std::size_t operator()(const CesiumAsync::NetworkAssetDescriptor &key) const noexcept
Returns a size_t hash of the provided CesiumAsync::NetworkAssetDescriptor.