X-Git-Url: https://git.hcoop.net/ntk/apt.git/blobdiff_plain/961c7214468e3fce4deb432d3a0b31b2510aaafe..b829fb2602a506a01cb2b3fd371e975784d4377c:/apt-pkg/acquire-worker.h diff --git a/apt-pkg/acquire-worker.h b/apt-pkg/acquire-worker.h index 1f6bcc05..848a6bad 100644 --- a/apt-pkg/acquire-worker.h +++ b/apt-pkg/acquire-worker.h @@ -20,10 +20,8 @@ #define PKGLIB_ACQUIRE_WORKER_H #include +#include -#ifdef __GNUG__ -#pragma interface "apt-pkg/acquire-worker.h" -#endif /** \brief A fetch subprocess. * @@ -44,8 +42,11 @@ * * \sa pkgAcqMethod, pkgAcquire::Item, pkgAcquire */ -class pkgAcquire::Worker +class pkgAcquire::Worker : public WeakPointable { + /** \brief dpointer placeholder (for later in case we need it) */ + void *d; + friend class pkgAcquire; protected: @@ -78,7 +79,7 @@ class pkgAcquire::Worker * * \todo Doesn't this duplicate Config->Access? */ - string Access; + std::string Access; /** \brief The PID of the subprocess. */ pid_t Process; @@ -117,13 +118,13 @@ class pkgAcquire::Worker /** \brief The raw text values of messages received from the * worker, in sequence. */ - vector MessageQueue; + std::vector MessageQueue; /** \brief Buffers pending writes to the subprocess. * * \todo Wouldn't a std::dequeue be more appropriate? */ - string OutQueue; + std::string OutQueue; /** \brief Common code for the constructor. * @@ -182,7 +183,7 @@ class pkgAcquire::Worker * * \return \b true. */ - bool Capabilities(string Message); + bool Capabilities(std::string Message); /** \brief Send a 601 Configuration message (containing the APT * configuration) to the subprocess. @@ -213,7 +214,7 @@ class pkgAcquire::Worker * 603 Media Changed, with the Failed field set to \b true if the * user cancelled the media change). */ - bool MediaChange(string Message); + bool MediaChange(std::string Message); /** \brief Invoked when the worked process dies unexpectedly. * @@ -241,22 +242,22 @@ class pkgAcquire::Worker /** \brief The most recent status string received from the * subprocess. */ - string Status; + std::string Status; /** \brief How many bytes of the file have been downloaded. Zero * if the current progress of the file cannot be determined. */ - unsigned long CurrentSize; + unsigned long long CurrentSize; /** \brief The total number of bytes to be downloaded. Zero if the * total size of the final is unknown. */ - unsigned long TotalSize; + unsigned long long TotalSize; /** \brief How much of the file was already downloaded prior to * starting this worker. */ - unsigned long ResumePoint; + unsigned long long ResumePoint; /** \brief Tell the subprocess to download the given item. * @@ -316,7 +317,7 @@ class pkgAcquire::Worker * Closes the file descriptors; if MethodConfig::NeedsCleanup is * \b false, also rudely interrupts the worker with a SIGINT. */ - ~Worker(); + virtual ~Worker(); }; /** @} */