cesium-native  0.41.0
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 
11 namespace CesiumAsync {
12 
13 class 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 
64 template <> struct std::hash<CesiumAsync::NetworkAssetDescriptor> {
65  std::size_t
66  operator()(const CesiumAsync::NetworkAssetDescriptor& key) const noexcept;
67 };
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: Future.h:29
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.
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.
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.
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...