// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: acquire.h,v 1.19 1999/01/30 06:07:24 jgg Exp $
+// $Id: acquire.h,v 1.26 2000/01/17 07:11:49 jgg Exp $
/* ######################################################################
Acquire - File Acquiration
string QueueName(string URI,MethodConfig const *&Config);
// FDSET managers for derived classes
- void SetFds(int &Fd,fd_set *RSet,fd_set *WSet);
- void RunFds(fd_set *RSet,fd_set *WSet);
+ virtual void SetFds(int &Fd,fd_set *RSet,fd_set *WSet);
+ virtual void RunFds(fd_set *RSet,fd_set *WSet);
// A queue calls this when it dequeues an item
void Bump();
public:
MethodConfig *GetConfig(string Access);
- bool Run();
+ enum RunResult {Continue,Failed,Cancelled};
+
+ RunResult Run();
+ void Shutdown();
+
// Simple iteration mechanism
inline Worker *WorkersBegin() {return Workers;};
Worker *WorkerStep(Worker *I);
// Returns the size of the total download set
unsigned long TotalNeeded();
unsigned long FetchNeeded();
+ unsigned long PartialPresent();
pkgAcquire(pkgAcquireStatus *Log = 0);
- ~pkgAcquire();
+ virtual ~pkgAcquire();
};
// Description of an Item+URI
bool ItemDone(QItem *Itm);
bool Startup();
- bool Shutdown();
+ bool Shutdown(bool Final);
bool Cycle();
void Bump();
bool Pipeline;
bool SendConfig;
bool LocalOnly;
-
+ bool NeedsCleanup;
+ bool Removable;
+
MethodConfig();
};
virtual bool MediaChange(string Media,string Drive) = 0;
// Each of these is called by the workers when an event occures
- virtual void IMSHit(pkgAcquire::ItemDesc &Itm) {};
- virtual void Fetch(pkgAcquire::ItemDesc &Itm) {};
- virtual void Done(pkgAcquire::ItemDesc &Itm) {};
- virtual void Fail(pkgAcquire::ItemDesc &Itm) {};
- virtual void Pulse(pkgAcquire *Owner);
+ virtual void IMSHit(pkgAcquire::ItemDesc &/*Itm*/) {};
+ virtual void Fetch(pkgAcquire::ItemDesc &/*Itm*/) {};
+ virtual void Done(pkgAcquire::ItemDesc &/*Itm*/) {};
+ virtual void Fail(pkgAcquire::ItemDesc &/*Itm*/) {};
+ virtual bool Pulse(pkgAcquire *Owner); // returns false on user cancel
virtual void Start();
virtual void Stop();