Commit | Line | Data |
---|---|---|
0118833a AL |
1 | // -*- mode: cpp; mode: fold -*- |
2 | // Description /*{{{*/ | |
3b5421b4 | 3 | // $Id: acquire-worker.h,v 1.2 1998/10/20 02:39:14 jgg Exp $ |
0118833a AL |
4 | /* ###################################################################### |
5 | ||
6 | Acquire Worker - Worker process manager | |
7 | ||
3b5421b4 AL |
8 | Each worker class is associated with exaclty one subprocess. |
9 | ||
0118833a AL |
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: | |
3b5421b4 AL |
25 | friend Queue; |
26 | ||
27 | Worker *Next; | |
0118833a | 28 | |
3b5421b4 | 29 | // The access association |
0118833a | 30 | Queue *OwnerQ; |
3b5421b4 AL |
31 | MethodConfig *Config; |
32 | string Access; | |
33 | ||
34 | // This is the subprocess IPC setup | |
35 | pid_t Process; | |
36 | int InFd; | |
37 | int OutFd; | |
0118833a | 38 | |
3b5421b4 AL |
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); | |
0118833a AL |
52 | |
53 | public: | |
54 | ||
3b5421b4 AL |
55 | // Load the method and do the startup |
56 | bool Start(); | |
0118833a | 57 | |
3b5421b4 | 58 | Worker(Queue *OwnerQ,string Access); |
0118833a AL |
59 | Worker(MethodConfig *Config); |
60 | ~Worker(); | |
61 | }; | |
62 | ||
63 | #endif |