// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: acquire.h,v 1.1 1998/10/15 06:59:59 jgg Exp $
+// $Id: acquire.h,v 1.3 1998/10/22 04:56:44 jgg Exp $
/* ######################################################################
Acquire - File Acquiration
#pragma interface "apt-pkg/acquire.h"
#endif
+#include <unistd.h>
+
class pkgAcquire
{
public:
class Worker;
struct MethodConfig;
friend Item;
+ friend Queue;
protected:
+ // List of items to fetch
vector<Item *> Items;
+
+ // List of active queues and fetched method configuration parameters
Queue *Queues;
+ Worker *Workers;
MethodConfig *Configs;
+ unsigned long ToFetch;
+
+ // Configurable parameters for the schedular
+ enum {QueueHost,QueueAccess} QueueMode;
+ bool Debug;
void Add(Item *Item);
void Remove(Item *Item);
- void Enqueue(Item *Item,string URI);
+ void Add(Worker *Work);
+ void Remove(Worker *Work);
+
+ void Enqueue(Item *Item,string URI,string Description);
+ void Dequeue(Item *Item);
+ string QueueName(string URI);
+
+ // FDSET managers for derived classes
+ void SetFds(int &Fd,fd_set *RSet,fd_set *WSet);
+ void RunFds(fd_set *RSet,fd_set *WSet);
public:
+
+ MethodConfig *GetConfig(string Access);
+ bool Run();
pkgAcquire();
~pkgAcquire();
Queue *Next;
protected:
+
+ // Queued item
+ struct QItem
+ {
+ QItem *Next;
+
+ string URI;
+ string Description;
+ Item *Owner;
+ };
+
+ // Name of the queue
+ string Name;
+
+ // Items queued into this queue
+ QItem *Items;
+ pkgAcquire::Worker *Workers;
+ pkgAcquire *Owner;
- string Access;
- string URIMatch;
+ public:
- vector<Item *> Items;
+ // Put an item into this queue
+ void Enqueue(Item *Owner,string URI,string Description);
+ void Dequeue(Item *Owner);
+
+ bool Startup();
+ bool Shutdown();
- public:
+ Queue(string Name,pkgAcquire *Owner);
+ ~Queue();
};
// Configuration information from each method
struct pkgAcquire::MethodConfig
{
+ MethodConfig *Next;
+
string Access;
string Version;
bool SingleInstance;
bool PreScan;
+ bool Pipeline;
+ bool SendConfig;
MethodConfig();
- ~MethodConfig();
};
#endif