mcloud  1.0.0
MCloud API library for cmcc cloud service
mcloud::api::DownloadTask Class Reference

DownloadTask is a task item that can be accessed from application layer to fetch basic download item information, also it's used for content download by sync manager. More...

#include <downloadtask.h>

+ Inheritance diagram for mcloud::api::DownloadTask:
+ Collaboration diagram for mcloud::api::DownloadTask:

Public Types

typedef std::shared_ptr< DownloadTaskPtr
 
- Public Types inherited from mcloud::api::Task
enum  Status {
  Status::Unstart,
  Status::Running,
  Status::Canceled,
  Status::Paused,
  Status::Broken,
  Status::Complete
}
 The Status enum indicates current status of this task. More...
 
typedef std::function< void(float)> ProgressHandler
 
typedef std::function< void(Status)> StatusHandler
 
typedef std::function< size_t(void *dest, size_t buf_size)> Buffer_Callback
 

Public Member Functions

virtual ~DownloadTask ()=default
 
 DownloadTask (const DownloadTask &)=delete
 
DownloadTaskoperator= (const DownloadTask &)=delete
 
const std::string & task_id () const override
 
const std::string & content_id () const override
 Returns an unique id of cloud content on mcloud. More...
 
const std::string & content_name () const override
 Returns a display name of cloud content on mcloud. More...
 
const std::string & file_path () const override
 Returns cloud content local storage file path. More...
 
const std::string & task_url () const override
 Returns download url assigned by mcloud for this task. More...
 
const std::string & error_string () const override
 Contains the error string if an error occurs during content download. More...
 
Task::Status status () const override
 Returns current sync-up status for this task. More...
 
Task::ProgressHandlerprogress_changed () override
 Handler for download progress of a task. More...
 
Task::StatusHandlerstatus_changed () override
 Handler for download status of a task. More...
 
void cancel () override
 cancel the task. More...
 
- Public Member Functions inherited from mcloud::api::Task
virtual ~Task ()=default
 

Friends

class SyncManagerPriv
 

Detailed Description

DownloadTask is a task item that can be accessed from application layer to fetch basic download item information, also it's used for content download by sync manager.

Definition at line 50 of file downloadtask.h.

Member Typedef Documentation

◆ Ptr

typedef std::shared_ptr<DownloadTask> mcloud::api::DownloadTask::Ptr

Definition at line 52 of file downloadtask.h.

Constructor & Destructor Documentation

◆ ~DownloadTask()

virtual mcloud::api::DownloadTask::~DownloadTask ( )
virtualdefault

◆ DownloadTask()

mcloud::api::DownloadTask::DownloadTask ( const DownloadTask )
delete

Member Function Documentation

◆ cancel()

void mcloud::api::DownloadTask::cancel ( )
overridevirtual

cancel the task.

See also
Task::StatusHandler

Implements mcloud::api::Task.

◆ content_id()

const std::string& mcloud::api::DownloadTask::content_id ( ) const
overridevirtual

Returns an unique id of cloud content on mcloud.

Implements mcloud::api::Task.

◆ content_name()

const std::string& mcloud::api::DownloadTask::content_name ( ) const
overridevirtual

Returns a display name of cloud content on mcloud.

Implements mcloud::api::Task.

◆ error_string()

const std::string& mcloud::api::DownloadTask::error_string ( ) const
overridevirtual

Contains the error string if an error occurs during content download.

Implements mcloud::api::Task.

◆ file_path()

const std::string& mcloud::api::DownloadTask::file_path ( ) const
overridevirtual

Returns cloud content local storage file path.

Implements mcloud::api::Task.

◆ operator=()

DownloadTask& mcloud::api::DownloadTask::operator= ( const DownloadTask )
delete

◆ progress_changed()

Task::ProgressHandler& mcloud::api::DownloadTask::progress_changed ( )
overridevirtual

Handler for download progress of a task.

See also
Task::ProgressHandler

Implements mcloud::api::Task.

◆ status()

Task::Status mcloud::api::DownloadTask::status ( ) const
overridevirtual

Returns current sync-up status for this task.

See also
Task::TaskStatus

Implements mcloud::api::Task.

◆ status_changed()

Task::StatusHandler& mcloud::api::DownloadTask::status_changed ( )
overridevirtual

Handler for download status of a task.

See also
Task::StatusHandler

Implements mcloud::api::Task.

◆ task_id()

const std::string& mcloud::api::DownloadTask::task_id ( ) const
overridevirtual

Returns an unique id of download task.

Implements mcloud::api::Task.

◆ task_url()

const std::string& mcloud::api::DownloadTask::task_url ( ) const
overridevirtual

Returns download url assigned by mcloud for this task.

Note
this url will be expried after a period of time.

Implements mcloud::api::Task.

Friends And Related Function Documentation

◆ SyncManagerPriv

friend class SyncManagerPriv
friend

Definition at line 118 of file downloadtask.h.


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