root / trunk / tbeta / Linux / libs / poco / include / Poco / Process_WIN32U.h @ 164
View | Annotate | Download (2.7 KB)
| 1 | 164 | ss | //
|
|---|---|---|---|
| 2 | 164 | ss | // Process_WIN32U.h
|
| 3 | 164 | ss | //
|
| 4 | 164 | ss | // $Id: //poco/1.3/Foundation/include/Poco/Process_WIN32U.h#3 $
|
| 5 | 164 | ss | //
|
| 6 | 164 | ss | // Library: Foundation
|
| 7 | 164 | ss | // Package: Processes
|
| 8 | 164 | ss | // Module: Process
|
| 9 | 164 | ss | //
|
| 10 | 164 | ss | // Definition of the ProcessImpl class for WIN32.
|
| 11 | 164 | ss | //
|
| 12 | 164 | ss | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
| 13 | 164 | ss | // and Contributors.
|
| 14 | 164 | ss | //
|
| 15 | 164 | ss | // Permission is hereby granted, free of charge, to any person or organization
|
| 16 | 164 | ss | // obtaining a copy of the software and accompanying documentation covered by
|
| 17 | 164 | ss | // this license (the "Software") to use, reproduce, display, distribute,
|
| 18 | 164 | ss | // execute, and transmit the Software, and to prepare derivative works of the
|
| 19 | 164 | ss | // Software, and to permit third-parties to whom the Software is furnished to
|
| 20 | 164 | ss | // do so, all subject to the following:
|
| 21 | 164 | ss | //
|
| 22 | 164 | ss | // The copyright notices in the Software and this entire statement, including
|
| 23 | 164 | ss | // the above license grant, this restriction and the following disclaimer,
|
| 24 | 164 | ss | // must be included in all copies of the Software, in whole or in part, and
|
| 25 | 164 | ss | // all derivative works of the Software, unless such copies or derivative
|
| 26 | 164 | ss | // works are solely in the form of machine-executable object code generated by
|
| 27 | 164 | ss | // a source language processor.
|
| 28 | 164 | ss | //
|
| 29 | 164 | ss | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 30 | 164 | ss | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 31 | 164 | ss | // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
| 32 | 164 | ss | // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
| 33 | 164 | ss | // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
| 34 | 164 | ss | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
| 35 | 164 | ss | // DEALINGS IN THE SOFTWARE.
|
| 36 | 164 | ss | //
|
| 37 | 164 | ss | |
| 38 | 164 | ss | |
| 39 | 164 | ss | #ifndef Foundation_Process_WIN32U_INCLUDED
|
| 40 | 164 | ss | #define Foundation_Process_WIN32U_INCLUDED
|
| 41 | 164 | ss | |
| 42 | 164 | ss | |
| 43 | 164 | ss | #include "Poco/Foundation.h" |
| 44 | 164 | ss | #include "Poco/RefCountedObject.h" |
| 45 | 164 | ss | #include <vector> |
| 46 | 164 | ss | #include "Poco/UnWindows.h" |
| 47 | 164 | ss | |
| 48 | 164 | ss | |
| 49 | 164 | ss | namespace Poco {
|
| 50 | 164 | ss | |
| 51 | 164 | ss | |
| 52 | 164 | ss | class Pipe; |
| 53 | 164 | ss | |
| 54 | 164 | ss | |
| 55 | 164 | ss | class Foundation_API ProcessHandleImpl: public RefCountedObject
|
| 56 | 164 | ss | {
|
| 57 | 164 | ss | public:
|
| 58 | 164 | ss | ProcessHandleImpl(HANDLE _hProcess, UInt32 pid); |
| 59 | 164 | ss | ~ProcessHandleImpl(); |
| 60 | 164 | ss | |
| 61 | 164 | ss | UInt32 id() const;
|
| 62 | 164 | ss | int wait() const; |
| 63 | 164 | ss | |
| 64 | 164 | ss | private:
|
| 65 | 164 | ss | HANDLE _hProcess; |
| 66 | 164 | ss | UInt32 _pid; |
| 67 | 164 | ss | |
| 68 | 164 | ss | ProcessHandleImpl(const ProcessHandleImpl&);
|
| 69 | 164 | ss | ProcessHandleImpl& operator = (const ProcessHandleImpl&);
|
| 70 | 164 | ss | }; |
| 71 | 164 | ss | |
| 72 | 164 | ss | |
| 73 | 164 | ss | class Foundation_API ProcessImpl |
| 74 | 164 | ss | {
|
| 75 | 164 | ss | public:
|
| 76 | 164 | ss | typedef UInt32 PIDImpl;
|
| 77 | 164 | ss | typedef std::vector<std::string> ArgsImpl;
|
| 78 | 164 | ss | |
| 79 | 164 | ss | static PIDImpl idImpl();
|
| 80 | 164 | ss | static void timesImpl(long& userTime, long& kernelTime); |
| 81 | 164 | ss | static ProcessHandleImpl* launchImpl(const std::string& command, const ArgsImpl& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe); |
| 82 | 164 | ss | static void killImpl(PIDImpl pid); |
| 83 | 164 | ss | static void requestTerminationImpl(PIDImpl pid); |
| 84 | 164 | ss | }; |
| 85 | 164 | ss | |
| 86 | 164 | ss | |
| 87 | 164 | ss | } // namespace Poco
|
| 88 | 164 | ss | |
| 89 | 164 | ss | |
| 90 | 164 | ss | #endif // Foundation_Process_WIN32U_INCLUDED |
