// -*- 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
#include <map>
#ifndef APT_8_CLEANER_HEADERS
-#include <apt-pkg/vendor.h>
#include <apt-pkg/sourcelist.h>
#include <apt-pkg/pkgrecords.h>
-#include <apt-pkg/indexrecords.h>
#endif
/** \addtogroup acquire
* \file acquire-item.h
*/
-class indexRecords;
class pkgRecords;
class pkgSourceList;
-class pkgAcqMetaBase;
+class pkgAcqMetaClearSig;
+class pkgAcqIndexMergeDiffs;
+class metaIndex;
class pkgAcquire::Item : public WeakPointable /*{{{*/
/** \brief Represents the process by which a pkgAcquire object should
*
* \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.
virtual std::string GetFinalFilename() const;
private:
- void *d;
+ void * const d;
friend class pkgAcqMetaBase;
+ friend class pkgAcqMetaClearSig;
};
/*}}}*/
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);
std::string PartialFile;
/** \brief TransactionManager */
- pkgAcqMetaBase * const TransactionManager;
+ pkgAcqMetaClearSig * const TransactionManager;
enum TransactionStates {
TransactionCommit,
virtual bool HashesRequired() const;
- pkgAcqTransactionItem(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const Target);
+ pkgAcqTransactionItem(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, IndexTarget const &Target);
virtual ~pkgAcqTransactionItem();
friend class pkgAcqMetaBase;
+ friend class pkgAcqMetaClearSig;
};
/*}}}*/
class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/
/** \brief the manager of a transaction */
{
- void *d;
-
+ void * const d;
protected:
std::vector<pkgAcqTransactionItem*> Transaction;
- public:
- /** \brief A package-system-specific parser for the meta-index file. */
- indexRecords *MetaIndexParser;
- indexRecords *LastMetaIndexParser;
- protected:
-
/** \brief The index files which should be looked up in the meta-index
* and then downloaded.
*/
/** \brief Get the full pathname of the final file for the current URI */
virtual std::string GetFinalFilename() const;
- pkgAcqMetaBase(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
- std::vector<IndexTarget> const IndexTargets,
- IndexTarget const &DataTarget,
- indexRecords* const MetaIndexParser);
+ pkgAcqMetaBase(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
+ std::vector<IndexTarget> const &IndexTargets,
+ IndexTarget const &DataTarget);
+ virtual ~pkgAcqMetaBase();
};
/*}}}*/
/** \brief An item that is responsible for downloading the meta-index {{{
*/
class APT_HIDDEN pkgAcqMetaIndex : public pkgAcqMetaBase
{
- void *d;
-
+ void * const d;
protected:
IndexTarget const DetachedSigTarget;
virtual void Finished();
/** \brief Create a new pkgAcqMetaIndex. */
- pkgAcqMetaIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
+ pkgAcqMetaIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
IndexTarget const &DataTarget, IndexTarget const &DetachedSigTarget,
- std::vector<IndexTarget> const IndexTargets, indexRecords * const MetaIndexParser);
+ std::vector<IndexTarget> const &IndexTargets);
+ virtual ~pkgAcqMetaIndex();
friend class pkgAcqMetaSig;
};
*/
class APT_HIDDEN pkgAcqMetaSig : public pkgAcqTransactionItem
{
- void *d;
+ void * const d;
pkgAcqMetaIndex * const MetaIndex;
virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf);
virtual void Done(std::string const &Message, HashStringList const &Hashes,
pkgAcquire::MethodConfig const * const Cnf);
+ virtual std::string Custom600Headers() const;
/** \brief Create a new pkgAcqMetaSig. */
- pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const Target,
- pkgAcqMetaIndex * const MetaIndex);
+ pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
+ IndexTarget const &Target, pkgAcqMetaIndex * const MetaIndex);
virtual ~pkgAcqMetaSig();
};
/*}}}*/
/** \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:
+ public:
+ /** \brief A package-system-specific parser for the meta-index file. */
+ metaIndex *MetaIndexParser;
+ metaIndex *LastMetaIndexParser;
+
virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf);
virtual std::string Custom600Headers() const;
virtual void Done(std::string const &Message, HashStringList const &Hashes,
IndexTarget const &ClearsignedTarget,
IndexTarget const &DetachedDataTarget,
IndexTarget const &DetachedSigTarget,
- std::vector<IndexTarget> const IndexTargets,
- indexRecords * const MetaIndexParser);
+ std::vector<IndexTarget> const &IndexTargets,
+ metaIndex * const MetaIndexParser);
virtual ~pkgAcqMetaClearSig();
};
/*}}}*/
/** \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);
+ pkgAcqBaseIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
+ IndexTarget const &Target);
+ virtual ~pkgAcqBaseIndex();
};
/*}}}*/
/** \brief An item that is responsible for fetching an index file of {{{
*/
class APT_HIDDEN pkgAcqDiffIndex : public pkgAcqBaseIndex
{
- void *d;
+ void * const d;
+ std::vector<pkgAcqIndexMergeDiffs*> * diffs;
protected:
/** \brief If \b true, debugging information will be written to std::clog. */
*
* \param ShortDesc A short description of the list file to download.
*/
- pkgAcqDiffIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
- IndexTarget const Target);
+ pkgAcqDiffIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
+ IndexTarget const &Target);
+ virtual ~pkgAcqDiffIndex();
private:
APT_HIDDEN void QueueOnIMSHit() const;
};
*/
class APT_HIDDEN pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex
{
- void *d;
+ void * const d;
protected:
* \param allPatches contains all related items so that each item can
* 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,
+ pkgAcqIndexMergeDiffs(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
+ IndexTarget const &Target, DiffInfo const &patch,
std::vector<pkgAcqIndexMergeDiffs*> const * const allPatches);
+ virtual ~pkgAcqIndexMergeDiffs();
};
/*}}}*/
/** \brief An item that is responsible for fetching server-merge patches {{{
*/
class APT_HIDDEN pkgAcqIndexDiffs : public pkgAcqBaseIndex
{
- void *d;
+ void * const d;
private:
* should be ordered so that each diff appears before any diff
* that depends on it.
*/
- pkgAcqIndexDiffs(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
- IndexTarget const Target,
+ pkgAcqIndexDiffs(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
+ IndexTarget const &Target,
std::vector<DiffInfo> const &diffs=std::vector<DiffInfo>());
+ virtual ~pkgAcqIndexDiffs();
};
/*}}}*/
/** \brief An acquire item that is responsible for fetching an index {{{
*/
class APT_HIDDEN pkgAcqIndex : public pkgAcqBaseIndex
{
- void *d;
+ void * const d;
protected:
virtual std::string DescURI() const {return Desc.URI;};
virtual std::string GetMetaKey() const;
- pkgAcqIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
- IndexTarget const Target);
+ pkgAcqIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
+ 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);
};
/*}}}*/
*/
class pkgAcqArchive : public pkgAcquire::Item
{
- void *d;
+ void * const d;
bool LocalSource;
HashStringList ExpectedHashes;
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 {{{
*/
class pkgAcqChangelog : public pkgAcquire::Item
{
- void *d;
+ void * const d;
std::string TemporaryDirectory;
std::string const SrcName;
std::string const SrcVersion;
*/
class pkgAcqFile : public pkgAcquire::Item
{
- void *d;
+ void * const d;
/** \brief How many times to retry the download, set from
* Acquire::Retries.
std::string const &Desc, std::string const &ShortDesc,
std::string const &DestDir="", std::string const &DestFilename="",
bool const IsIndexFile=false);
+ virtual ~pkgAcqFile();
};
/*}}}*/
/** @} */