acquire-worker.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. Acquire Worker - Worker process manager
  6. Each worker class is associated with exaclty one subprocess.
  7. ##################################################################### */
  8. /*}}}*/
  9. #ifndef PKGLIB_ACQUIRE_WORKER_H
  10. #define PKGLIB_ACQUIRE_WORKER_H
  11. #include <apt-pkg/acquire.h>
  12. #ifdef __GNUG__
  13. #pragma interface "apt-pkg/acquire-worker.h"
  14. #endif
  15. // Interfacing to the method process
  16. class pkgAcquire::Worker
  17. {
  18. protected:
  19. friend Queue;
  20. Worker *Next;
  21. // The access association
  22. Queue *OwnerQ;
  23. MethodConfig *Config;
  24. string Access;
  25. // This is the subprocess IPC setup
  26. pid_t Process;
  27. int InFd;
  28. int OutFd;
  29. // Various internal things
  30. bool Debug;
  31. vector<string> MessageQueue;
  32. // Private constructor helper
  33. void Construct();
  34. // Message handling things
  35. bool ReadMessages();
  36. bool RunMessages();
  37. // The message handlers
  38. bool Capabilities(string Message);
  39. public:
  40. // Load the method and do the startup
  41. bool Start();
  42. Worker(Queue *OwnerQ,string Access);
  43. Worker(MethodConfig *Config);
  44. ~Worker();
  45. };
  46. #endif