]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/acquire-item.h
refactor EDSP classes for better internal reuse
[apt.git] / apt-pkg / acquire-item.h
index 41420a7c113b1e84e2b917e2ef19e9abf5c045ae..92f1ac215d26cacbfbbc6bae4367864ac06a5519 100644 (file)
@@ -393,7 +393,7 @@ class APT_HIDDEN pkgAcqTransactionItem: public pkgAcquire::Item             /*{{{*/
    virtual bool HashesRequired() const APT_OVERRIDE;
 
 
    virtual bool HashesRequired() const APT_OVERRIDE;
 
 
-   pkgAcqTransactionItem(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, IndexTarget const &Target);
+   pkgAcqTransactionItem(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, IndexTarget const &Target) APT_NONNULL(2, 3);
    virtual ~pkgAcqTransactionItem();
 
    friend class pkgAcqMetaBase;
    virtual ~pkgAcqTransactionItem();
 
    friend class pkgAcqMetaBase;
@@ -407,25 +407,10 @@ class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem            /*{{{*/
  protected:
    std::vector<pkgAcqTransactionItem*> Transaction;
 
  protected:
    std::vector<pkgAcqTransactionItem*> Transaction;
 
-   /** \brief The index files which should be looked up in the meta-index
-    *  and then downloaded.
-    */
-   std::vector<IndexTarget> IndexTargets;
-
    /** \brief If \b true, the index's signature is currently being verified.
     */
    bool AuthPass;
 
    /** \brief If \b true, the index's signature is currently being verified.
     */
    bool AuthPass;
 
-   /** \brief Starts downloading the individual index files.
-    *
-    *  \param verify If \b true, only indices whose expected hashsum
-    *  can be determined from the meta-index will be downloaded, and
-    *  the hashsums of indices will be checked (reporting
-    *  #StatAuthError if there is a mismatch).  If verify is \b false,
-    *  no hashsum checking will be performed.
-    */
-   void QueueIndexes(bool const verify);
-
    /** \brief Called when a file is finished being retrieved.
     *
     *  If the file was not downloaded to DestFile, a copy process is
    /** \brief Called when a file is finished being retrieved.
     *
     *  If the file was not downloaded to DestFile, a copy process is
@@ -494,8 +479,7 @@ class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem              /*{{{*/
    virtual std::string GetFinalFilename() const APT_OVERRIDE;
 
    pkgAcqMetaBase(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
    virtual std::string GetFinalFilename() const APT_OVERRIDE;
 
    pkgAcqMetaBase(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
-                 std::vector<IndexTarget> const &IndexTargets,
-                 IndexTarget const &DataTarget);
+                 IndexTarget const &DataTarget) APT_NONNULL(2, 3);
    virtual ~pkgAcqMetaBase();
 };
                                                                        /*}}}*/
    virtual ~pkgAcqMetaBase();
 };
                                                                        /*}}}*/
@@ -528,8 +512,7 @@ class APT_HIDDEN pkgAcqMetaIndex : public pkgAcqMetaBase
 
    /** \brief Create a new pkgAcqMetaIndex. */
    pkgAcqMetaIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
 
    /** \brief Create a new pkgAcqMetaIndex. */
    pkgAcqMetaIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
-                  IndexTarget const &DataTarget, IndexTarget const &DetachedSigTarget,
-                  std::vector<IndexTarget> const &IndexTargets);
+                  IndexTarget const &DataTarget, IndexTarget const &DetachedSigTarget) APT_NONNULL(2, 3);
    virtual ~pkgAcqMetaIndex();
 
    friend class pkgAcqMetaSig;
    virtual ~pkgAcqMetaIndex();
 
    friend class pkgAcqMetaSig;
@@ -568,7 +551,7 @@ class APT_HIDDEN pkgAcqMetaSig : public pkgAcqTransactionItem
 
    /** \brief Create a new pkgAcqMetaSig. */
    pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
 
    /** \brief Create a new pkgAcqMetaSig. */
    pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
-        IndexTarget const &Target, pkgAcqMetaIndex * const MetaIndex);
+        IndexTarget const &Target, pkgAcqMetaIndex * const MetaIndex) APT_NONNULL(2, 3, 5);
    virtual ~pkgAcqMetaSig();
 };
                                                                        /*}}}*/
    virtual ~pkgAcqMetaSig();
 };
                                                                        /*}}}*/
