libzypp: internal::OptionalDownloadProgressReport Struct Reference

libzypp 17.38.9

internal::OptionalDownloadProgressReport Struct Reference

Bottleneck filtering all DownloadProgressReport issued from Media[Muli]Curl. More...

`#include <zypp/media/detail/OptionalDownloadProgressReport.h>`

Inheritance diagram for internal::OptionalDownloadProgressReport:

## Public Types
using | TimePoint = std::chrono::steady_clock::time_point
Public Types inherited from zypp::callback::ReceiveReport< zypp::media::DownloadProgressReport >
typedef zypp::media::DownloadProgressReport | ReportType
typedef ReceiveReport< zypp::media::DownloadProgressReport > | Receiver
typedef DistributeReport< zypp::media::DownloadProgressReport > | Distributor
Public Types inherited from zypp::media::DownloadProgressReport
enum | Action { ABORT , RETRY , IGNORE }
enum | Error { NO_ERROR , NOT_FOUND , IO , ACCESS_DENIED , ERROR }
Public Types inherited from zypp::callback::ReportBase
typedef callback::UserData | UserData
typedef UserData::ContentType | ContentType

## Public Member Functions
| OptionalDownloadProgressReport (bool isOptional=false)
| OptionalDownloadProgressReport (const OptionalDownloadProgressReport &)=delete
| OptionalDownloadProgressReport (OptionalDownloadProgressReport &&)=delete
OptionalDownloadProgressReport & | operator= (const OptionalDownloadProgressReport &)=delete
OptionalDownloadProgressReport & | operator= (OptionalDownloadProgressReport &&)=delete
| ~OptionalDownloadProgressReport () override
void | reportbegin () override
void | reportend () override
void | report (const UserData &userData_r=UserData()) override
| The most generic way of sending/receiving data.
void | start (const zypp::Url &file_r, zypp::Pathname localfile_r) override
bool | progress (int value_r, const zypp::Url &file_r, double dbps_avg_r=-1, double dbps_current_r=-1) override
| Download progress.
Action | problem (const zypp::Url &file_r, Error error_r, const std::string &description_r) override
void | finish (const zypp::Url &file_r, Error error_r, const std::string &reason_r) override
Public Member Functions inherited from zypp::callback::ReceiveReport< zypp::media::DownloadProgressReport >
virtual | ~ReceiveReport ()
ReceiveReport * | whoIsConnected () const
bool | connected () const
void | connect ()
void | disconnect ()
Public Member Functions inherited from zypp::callback::ReportBase
virtual | ~ReportBase ()

## Private Member Functions
bool | notStarted () const
void | sendStart ()

## Private Attributes
Receiver *const | _oldRec
bool | _isOptional
zypp::Url | _startFile
zypp::Pathname | _startLocalfile
TimePoint | _lastProgressSent

## Detailed Description

Bottleneck filtering all DownloadProgressReport issued from Media[Muli]Curl.

- Optional files will send no report until data are actually received (we know it exists).
- Control the progress report frequency passed along to the application.

Definition at line 21 of file OptionalDownloadProgressReport.h.

## Member Typedef Documentation

## ◆ TimePoint

using internal::OptionalDownloadProgressReport::TimePoint = std::chrono::steady_clock::time_point

Definition at line 23 of file OptionalDownloadProgressReport.h.

## Constructor & Destructor Documentation

## ◆ OptionalDownloadProgressReport() [1/3]

internal::OptionalDownloadProgressReport::OptionalDownloadProgressReport | ( | bool | isOptional = false | ) |

Definition at line 16 of file OptionalDownloadProgressReport.cc.

## ◆ OptionalDownloadProgressReport() [2/3]

internal::OptionalDownloadProgressReport::OptionalDownloadProgressReport | ( | const OptionalDownloadProgressReport & |  | ) |
| delete

## ◆ OptionalDownloadProgressReport() [3/3]

internal::OptionalDownloadProgressReport::OptionalDownloadProgressReport | ( | OptionalDownloadProgressReport && |  | ) |
| delete

## ◆ ~OptionalDownloadProgressReport()

internal::OptionalDownloadProgressReport::~OptionalDownloadProgressReport | ( |  | ) |
| override

Definition at line 21 of file OptionalDownloadProgressReport.cc.

## Member Function Documentation

