Transfer Ease
Loading...
Searching...
No Matches
tease::Request Class Reference

Manage a ressource request informations. More...

Public Types

enum  TypeTransfer { TRANSFER_UNK = 0 , TRANSFER_DOWNLOAD , TRANSFER_UPLOAD }
 List of types of transfers. More...
 
using PtrShared = std::shared_ptr<Request>
 
using List = std::vector<PtrShared>
 

Public Member Functions

void clear ()
 
void configureDownload (const Url &targetUrl)
 Use to configure download request.
 
void configureUpload (const Url &dstUrl, const BytesArray &inputData)
 Use to configure upload request.
 
void configureUpload (const Url &dstUrl, BytesArray &&inputData)
 
TypeTransfer getTypeTransfer () const
 
const UrlgetUrl () const
 
BytesArraygetData ()
 
const BytesArraygetData () const
 
size_t ioRead (char *buffer, size_t nbBytes)
 
void ioSetSizeTotal (size_t size)
 
void ioSetSizeCurrent (size_t size)
 
void ioRegisterTry ()
 
void ioAbort ()
 
void ioReset ()
 
size_t ioGetSizeTotal () const
 
size_t ioGetSizeCurrent () const
 
int ioGetNbTrials () const
 
bool ioIsAbort () const
 

Detailed Description

Manage a ressource request informations.

This class will be used to store request informations : where to download, where to upload, etc... and associated datas.
This class will be responsible to store I/O informations used during transfer.

See also
configureDownload(), configureUpload()

Member Typedef Documentation

◆ List

using tease::Request::List = std::vector<PtrShared>

Alias representing a list of requests

◆ PtrShared

using tease::Request::PtrShared = std::shared_ptr<Request>

Request shared pointer type alias

Member Enumeration Documentation

◆ TypeTransfer

List of types of transfers.

Enumerator
TRANSFER_UNK 

Unknown type of transfer, mainly used to represent an unitialized transfer

TRANSFER_DOWNLOAD  

Ressources are downloaded from remote to host

TRANSFER_UPLOAD  

Ressources are uploaded from host to remote

Member Function Documentation

◆ configureDownload()

void tease::Request::configureDownload ( const Url & targetUrl)

Use to configure download request.

Once request transfer will be completed (and with sucess), downloaded data will be available via getData().

Parameters
[in]targetUrlURL of ressource to download
See also
configureUpload()

◆ configureUpload() [1/2]

void tease::Request::configureUpload ( const Url & dstUrl,
BytesArray && inputData )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]dstUrlURL used to upload the ressource.
[in,out]inputDataData to upload without performing a deep copy.
Can be called with:
request->configureUpload(myCustomUrl, std::move(byteArrayToUpload));

◆ configureUpload() [2/2]

void tease::Request::configureUpload ( const Url & dstUrl,
const BytesArray & inputData )

Use to configure upload request.

Parameters
[in]dstUrlURL used to upload the ressource.
[in]inputDataData to upload.
Those will be copied, so to limit copy, please use the overloaded method.
See also
configureDownload()

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