@@ -592,12 +575,21 @@ class APT_HIDDEN pkgAcqMetaClearSig : public pkgAcqMetaIndex
                     pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
    virtual void Finished() APT_OVERRIDE;
 
                     pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
    virtual void Finished() APT_OVERRIDE;
 
+   /** \brief Starts downloading the individual index files.
+    *
+    *  \param verify If \b true, only indices whose expected hashsum
+    *  can be determined from the meta-index will be downloaded, and
+    *  the hashsums of indices will be checked (reporting
+    *  #StatAuthError if there is a mismatch).  If verify is \b false,
+    *  no hashsum checking will be performed.
+    */
+   void QueueIndexes(bool const verify);
+
    /** \brief Create a new pkgAcqMetaClearSig. */
    pkgAcqMetaClearSig(pkgAcquire * const Owner,
                IndexTarget const &ClearsignedTarget,
                IndexTarget const &DetachedDataTarget,
                IndexTarget const &DetachedSigTarget,
    /** \brief Create a new pkgAcqMetaClearSig. */
    pkgAcqMetaClearSig(pkgAcquire * const Owner,
                IndexTarget const &ClearsignedTarget,
                IndexTarget const &DetachedDataTarget,
                IndexTarget const &DetachedSigTarget,
-               std::vector<IndexTarget> const &IndexTargets,
                metaIndex * const MetaIndexParser);
    virtual ~pkgAcqMetaClearSig();
 };
                metaIndex * const MetaIndexParser);
    virtual ~pkgAcqMetaClearSig();
 };
@@ -613,7 +605,7 @@ class APT_HIDDEN pkgAcqBaseIndex : public pkgAcqTransactionItem
    virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
 
    pkgAcqBaseIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
    virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
 
    pkgAcqBaseIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
-                   IndexTarget const &Target);
+                   IndexTarget const &Target) APT_NONNULL(2, 3);
    virtual ~pkgAcqBaseIndex();
 };
                                                                        /*}}}*/
    virtual ~pkgAcqBaseIndex();
 };
                                                                        /*}}}*/
@@ -678,7 +670,7 @@ class APT_HIDDEN pkgAcqDiffIndex : public pkgAcqBaseIndex
     *  \param ShortDesc A short description of the list file to download.
     */
    pkgAcqDiffIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
     *  \param ShortDesc A short description of the list file to download.
     */
    pkgAcqDiffIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
-                   IndexTarget const &Target);
+                   IndexTarget const &Target) APT_NONNULL(2, 3);
    virtual ~pkgAcqDiffIndex();
  private:
    APT_HIDDEN void QueueOnIMSHit() const;
    virtual ~pkgAcqDiffIndex();
  private:
    APT_HIDDEN void QueueOnIMSHit() const;
@@ -778,7 +770,7 @@ class APT_HIDDEN pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex
     */
    pkgAcqIndexMergeDiffs(pkgAcquire * const Owner, pkgAcqMetaClearSig * 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);
+                         std::vector<pkgAcqIndexMergeDiffs*> const * const allPatches) APT_NONNULL(2, 3, 6);
    virtual ~pkgAcqIndexMergeDiffs();
 };
                                                                        /*}}}*/
    virtual ~pkgAcqIndexMergeDiffs();
 };
                                                                        /*}}}*/
@@ -889,7 +881,7 @@ class APT_HIDDEN pkgAcqIndexDiffs : public pkgAcqBaseIndex
     */
    pkgAcqIndexDiffs(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
                     IndexTarget const &Target,
     */
    pkgAcqIndexDiffs(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
                     IndexTarget const &Target,
-                   std::vector<DiffInfo> const &diffs=std::vector<DiffInfo>());
+                   std::vector<DiffInfo> const &diffs=std::vector<DiffInfo>()) APT_NONNULL(2, 3);
    virtual ~pkgAcqIndexDiffs();
 };
                                                                        /*}}}*/
    virtual ~pkgAcqIndexDiffs();
 };
                                                                        /*}}}*/
@@ -956,7 +948,7 @@ class APT_HIDDEN pkgAcqIndex : public pkgAcqBaseIndex
    virtual std::string GetMetaKey() const APT_OVERRIDE;
 
    pkgAcqIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
    virtual std::string GetMetaKey() const APT_OVERRIDE;
 
    pkgAcqIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
-               IndexTarget const &Target);
+               IndexTarget const &Target) APT_NONNULL(2, 3);
    virtual ~pkgAcqIndex();
 
    private:
    virtual ~pkgAcqIndex();
 
    private: