aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/process/pipe.h
blob: 2d100956fe2999e2c689d9ebfeb409e626fdbc54 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/vespalib/util/guard.h>

namespace vespalib {

/**
 * A thin wrapper around a pipe between two file-descriptors.
 **/
struct Pipe {
    FileDescriptor read_end;
    FileDescriptor write_end;
    bool valid() const { return (read_end.valid() && write_end.valid()); }
    static Pipe create();
    ~Pipe();
};

} // namespace vespalib