-
Notifications
You must be signed in to change notification settings - Fork 0
/
Pipe.hpp
36 lines (29 loc) · 889 Bytes
/
Pipe.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*******************************************************************************
* libunix++: C++ wrapper for Linux system calls
* Pipe operations
*
* © 2019—2021, Sauron <[email protected]>
******************************************************************************/
#ifndef __UNIXPP_PIPE_HPP
#define __UNIXPP_PIPE_HPP
#include <utility>
#include "Stream.hpp"
namespace upp {
/**/
class Pipe : public Stream {
public:
/** Create a pair of pipes **/
static std::pair<Pipe, Pipe> create();
/** Create a pair of pipes **/
static std::pair<Pipe, Pipe> create(int flags);
/** Duplicate pipe content **/
size_t tee(Pipe &out, size_t length, unsigned int flags=0);
/** Returns pipe capacity **/
unsigned getCapacity();
/** Set pipe capacity **/
void setCapacity(unsigned capacity);
private:
Pipe(int fd);
};
}
#endif