SDK  2.1.4
CloudBackend Software Development Kit - SDK API for C++
cbe::delegate::DownloadBinaryDelegate Class Referenceabstract

#include <DownloadBinaryDelegate.h>

Classes

struct  ErrorInfo
 
struct  Exception
 exception thrown by cbe::Object::download() if the request fails. More...
 

Public Types

using Success = DownloadBinarySuccess
 
using Error = TransferError
 

Public Member Functions

virtual void onDownloadBinarySuccess (cbe::Object &&object, std::unique_ptr< char[]> data)=0
 
virtual void onDownloadBinaryError (cbe::delegate::TransferError &&transferError, cbe::util::Context &&context)=0
 
virtual void onChunkReceived (cbe::Object &&object, std::uint64_t received, std::uint64_t total)
 

Detailed Description

Delegate class for the asynchronous version of method:

  • cbe::Object::download(DownloadBinaryDelegatePtr)

Member Function Documentation

◆ onDownloadBinarySuccess()

virtual void cbe::delegate::DownloadBinaryDelegate::onDownloadBinarySuccess ( cbe::Object &&  object,
std::unique_ptr< char[]>  data 
)
pure virtual

Called upon successful Download.

Parameters
objectInstance of cbe::Object that is being downloaded.
dataThe downloaded data of the object.
The provided memory is an array of bytes (char) dynamically allocated by the SDK, and managed by the std::unique_ptr. So, no further precautions needed concerning the the disposal of this memory.

◆ onDownloadBinaryError()

virtual void cbe::delegate::DownloadBinaryDelegate::onDownloadBinaryError ( cbe::delegate::TransferError &&  transferError,
cbe::util::Context &&  context 
)
pure virtual

Called if an error is encountered.

◆ onChunkReceived()

virtual void cbe::delegate::DownloadBinaryDelegate::onChunkReceived ( cbe::Object &&  object,
std::uint64_t  received,
std::uint64_t  total 
)
virtual

Called when a chunk of data has been received.

Parameters
objectObject associated with current download.
receivedSize, in number of bytes, of the received chunk.
totalTotal number of bytes received so far.

The documentation for this class was generated from the following file: