2023-02-08 11:04:11 +00:00
|
|
|
//
|
|
|
|
// PipeImpl_POSIX.h
|
|
|
|
//
|
|
|
|
// Library: Foundation
|
|
|
|
// Package: Processes
|
|
|
|
// Module: PipeImpl
|
|
|
|
//
|
|
|
|
// Definition of the PipeImpl class for POSIX.
|
|
|
|
//
|
|
|
|
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
|
|
|
// and Contributors.
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef Foundation_PipeImpl_POSIX_INCLUDED
|
|
|
|
#define Foundation_PipeImpl_POSIX_INCLUDED
|
|
|
|
|
|
|
|
|
|
|
|
#include "Poco/Foundation.h"
|
|
|
|
#include "Poco/RefCountedObject.h"
|
|
|
|
|
|
|
|
|
2023-02-13 09:22:33 +00:00
|
|
|
namespace Poco
|
|
|
|
{
|
2023-02-08 11:04:11 +00:00
|
|
|
|
|
|
|
|
2023-02-13 09:22:33 +00:00
|
|
|
class Foundation_API PipeImpl : public RefCountedObject
|
|
|
|
/// A dummy implementation of PipeImpl for platforms
|
|
|
|
/// that do not support pipes.
|
2023-02-08 11:04:11 +00:00
|
|
|
{
|
|
|
|
public:
|
2023-02-13 09:22:33 +00:00
|
|
|
typedef int Handle;
|
|
|
|
|
|
|
|
PipeImpl();
|
|
|
|
~PipeImpl();
|
|
|
|
int writeBytes(const void * buffer, int length);
|
|
|
|
int readBytes(void * buffer, int length);
|
|
|
|
Handle readHandle() const;
|
|
|
|
Handle writeHandle() const;
|
|
|
|
void closeRead();
|
|
|
|
void closeWrite();
|
|
|
|
|
2023-02-08 11:04:11 +00:00
|
|
|
private:
|
2023-02-13 09:22:33 +00:00
|
|
|
int _readfd;
|
|
|
|
int _writefd;
|
2023-02-08 11:04:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace Poco
|
|
|
|
|
|
|
|
|
|
|
|
#endif // Foundation_PipeImpl_POSIX_INCLUDED
|