Bitcoin Core 32.99.0
P2P Digital Currency
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Attributes | List of all members
subprocess::detail::Streams Class Reference

#include <subprocess.h>

Collaboration diagram for subprocess::detail::Streams:
[legend]

Public Member Functions

 Streams ()
 
 Streams (const Streams &)=delete
 
Streams & operator= (const Streams &)=delete
 
 Streams (Streams &&)=default
 
Streams & operator= (Streams &&)=default
 
void setup_comm_channels ()
 
void cleanup_fds ()
 
void close_parent_fds ()
 
void close_child_fds ()
 
FILE * input ()
 
FILE * output ()
 
FILE * error ()
 
void input (FILE *fp)
 
void output (FILE *fp)
 
void error (FILE *fp)
 
void set_out_buf_cap (size_t cap)
 
void set_err_buf_cap (size_t cap)
 
int send (const char *msg, size_t length)
 
int send (const std::vector< char > &msg)
 
std::pair< OutBuffer, ErrBuffer > communicate (const char *msg, size_t length)
 
std::pair< OutBuffer, ErrBuffer > communicate (const std::vector< char > &msg)
 

Public Attributes

std::shared_ptr< FILE > input_ = nullptr
 
std::shared_ptr< FILE > output_ = nullptr
 
std::shared_ptr< FILE > error_ = nullptr
 
int write_to_child_ = -1
 
int read_from_parent_ = -1
 
int write_to_parent_ = -1
 
int read_from_child_ = -1
 
int err_write_ = -1
 
int err_read_ = -1
 

Private Attributes

Communication comm_
 

Detailed Description

This is a helper class to Popen. It takes care of management of all the file descriptors and file pointers. It dispatches of the communication aspects to the Communication class. Read through the data members to understand about the various file descriptors used.

Definition at line 810 of file subprocess.h.

Constructor & Destructor Documentation

◆ Streams() [1/3]

subprocess::detail::Streams::Streams ( )
inline

Definition at line 813 of file subprocess.h.

◆ Streams() [2/3]

subprocess::detail::Streams::Streams ( const Streams &  )
delete

◆ Streams() [3/3]

subprocess::detail::Streams::Streams ( Streams &&  )
default

Member Function Documentation

◆ cleanup_fds()

void subprocess::detail::Streams::cleanup_fds ( )
inline

Definition at line 822 of file subprocess.h.

Here is the caller graph for this function:

◆ close_child_fds()

void subprocess::detail::Streams::close_child_fds ( )
inline

Definition at line 842 of file subprocess.h.

Here is the caller graph for this function:

◆ close_parent_fds()

void subprocess::detail::Streams::close_parent_fds ( )
inline

Definition at line 835 of file subprocess.h.

Here is the caller graph for this function:

◆ communicate() [1/2]

std::pair< OutBuffer, ErrBuffer > subprocess::detail::Streams::communicate ( const char *  msg,
size_t  length 
)
inline

Definition at line 867 of file subprocess.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ communicate() [2/2]

std::pair< OutBuffer, ErrBuffer > subprocess::detail::Streams::communicate ( const std::vector< char > &  msg)
inline

Definition at line 870 of file subprocess.h.

Here is the call graph for this function:

◆ error() [1/2]

FILE * subprocess::detail::Streams::error ( )
inline

Definition at line 851 of file subprocess.h.

Here is the caller graph for this function:

◆ error() [2/2]

void subprocess::detail::Streams::error ( FILE *  fp)
inline

Definition at line 855 of file subprocess.h.

Here is the call graph for this function:

◆ input() [1/2]

FILE * subprocess::detail::Streams::input ( )
inline

Definition at line 849 of file subprocess.h.

Here is the caller graph for this function:

◆ input() [2/2]

void subprocess::detail::Streams::input ( FILE *  fp)
inline

Definition at line 853 of file subprocess.h.

Here is the call graph for this function:

◆ operator=() [1/2]

Streams & subprocess::detail::Streams::operator= ( const Streams &  )
delete

◆ operator=() [2/2]

Streams & subprocess::detail::Streams::operator= ( Streams &&  )
default

◆ output() [1/2]

FILE * subprocess::detail::Streams::output ( )
inline

Definition at line 850 of file subprocess.h.

Here is the caller graph for this function:

◆ output() [2/2]

void subprocess::detail::Streams::output ( FILE *  fp)
inline

Definition at line 854 of file subprocess.h.

Here is the call graph for this function:

◆ send() [1/2]

int subprocess::detail::Streams::send ( const char *  msg,
size_t  length 
)
inline

Definition at line 861 of file subprocess.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send() [2/2]

int subprocess::detail::Streams::send ( const std::vector< char > &  msg)
inline

Definition at line 864 of file subprocess.h.

Here is the call graph for this function:

◆ set_err_buf_cap()

void subprocess::detail::Streams::set_err_buf_cap ( size_t  cap)
inline

Definition at line 858 of file subprocess.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_out_buf_cap()

void subprocess::detail::Streams::set_out_buf_cap ( size_t  cap)
inline

Definition at line 857 of file subprocess.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_comm_channels()

void subprocess::detail::Streams::setup_comm_channels ( )
inline

Definition at line 1321 of file subprocess.h.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ comm_

Communication subprocess::detail::Streams::comm_
private

Definition at line 904 of file subprocess.h.

◆ err_read_

int subprocess::detail::Streams::err_read_ = -1

Definition at line 901 of file subprocess.h.

◆ err_write_

int subprocess::detail::Streams::err_write_ = -1

Definition at line 900 of file subprocess.h.

◆ error_

std::shared_ptr<FILE> subprocess::detail::Streams::error_ = nullptr

Definition at line 878 of file subprocess.h.

◆ input_

std::shared_ptr<FILE> subprocess::detail::Streams::input_ = nullptr

Definition at line 876 of file subprocess.h.

◆ output_

std::shared_ptr<FILE> subprocess::detail::Streams::output_ = nullptr

Definition at line 877 of file subprocess.h.

◆ read_from_child_

int subprocess::detail::Streams::read_from_child_ = -1

Definition at line 897 of file subprocess.h.

◆ read_from_parent_

int subprocess::detail::Streams::read_from_parent_ = -1

Definition at line 893 of file subprocess.h.

◆ write_to_child_

int subprocess::detail::Streams::write_to_child_ = -1

Definition at line 892 of file subprocess.h.

◆ write_to_parent_

int subprocess::detail::Streams::write_to_parent_ = -1

Definition at line 896 of file subprocess.h.


The documentation for this class was generated from the following file: