]> git.saurik.com Git - apt.git/blob - apt-pkg/acquire-worker.h
Start on acquire stuff
[apt.git] / apt-pkg / acquire-worker.h
1 // -*- mode: cpp; mode: fold -*-
2 // Description /*{{{*/
3 // $Id: acquire-worker.h,v 1.2 1998/10/20 02:39:14 jgg Exp $
4 /* ######################################################################
5
6 Acquire Worker - Worker process manager
7
8 Each worker class is associated with exaclty one subprocess.
9
10 ##################################################################### */
11 /*}}}*/
12 #ifndef PKGLIB_ACQUIRE_WORKER_H
13 #define PKGLIB_ACQUIRE_WORKER_H
14
15 #include <apt-pkg/acquire.h>
16
17 #ifdef __GNUG__
18 #pragma interface "apt-pkg/acquire-worker.h"
19 #endif
20
21 // Interfacing to the method process
22 class pkgAcquire::Worker
23 {
24 protected:
25 friend Queue;
26
27 Worker *Next;
28
29 // The access association
30 Queue *OwnerQ;
31 MethodConfig *Config;
32 string Access;
33
34 // This is the subprocess IPC setup
35 pid_t Process;
36 int InFd;
37 int OutFd;
38
39 // Various internal things
40 bool Debug;
41 vector<string> MessageQueue;
42
43 // Private constructor helper
44 void Construct();
45
46 // Message handling things
47 bool ReadMessages();
48 bool RunMessages();
49
50 // The message handlers
51 bool Capabilities(string Message);
52
53 public:
54
55 // Load the method and do the startup
56 bool Start();
57
58 Worker(Queue *OwnerQ,string Access);
59 Worker(MethodConfig *Config);
60 ~Worker();
61 };
62
63 #endif