libapt-pkg-dev  v0.9.7.5ubuntu5.4
Debian+Ubuntu APT Package Management
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pkgAcquireStatus Class Referenceabstract

A monitor object for downloads controlled by the pkgAcquire class. More...

#include <acquire.h>

Collaboration diagram for pkgAcquireStatus:

Public Member Functions

 pkgAcquireStatus ()
 Initialize all counters to 0 and the time to the current time. More...
 
virtual ~pkgAcquireStatus ()
 
virtual void Done (pkgAcquire::ItemDesc &)
 Invoked when an item is successfully and completely fetched. More...
 
virtual void Fail (pkgAcquire::ItemDesc &)
 Invoked when the process of fetching an item encounters a fatal error. More...
 
virtual void Fetch (pkgAcquire::ItemDesc &)
 Invoked when some of an item's data is fetched. More...
 
virtual void Fetched (unsigned long long Size, unsigned long long ResumePoint)
 Invoked when a local or remote file has been completely fetched. More...
 
virtual void IMSHit (pkgAcquire::ItemDesc &)
 Invoked when an item is confirmed to be up-to-date. More...
 
virtual bool MediaChange (std::string Media, std::string Drive)=0
 Invoked when the user should be prompted to change the inserted removable media. More...
 
virtual bool Pulse (pkgAcquire *Owner)
 Periodically invoked while the Acquire process is underway. More...
 
virtual void Start ()
 Invoked when the Acquire process starts running. More...
 
virtual void Stop ()
 Invoked when the Acquire process stops running. More...
 

Public Attributes

bool MorePulses
 If true, extra Pulse() invocations will be performed. More...
 
bool Update
 If true, the download scheduler should call Pulse() at the next available opportunity. More...
 

Protected Attributes

unsigned long long CurrentBytes
 The number of bytes fetched as of the most recent call to pkgAcquireStatus::Pulse, including local items. More...
 
unsigned long long CurrentCPS
 The current rate of download as of the most recent call to pkgAcquireStatus::Pulse, in bytes per second. More...
 
unsigned long CurrentItems
 The number of items that have been successfully downloaded. More...
 
unsigned long long ElapsedTime
 The amount of time that has elapsed since the download started. More...
 
unsigned long long FetchedBytes
 The total number of bytes accounted for by items that were successfully fetched. More...
 
unsigned long long LastBytes
 The number of bytes fetched as of the previous call to pkgAcquireStatus::Pulse, including local items. More...
 
struct timeval StartTime
 The time at which the download started. More...
 
struct timeval Time
 The last time at which this monitor object was updated. More...
 
unsigned long long TotalBytes
 The total number of bytes that need to be fetched. More...
 
unsigned long TotalItems
 The total number of items that need to be fetched. More...
 

Private Attributes

void * d
 dpointer placeholder (for later in case we need it) More...
 

Detailed Description

A monitor object for downloads controlled by the pkgAcquire class.

{{{
Todo:
Why protected members?

Constructor & Destructor Documentation

pkgAcquireStatus::pkgAcquireStatus ( )

Initialize all counters to 0 and the time to the current time.

virtual pkgAcquireStatus::~pkgAcquireStatus ( )
inlinevirtual

Member Function Documentation

virtual void pkgAcquireStatus::Done ( pkgAcquire::ItemDesc )
inlinevirtual

Invoked when an item is successfully and completely fetched.

virtual void pkgAcquireStatus::Fail ( pkgAcquire::ItemDesc )
inlinevirtual

Invoked when the process of fetching an item encounters a fatal error.

virtual void pkgAcquireStatus::Fetch ( pkgAcquire::ItemDesc )
inlinevirtual

Invoked when some of an item's data is fetched.

virtual void pkgAcquireStatus::Fetched ( unsigned long long  Size,
unsigned long long  ResumePoint 
)
virtual

Invoked when a local or remote file has been completely fetched.

Parameters
SizeThe size of the file fetched.
ResumePointHow much of the file was already fetched.
virtual void pkgAcquireStatus::IMSHit ( pkgAcquire::ItemDesc )
inlinevirtual

Invoked when an item is confirmed to be up-to-date.

For instance, when an HTTP download is informed that the file on the server was not modified.

virtual bool pkgAcquireStatus::MediaChange ( std::string  Media,
std::string  Drive 
)
pure virtual

Invoked when the user should be prompted to change the inserted removable media.

This method should not return until the user has confirmed to the user interface that the media change is complete.

Parameters
MediaThe name of the media type that should be changed.
DriveThe identifying name of the drive whose media should be changed.
Returns
true if the user confirms the media change, false if it is cancelled.
Todo:
This is a horrible blocking monster; it should be CPSed with prejudice.
virtual bool pkgAcquireStatus::Pulse ( pkgAcquire Owner)
virtual

Periodically invoked while the Acquire process is underway.

Subclasses should first call pkgAcquireStatus::Pulse(), then update their status output. The download process is blocked while Pulse() is being called.

Returns
false if the user asked to cancel the whole Acquire process.
See Also
pkgAcquire::Run
virtual void pkgAcquireStatus::Start ( )
virtual

Invoked when the Acquire process starts running.

virtual void pkgAcquireStatus::Stop ( )
virtual

Invoked when the Acquire process stops running.

Member Data Documentation

unsigned long long pkgAcquireStatus::CurrentBytes
protected

The number of bytes fetched as of the most recent call to pkgAcquireStatus::Pulse, including local items.

unsigned long long pkgAcquireStatus::CurrentCPS
protected

The current rate of download as of the most recent call to pkgAcquireStatus::Pulse, in bytes per second.

unsigned long pkgAcquireStatus::CurrentItems
protected

The number of items that have been successfully downloaded.

void* pkgAcquireStatus::d
private

dpointer placeholder (for later in case we need it)

unsigned long long pkgAcquireStatus::ElapsedTime
protected

The amount of time that has elapsed since the download started.

unsigned long long pkgAcquireStatus::FetchedBytes
protected

The total number of bytes accounted for by items that were successfully fetched.

unsigned long long pkgAcquireStatus::LastBytes
protected

The number of bytes fetched as of the previous call to pkgAcquireStatus::Pulse, including local items.

bool pkgAcquireStatus::MorePulses

If true, extra Pulse() invocations will be performed.

With this option set, Pulse() will be called every time that a download item starts downloading, finishes downloading, or terminates with an error.

struct timeval pkgAcquireStatus::StartTime
protected

The time at which the download started.

struct timeval pkgAcquireStatus::Time
protected

The last time at which this monitor object was updated.

unsigned long long pkgAcquireStatus::TotalBytes
protected

The total number of bytes that need to be fetched.

Warning
This member is inaccurate, as new items might be enqueued while the download is in progress!
unsigned long pkgAcquireStatus::TotalItems
protected

The total number of items that need to be fetched.

Warning
This member is inaccurate, as new items might be enqueued while the download is in progress!
bool pkgAcquireStatus::Update

If true, the download scheduler should call Pulse() at the next available opportunity.


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