EntropyCanvas::AssetClient
EntropyCanvas::AssetClient
Section titled “EntropyCanvas::AssetClient”AssetClient - Client API for CanvasEngine’s asset system. More…
#include <AssetClient.h>
Public Types
Section titled “Public Types”| Name | |
|---|---|
| using std::function< void(bool success, uint32_t removedCount, const std::string &errorMessage)> | WithdrawCallback |
| using std::function< void(std::optional< AssetUploadResult > result, const std::string &errorMessage)> | UploadCallback |
| using std::function< void(std::optional< AssetResolveResult > result)> | ResolveCallback |
| using std::function< void(std::vector< std::optional< AssetResolveResult > > results)> | ResolveBatchCallback |
| using std::function< void(bool success, const std::string &errorMessage)> | ProvideKeyCallback |
| using std::function< void(std::optional< std::vector< uint8_t > > data, const std::string &errorMessage)> | FetchCallback |
| using std::function< void(uint64_t bytesUploaded, uint64_t totalBytes)> | ChunkedUploadProgressCallback |
| using std::function< void(bool success, const std::string &errorMessage)> | AdvertiseCallback |
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| ~AssetClient() | |
| VoidHandle | withdrawAll() |
| void | withdrawAll(WithdrawCallback callback) |
| VoidHandle | withdraw(const std::vector< AssetId > & ids) |
| void | withdraw(const std::vector< AssetId > & ids, WithdrawCallback callback) |
| UploadHandle | uploadChunked(std::span< const uint8_t > data, ContentType contentType, bool persistent, bool encrypted, const std::array< uint8_t, 32 > & plaintextHash, uint32_t chunkSize =64 *1024) |
| UploadHandle | uploadChunked(std::span< const uint8_t > data, ContentType contentType, bool persistent, bool encrypted, const std::array< uint8_t, 32 > & plaintextHash, uint32_t chunkSize, const EntropyEngine::Networking::NetworkSession::AssetMetadataData & metadata) |
| void | uploadChunked(std::span< const uint8_t > data, ContentType contentType, bool persistent, bool encrypted, const std::array< uint8_t, 32 > & plaintextHash, uint32_t chunkSize, ChunkedUploadProgressCallback progressCallback, UploadCallback completeCallback) |
| void | uploadChunked(std::span< const uint8_t > data, ContentType contentType, bool persistent, bool encrypted, const std::array< uint8_t, 32 > & plaintextHash, uint32_t chunkSize, ChunkedUploadProgressCallback progressCallback, UploadCallback completeCallback, const EntropyEngine::Networking::NetworkSession::AssetMetadataData & metadata) |
| UploadHandle | upload(std::span< const uint8_t > data, ContentType contentType, bool persistent) |
| UploadHandle | upload(std::span< const uint8_t > data, ContentType contentType, bool persistent, const EntropyEngine::Networking::NetworkSession::AssetMetadataData & metadata) |
| void | upload(std::span< const uint8_t > data, ContentType contentType, bool persistent, UploadCallback callback) |
| void | upload(std::span< const uint8_t > data, ContentType contentType, bool persistent, UploadCallback callback, const EntropyEngine::Networking::NetworkSession::AssetMetadataData & metadata) |
| void | setAppId(const std::string & appId) |
| std::optional< AssetResolveResult > | resolveSync(const AssetId & id, std::chrono::milliseconds timeout =std::chrono::seconds(5)) |
| ResolveBatchHandle | resolveBatch(const std::vector< AssetId > & ids) |
| void | resolveBatch(const std::vector< AssetId > & ids, ResolveBatchCallback callback) |
| ResolveHandle | resolve(const AssetId & id) |
| void | resolve(const AssetId & id, ResolveCallback callback) |
| VoidHandle | provideKey(const AssetId & id, std::span< const uint8_t, 32 > key) |
| void | provideKey(const AssetId & id, std::span< const uint8_t, 32 > key, ProvideKeyCallback callback) |
| AssetClient & | operator=(const AssetClient & ) =delete |
| bool | isValid() const |
| const std::string & | getAppId() const |
| std::optional< std::vector< uint8_t > > | fetchSync(const AssetId & id, std::chrono::milliseconds timeout =std::chrono::seconds(30)) |
| FetchHandle | fetch(const AssetId & id) |
| void | fetch(const AssetId & id, FetchCallback callback) |
| bool | advertiseSync(const std::vector< AssetInfo > & entries, std::chrono::milliseconds timeout =std::chrono::seconds(5)) |
| VoidHandle | advertise(const std::vector< AssetInfo > & entries) |
| void | advertise(const std::vector< AssetInfo > & entries, AdvertiseCallback callback) |
| AssetClient(EntropyEngine::Networking::SessionHandle session, EntropyEngine::Networking::SessionManager * sessionManager, std::string appId ="") | |
| AssetClient(const AssetClient & ) =delete |
Detailed Description
Section titled “Detailed Description”class EntropyCanvas::AssetClient;AssetClient - Client API for CanvasEngine’s asset system.
All operations are async by default. Returns a handle you can poll or wait on.
AssetClient assets(session, sessionManager);
auto handle = assets.resolve(assetId);
// Pollif (handle.isDone()) { ... }
// Or waithandle.wait();if (handle.status() == AssetOpStatus::Complete) { auto result = handle.result();}Public Types Documentation
Section titled “Public Types Documentation”using WithdrawCallback
Section titled “using WithdrawCallback”using EntropyCanvas::AssetClient::WithdrawCallback = std::function<void(bool success, uint32_t removedCount, const std::string& errorMessage)>;using UploadCallback
Section titled “using UploadCallback”using EntropyCanvas::AssetClient::UploadCallback =std::function<void(std::optional<AssetUploadResult> result, const std::string& errorMessage)>;using ResolveCallback
Section titled “using ResolveCallback”using EntropyCanvas::AssetClient::ResolveCallback = std::function<void(std::optional<AssetResolveResult> result)>;using ResolveBatchCallback
Section titled “using ResolveBatchCallback”using EntropyCanvas::AssetClient::ResolveBatchCallback = std::function<void(std::vector<std::optional<AssetResolveResult>> results)>;using ProvideKeyCallback
Section titled “using ProvideKeyCallback”using EntropyCanvas::AssetClient::ProvideKeyCallback = std::function<void(bool success, const std::string& errorMessage)>;using FetchCallback
Section titled “using FetchCallback”using EntropyCanvas::AssetClient::FetchCallback =std::function<void(std::optional<std::vector<uint8_t>> data, const std::string& errorMessage)>;using ChunkedUploadProgressCallback
Section titled “using ChunkedUploadProgressCallback”using EntropyCanvas::AssetClient::ChunkedUploadProgressCallback = std::function<void(uint64_t bytesUploaded, uint64_t totalBytes)>;using AdvertiseCallback
Section titled “using AdvertiseCallback”using EntropyCanvas::AssetClient::AdvertiseCallback = std::function<void(bool success, const std::string& errorMessage)>;Public Functions Documentation
Section titled “Public Functions Documentation”function ~AssetClient
Section titled “function ~AssetClient”~AssetClient()function withdrawAll
Section titled “function withdrawAll”VoidHandle withdrawAll()function withdrawAll
Section titled “function withdrawAll”void withdrawAll( WithdrawCallback callback)function withdraw
Section titled “function withdraw”VoidHandle withdraw( const std::vector< AssetId > & ids)function withdraw
Section titled “function withdraw”void withdraw( const std::vector< AssetId > & ids, WithdrawCallback callback)function uploadChunked
Section titled “function uploadChunked”UploadHandle uploadChunked( std::span< const uint8_t > data, ContentType contentType, bool persistent, bool encrypted, const std::array< uint8_t, 32 > & plaintextHash, uint32_t chunkSize =64 *1024)function uploadChunked
Section titled “function uploadChunked”UploadHandle uploadChunked( std::span< const uint8_t > data, ContentType contentType, bool persistent, bool encrypted, const std::array< uint8_t, 32 > & plaintextHash, uint32_t chunkSize, const EntropyEngine::Networking::NetworkSession::AssetMetadataData & metadata)function uploadChunked
Section titled “function uploadChunked”void uploadChunked( std::span< const uint8_t > data, ContentType contentType, bool persistent, bool encrypted, const std::array< uint8_t, 32 > & plaintextHash, uint32_t chunkSize, ChunkedUploadProgressCallback progressCallback, UploadCallback completeCallback)function uploadChunked
Section titled “function uploadChunked”void uploadChunked( std::span< const uint8_t > data, ContentType contentType, bool persistent, bool encrypted, const std::array< uint8_t, 32 > & plaintextHash, uint32_t chunkSize, ChunkedUploadProgressCallback progressCallback, UploadCallback completeCallback, const EntropyEngine::Networking::NetworkSession::AssetMetadataData & metadata)function upload
Section titled “function upload”UploadHandle upload( std::span< const uint8_t > data, ContentType contentType, bool persistent)function upload
Section titled “function upload”UploadHandle upload( std::span< const uint8_t > data, ContentType contentType, bool persistent, const EntropyEngine::Networking::NetworkSession::AssetMetadataData & metadata)function upload
Section titled “function upload”void upload( std::span< const uint8_t > data, ContentType contentType, bool persistent, UploadCallback callback)function upload
Section titled “function upload”void upload( std::span< const uint8_t > data, ContentType contentType, bool persistent, UploadCallback callback, const EntropyEngine::Networking::NetworkSession::AssetMetadataData & metadata)function setAppId
Section titled “function setAppId”inline void setAppId( const std::string & appId)function resolveSync
Section titled “function resolveSync”std::optional< AssetResolveResult > resolveSync( const AssetId & id, std::chrono::milliseconds timeout =std::chrono::seconds(5))function resolveBatch
Section titled “function resolveBatch”ResolveBatchHandle resolveBatch( const std::vector< AssetId > & ids)function resolveBatch
Section titled “function resolveBatch”void resolveBatch( const std::vector< AssetId > & ids, ResolveBatchCallback callback)function resolve
Section titled “function resolve”ResolveHandle resolve( const AssetId & id)function resolve
Section titled “function resolve”void resolve( const AssetId & id, ResolveCallback callback)function provideKey
Section titled “function provideKey”VoidHandle provideKey( const AssetId & id, std::span< const uint8_t, 32 > key)function provideKey
Section titled “function provideKey”void provideKey( const AssetId & id, std::span< const uint8_t, 32 > key, ProvideKeyCallback callback)function operator=
Section titled “function operator=”AssetClient & operator=( const AssetClient &) =deletefunction isValid
Section titled “function isValid”bool isValid() constfunction getAppId
Section titled “function getAppId”inline const std::string & getAppId() constfunction fetchSync
Section titled “function fetchSync”std::optional< std::vector< uint8_t > > fetchSync( const AssetId & id, std::chrono::milliseconds timeout =std::chrono::seconds(30))function fetch
Section titled “function fetch”FetchHandle fetch( const AssetId & id)function fetch
Section titled “function fetch”void fetch( const AssetId & id, FetchCallback callback)function advertiseSync
Section titled “function advertiseSync”bool advertiseSync( const std::vector< AssetInfo > & entries, std::chrono::milliseconds timeout =std::chrono::seconds(5))function advertise
Section titled “function advertise”VoidHandle advertise( const std::vector< AssetInfo > & entries)function advertise
Section titled “function advertise”void advertise( const std::vector< AssetInfo > & entries, AdvertiseCallback callback)function AssetClient
Section titled “function AssetClient”AssetClient( EntropyEngine::Networking::SessionHandle session, EntropyEngine::Networking::SessionManager * sessionManager, std::string appId ="")function AssetClient
Section titled “function AssetClient”AssetClient( const AssetClient &) =deleteUpdated on 2026-01-26 at 16:50:32 -0500