Process_VX.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. //
  2. // Process_VX.h
  3. //
  4. // $Id: //poco/1.4/Foundation/include/Poco/Process_VX.h#3 $
  5. //
  6. // Library: Foundation
  7. // Package: Processes
  8. // Module: Process
  9. //
  10. // Definition of the ProcessImpl class for VxWorks.
  11. //
  12. // Copyright (c) 2004-20011, Applied Informatics Software Engineering GmbH.
  13. // and Contributors.
  14. //
  15. // SPDX-License-Identifier: BSL-1.0
  16. //
  17. #ifndef Foundation_Process_VX_INCLUDED
  18. #define Foundation_Process_VX_INCLUDED
  19. #include "Poco/Foundation.h"
  20. #include "Poco/RefCountedObject.h"
  21. #include <vector>
  22. #include <map>
  23. #undef PID
  24. namespace Poco {
  25. class Pipe;
  26. class Foundation_API ProcessHandleImpl: public RefCountedObject
  27. {
  28. public:
  29. ProcessHandleImpl(int pid);
  30. ~ProcessHandleImpl();
  31. int id() const;
  32. int wait() const;
  33. private:
  34. int _pid;
  35. };
  36. class Foundation_API ProcessImpl
  37. {
  38. public:
  39. typedef int PIDImpl;
  40. typedef std::vector<std::string> ArgsImpl;
  41. typedef std::map<std::string, std::string> EnvImpl;
  42. static PIDImpl idImpl();
  43. static void timesImpl(long& userTime, long& kernelTime);
  44. static ProcessHandleImpl* launchImpl(
  45. const std::string& command,
  46. const ArgsImpl& args,
  47. const std::string& initialDirectory,
  48. Pipe* inPipe,
  49. Pipe* outPipe,
  50. Pipe* errPipe,
  51. const EnvImpl& env);
  52. static void killImpl(ProcessHandleImpl& handle);
  53. static void killImpl(PIDImpl pid);
  54. static bool isRunningImpl(const ProcessHandleImpl& handle);
  55. static bool isRunningImpl(PIDImpl pid);
  56. static void requestTerminationImpl(PIDImpl pid);
  57. };
  58. } // namespace Poco
  59. #endif // Foundation_Process_UNIX_INCLUDED