subprocess::opipe_descriptor class

A descriptor wrapping the output end of a posix OS pipe.

This class, when paired with ipipe_descriptor, consists of an OS pipe. A pipe is constructed whenever open is called an object of this type or its linked ipipe_descriptor. These should always be constructed in pair with the subprocess::create_pipe method.

Base classes

class odescriptor
Adds write ability to descriptor.

Derived classes

class ovariable_descriptor

Constructors, destructors, conversion operators

opipe_descriptor() defaulted

Public functions

void open() override
Initialize call before the process runs.

Protected variables

ipipe_descriptor* linked_fd_

Friends

void link(ipipe_descriptor& fd1, opipe_descriptor& fd2)
Links two file descriptors.

Function documentation

void subprocess::opipe_descriptor::open() override

Initialize call before the process runs.

open() is called by subprocess::execute() right before spawning the child process. This is the function to write for the set up of your I/O from the process.

void link(ipipe_descriptor& fd1, opipe_descriptor& fd2)

Links two file descriptors.

Parameters
fd1
fd2

This function is used to link a read and write file descriptor