X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/d56e2917f27a722b54685de13aeb1bb7592fc61b..1b36b5fa1b8dbd76aec7ddd4ffe72f8515c29038:/apt-pkg/acquire-item.h diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 606fd4173..c4bbfc7a1 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -1,6 +1,5 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: acquire-item.h,v 1.26.2.3 2004/01/02 18:51:00 mdz Exp $ /* ###################################################################### Acquire Item - Item to acquire @@ -249,6 +248,7 @@ class pkgAcquire::Item : public WeakPointable /*{{{*/ /** \return the acquire process with which this item is associated. */ pkgAcquire *GetOwner() const; + pkgAcquire::ItemDesc &GetItemDesc(); /** \return \b true if this object is being fetched from a trusted source. */ virtual bool IsTrusted() const; @@ -276,7 +276,7 @@ class pkgAcquire::Item : public WeakPointable /*{{{*/ * * \param Owner The new owner of this item. */ - Item(pkgAcquire * const Owner); + explicit Item(pkgAcquire * const Owner); /** \brief Remove this item from its owner's queue by invoking * pkgAcquire::Remove. @@ -336,7 +336,7 @@ class pkgAcquire::Item : public WeakPointable /*{{{*/ virtual std::string GetFinalFilename() const; private: - void *d; + void * const d; friend class pkgAcqMetaBase; }; @@ -344,9 +344,10 @@ class pkgAcquire::Item : public WeakPointable /*{{{*/ class APT_HIDDEN pkgAcqTransactionItem: public pkgAcquire::Item /*{{{*/ /** \brief baseclass for the indexes files to manage them all together */ { + void * const d; protected: IndexTarget const Target; - HashStringList GetExpectedHashesFor(std::string const MetaKey) const; + HashStringList GetExpectedHashesFor(std::string const &MetaKey) const; bool QueueURI(pkgAcquire::ItemDesc &Item); @@ -369,7 +370,7 @@ class APT_HIDDEN pkgAcqTransactionItem: public pkgAcquire::Item /*{{{*/ virtual bool HashesRequired() const; - pkgAcqTransactionItem(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const Target); + pkgAcqTransactionItem(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const &Target); virtual ~pkgAcqTransactionItem(); friend class pkgAcqMetaBase; @@ -378,8 +379,7 @@ class APT_HIDDEN pkgAcqTransactionItem: public pkgAcquire::Item /*{{{*/ class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/ /** \brief the manager of a transaction */ { - void *d; - + void * const d; protected: std::vector Transaction; @@ -474,9 +474,10 @@ class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/ virtual std::string GetFinalFilename() const; pkgAcqMetaBase(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - std::vector const IndexTargets, + std::vector const &IndexTargets, IndexTarget const &DataTarget, indexRecords* const MetaIndexParser); + virtual ~pkgAcqMetaBase(); }; /*}}}*/ /** \brief An item that is responsible for downloading the meta-index {{{ @@ -491,8 +492,7 @@ class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/ */ class APT_HIDDEN pkgAcqMetaIndex : public pkgAcqMetaBase { - void *d; - + void * const d; protected: IndexTarget const DetachedSigTarget; @@ -511,7 +511,8 @@ class APT_HIDDEN pkgAcqMetaIndex : public pkgAcqMetaBase /** \brief Create a new pkgAcqMetaIndex. */ pkgAcqMetaIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const &DataTarget, IndexTarget const &DetachedSigTarget, - std::vector const IndexTargets, indexRecords * const MetaIndexParser); + std::vector const &IndexTargets, indexRecords * const MetaIndexParser); + virtual ~pkgAcqMetaIndex(); friend class pkgAcqMetaSig; }; @@ -526,7 +527,7 @@ class APT_HIDDEN pkgAcqMetaIndex : public pkgAcqMetaBase */ class APT_HIDDEN pkgAcqMetaSig : public pkgAcqTransactionItem { - void *d; + void * const d; pkgAcqMetaIndex * const MetaIndex; @@ -547,7 +548,7 @@ class APT_HIDDEN pkgAcqMetaSig : public pkgAcqTransactionItem pkgAcquire::MethodConfig const * const Cnf); /** \brief Create a new pkgAcqMetaSig. */ - pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const Target, + pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const &Target, pkgAcqMetaIndex * const MetaIndex); virtual ~pkgAcqMetaSig(); }; @@ -555,11 +556,10 @@ class APT_HIDDEN pkgAcqMetaSig : public pkgAcqTransactionItem /** \brief An item repsonsible for downloading clearsigned metaindexes {{{*/ class APT_HIDDEN pkgAcqMetaClearSig : public pkgAcqMetaIndex { - void *d; + void * const d; IndexTarget const ClearsignedTarget; IndexTarget const DetachedDataTarget; - IndexTarget const DetachedSigTarget; public: virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); @@ -572,7 +572,7 @@ public: IndexTarget const &ClearsignedTarget, IndexTarget const &DetachedDataTarget, IndexTarget const &DetachedSigTarget, - std::vector const IndexTargets, + std::vector const &IndexTargets, indexRecords * const MetaIndexParser); virtual ~pkgAcqMetaClearSig(); }; @@ -580,14 +580,15 @@ public: /** \brief Common base class for all classes that deal with fetching indexes {{{*/ class APT_HIDDEN pkgAcqBaseIndex : public pkgAcqTransactionItem { - void *d; + void * const d; public: /** \brief Get the full pathname of the final file for the current URI */ virtual std::string GetFinalFilename() const; pkgAcqBaseIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const Target); + IndexTarget const &Target); + virtual ~pkgAcqBaseIndex(); }; /*}}}*/ /** \brief An item that is responsible for fetching an index file of {{{ @@ -601,7 +602,7 @@ class APT_HIDDEN pkgAcqBaseIndex : public pkgAcqTransactionItem */ class APT_HIDDEN pkgAcqDiffIndex : public pkgAcqBaseIndex { - void *d; + void * const d; protected: /** \brief If \b true, debugging information will be written to std::clog. */ @@ -650,7 +651,8 @@ class APT_HIDDEN pkgAcqDiffIndex : public pkgAcqBaseIndex * \param ShortDesc A short description of the list file to download. */ pkgAcqDiffIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const Target); + IndexTarget const &Target); + virtual ~pkgAcqDiffIndex(); private: APT_HIDDEN void QueueOnIMSHit() const; }; @@ -682,7 +684,7 @@ struct APT_HIDDEN DiffInfo { /*{{{*/ */ class APT_HIDDEN pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex { - void *d; + void * const d; protected: @@ -748,8 +750,9 @@ class APT_HIDDEN pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex * check if it was the last one to complete the download step */ pkgAcqIndexMergeDiffs(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const Target, DiffInfo const &patch, + IndexTarget const &Target, DiffInfo const &patch, std::vector const * const allPatches); + virtual ~pkgAcqIndexMergeDiffs(); }; /*}}}*/ /** \brief An item that is responsible for fetching server-merge patches {{{ @@ -765,7 +768,7 @@ class APT_HIDDEN pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex */ class APT_HIDDEN pkgAcqIndexDiffs : public pkgAcqBaseIndex { - void *d; + void * const d; private: @@ -861,8 +864,9 @@ class APT_HIDDEN pkgAcqIndexDiffs : public pkgAcqBaseIndex * that depends on it. */ pkgAcqIndexDiffs(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const Target, + IndexTarget const &Target, std::vector const &diffs=std::vector()); + virtual ~pkgAcqIndexDiffs(); }; /*}}}*/ /** \brief An acquire item that is responsible for fetching an index {{{ @@ -874,7 +878,7 @@ class APT_HIDDEN pkgAcqIndexDiffs : public pkgAcqBaseIndex */ class APT_HIDDEN pkgAcqIndex : public pkgAcqBaseIndex { - void *d; + void * const d; protected: @@ -938,9 +942,11 @@ class APT_HIDDEN pkgAcqIndex : public pkgAcqBaseIndex virtual std::string GetMetaKey() const; pkgAcqIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const Target); + IndexTarget const &Target); + virtual ~pkgAcqIndex(); - void Init(std::string const &URI, std::string const &URIDesc, + private: + APT_HIDDEN void Init(std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc); }; /*}}}*/ @@ -951,7 +957,7 @@ class APT_HIDDEN pkgAcqIndex : public pkgAcqBaseIndex */ class pkgAcqArchive : public pkgAcquire::Item { - void *d; + void * const d; bool LocalSource; HashStringList ExpectedHashes; @@ -1029,6 +1035,7 @@ class pkgAcqArchive : public pkgAcquire::Item pkgAcqArchive(pkgAcquire * const Owner,pkgSourceList * const Sources, pkgRecords * const Recs,pkgCache::VerIterator const &Version, std::string &StoreFilename); + virtual ~pkgAcqArchive(); }; /*}}}*/ /** \brief Retrieve the changelog for the given version {{{ @@ -1038,7 +1045,7 @@ class pkgAcqArchive : public pkgAcquire::Item */ class pkgAcqChangelog : public pkgAcquire::Item { - void *d; + void * const d; std::string TemporaryDirectory; std::string const SrcName; std::string const SrcVersion; @@ -1153,7 +1160,7 @@ private: */ class pkgAcqFile : public pkgAcquire::Item { - void *d; + void * const d; /** \brief How many times to retry the download, set from * Acquire::Retries. @@ -1210,6 +1217,7 @@ class pkgAcqFile : public pkgAcquire::Item std::string const &Desc, std::string const &ShortDesc, std::string const &DestDir="", std::string const &DestFilename="", bool const IsIndexFile=false); + virtual ~pkgAcqFile(); }; /*}}}*/ /** @} */