apt  0.9.7.7ubuntu3
acquire-worker.h
Go to the documentation of this file.
1 // -*- mode: cpp; mode: fold -*-
2 // Description /*{{{*/
3 // $Id: acquire-worker.h,v 1.12 2001/02/20 07:03:17 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 
19 #ifndef PKGLIB_ACQUIRE_WORKER_H
20 #define PKGLIB_ACQUIRE_WORKER_H
21 
22 #include <apt-pkg/acquire.h>
23 #include <apt-pkg/weakptr.h>
24 
25 
46 {
48  void *d;
49 
50  friend class pkgAcquire;
51 
52  protected:
53  friend class Queue;
54 
60 
63 
66 
71 
77 
82  std::string Access;
83 
85  pid_t Process;
86 
92  int InFd;
93 
99  int OutFd;
100 
106  bool InReady;
107 
113  bool OutReady;
114 
116  bool Debug;
117 
121  std::vector<std::string> MessageQueue;
122 
127  std::string OutQueue;
128 
135  void Construct();
136 
147  bool ReadMessages();
148 
158  bool RunMessages();
159 
166  bool InFdReady();
167 
175  bool OutFdReady();
176 
186  bool Capabilities(std::string Message);
187 
204  bool SendConfiguration();
205 
217  bool MediaChange(std::string Message);
218 
228  bool MethodFailure();
229 
235  void ItemDone();
236 
237  public:
238 
241 
245  std::string Status;
246 
250  unsigned long long CurrentSize;
251 
255  unsigned long long TotalSize;
256 
260  unsigned long long ResumePoint;
261 
272 
280  bool Start();
281 
285  void Pulse();
286 
288  inline const MethodConfig *GetConf() const {return Config;};
289 
302 
314 
320  virtual ~Worker();
321 };
322 
325 #endif