## ◆ operator=() [1/2]

OptionalDownloadProgressReport & internal::OptionalDownloadProgressReport::operator= | ( | const OptionalDownloadProgressReport & |  | ) |
| delete

## ◆ operator=() [2/2]

OptionalDownloadProgressReport & internal::OptionalDownloadProgressReport::operator= | ( | OptionalDownloadProgressReport && |  | ) |
| delete

## ◆ reportbegin()

void internal::OptionalDownloadProgressReport::reportbegin | ( |  | ) |
| overridevirtual

Reimplemented from zypp::callback::ReceiveReport< zypp::media::DownloadProgressReport >.

Definition at line 28 of file OptionalDownloadProgressReport.cc.

## ◆ reportend()

void internal::OptionalDownloadProgressReport::reportend | ( |  | ) |
| overridevirtual

Reimplemented from zypp::callback::ReceiveReport< zypp::media::DownloadProgressReport >.

Definition at line 31 of file OptionalDownloadProgressReport.cc.

## ◆ report()

void internal::OptionalDownloadProgressReport::report | ( | const UserData & | userData_r = UserData() | ) |
| overridevirtual

The most generic way of sending/receiving data.

Reimplemented from zypp::callback::ReportBase.

Definition at line 34 of file OptionalDownloadProgressReport.cc.

## ◆ start()

void internal::OptionalDownloadProgressReport::start | ( | const zypp::Url & | file_r,
|  | zypp::Pathname | localfile_r )
| overridevirtual

Reimplemented from zypp::media::DownloadProgressReport.

Definition at line 37 of file OptionalDownloadProgressReport.cc.

## ◆ progress()

bool internal::OptionalDownloadProgressReport::progress | ( | int | ,
|  | const zypp::Url & | ,
|  | double | dbps_avg = -1,
|  | double | dbps_current = -1 )
| overridevirtual

Download progress.

Parameters

  value | Percentage value.
  file | File URI.
  dbps_avg | Average download rate so far. -1 if unknown.
  dbps_current | Current download (cca last 1 sec). -1 if unknown.

Reimplemented from zypp::media::DownloadProgressReport.

Definition at line 49 of file OptionalDownloadProgressReport.cc.

## ◆ problem()

media::DownloadProgressReport::Action internal::OptionalDownloadProgressReport::problem | ( | const zypp::Url & | file_r,
|  | Error | error_r,
|  | const std::string & | description_r )
| overridevirtual

Reimplemented from zypp::media::DownloadProgressReport.

Definition at line 68 of file OptionalDownloadProgressReport.cc.

## ◆ finish()

void internal::OptionalDownloadProgressReport::finish | ( | const zypp::Url & | file_r,
|  | Error | error_r,
|  | const std::string & | reason_r )
| overridevirtual

Reimplemented from zypp::media::DownloadProgressReport.

Definition at line 74 of file OptionalDownloadProgressReport.cc.

## ◆ notStarted()

bool internal::OptionalDownloadProgressReport::notStarted | ( |  | ) | const
| private

Definition at line 80 of file OptionalDownloadProgressReport.cc.

## ◆ sendStart()

void internal::OptionalDownloadProgressReport::sendStart | ( |  | ) |
| private

Definition at line 83 of file OptionalDownloadProgressReport.cc.

## Member Data Documentation

## ◆ _oldRec

Receiver* const internal::OptionalDownloadProgressReport::_oldRec
| private

Definition at line 55 of file OptionalDownloadProgressReport.h.

## ◆ _isOptional

bool internal::OptionalDownloadProgressReport::_isOptional
| private

Definition at line 56 of file OptionalDownloadProgressReport.h.

## ◆ _startFile

zypp::Url internal::OptionalDownloadProgressReport::_startFile
| private

Definition at line 57 of file OptionalDownloadProgressReport.h.

## ◆ _startLocalfile

zypp::Pathname internal::OptionalDownloadProgressReport::_startLocalfile
| private

Definition at line 58 of file OptionalDownloadProgressReport.h.

## ◆ _lastProgressSent

TimePoint internal::OptionalDownloadProgressReport::_lastProgressSent
| private

Definition at line 59 of file OptionalDownloadProgressReport.h.

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

- zypp/media/detail/OptionalDownloadProgressReport.h
- zypp/media/detail/OptionalDownloadProgressReport.cc