| 1 | // |
| 2 | // PipeImpl_POSIX.h |
| 3 | // |
| 4 | // Library: Foundation |
| 5 | // Package: Processes |
| 6 | // Module: PipeImpl |
| 7 | // |
| 8 | // Definition of the PipeImpl class for POSIX. |
| 9 | // |
| 10 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. |
| 11 | // and Contributors. |
| 12 | // |
| 13 | // SPDX-License-Identifier: BSL-1.0 |
| 14 | // |
| 15 | |
| 16 | |
| 17 | #ifndef Foundation_PipeImpl_POSIX_INCLUDED |
| 18 | #define Foundation_PipeImpl_POSIX_INCLUDED |
| 19 | |
| 20 | |
| 21 | #include "Poco/Foundation.h" |
| 22 | #include "Poco/RefCountedObject.h" |
| 23 | |
| 24 | |
| 25 | namespace Poco { |
| 26 | |
| 27 | |
| 28 | class Foundation_API PipeImpl: public RefCountedObject |
| 29 | /// A dummy implementation of PipeImpl for platforms |
| 30 | /// that do not support pipes. |
| 31 | { |
| 32 | public: |
| 33 | typedef int Handle; |
| 34 | |
| 35 | PipeImpl(); |
| 36 | ~PipeImpl(); |
| 37 | int writeBytes(const void* buffer, int length); |
| 38 | int readBytes(void* buffer, int length); |
| 39 | Handle readHandle() const; |
| 40 | Handle writeHandle() const; |
| 41 | void closeRead(); |
| 42 | void closeWrite(); |
| 43 | |
| 44 | private: |
| 45 | int _readfd; |
| 46 | int _writefd; |
| 47 | }; |
| 48 | |
| 49 | |
| 50 | } // namespace Poco |
| 51 | |
| 52 | |
| 53 | #endif // Foundation_PipeImpl_POSIX_INCLUDED |
| 54 | |