Bitcoin Core  22.99.0
P2P Digital Currency
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
TokenPipe Class Reference

An interprocess or interthread pipe for sending tokens (one-byte values) over. More...

#include <tokenpipe.h>

Public Member Functions

 ~TokenPipe ()
 
TokenPipeEnd TakeReadEnd ()
 Take the read end of this pipe. More...
 
TokenPipeEnd TakeWriteEnd ()
 Take the write end of this pipe. More...
 
void Close ()
 Close and end of the pipe that hasn't been moved out. More...
 
 TokenPipe (TokenPipe &&other)
 
TokenPipeoperator= (TokenPipe &&other)
 
 TokenPipe (const TokenPipe &)=delete
 
TokenPipeoperator= (const TokenPipe &)=delete
 

Static Public Member Functions

static std::optional< TokenPipeMake ()
 Create a new pipe. More...
 

Private Member Functions

 TokenPipe (int fds[2])
 

Private Attributes

int m_fds [2] = {-1, -1}
 

Detailed Description

An interprocess or interthread pipe for sending tokens (one-byte values) over.

Definition at line 75 of file tokenpipe.h.

Constructor & Destructor Documentation

◆ TokenPipe() [1/3]

TokenPipe::TokenPipe ( int  fds[2])
inlineprivate

Definition at line 80 of file tokenpipe.h.

Here is the caller graph for this function:

◆ ~TokenPipe()

TokenPipe::~TokenPipe ( )

Definition at line 97 of file tokenpipe.cpp.

Here is the call graph for this function:

◆ TokenPipe() [2/3]

TokenPipe::TokenPipe ( TokenPipe &&  other)
inline

Definition at line 105 of file tokenpipe.h.

◆ TokenPipe() [3/3]

TokenPipe::TokenPipe ( const TokenPipe )
delete

Member Function Documentation

◆ Close()

void TokenPipe::Close ( )

Close and end of the pipe that hasn't been moved out.

Definition at line 102 of file tokenpipe.cpp.

Here is the caller graph for this function:

◆ Make()

std::optional< TokenPipe > TokenPipe::Make ( )
static

Create a new pipe.

Returns
The created TokenPipe, or an empty std::nullopt in case of error.

Definition at line 82 of file tokenpipe.cpp.

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

◆ operator=() [1/2]

TokenPipe& TokenPipe::operator= ( const TokenPipe )
delete

◆ operator=() [2/2]

TokenPipe& TokenPipe::operator= ( TokenPipe &&  other)
inline

Definition at line 112 of file tokenpipe.h.

Here is the call graph for this function:

◆ TakeReadEnd()

TokenPipeEnd TokenPipe::TakeReadEnd ( )

Take the read end of this pipe.

This can only be called once, as the object will be moved out.

Definition at line 15 of file tokenpipe.cpp.

◆ TakeWriteEnd()

TokenPipeEnd TokenPipe::TakeWriteEnd ( )

Take the write end of this pipe.

This should only be called once, as the object will be moved out.

Definition at line 22 of file tokenpipe.cpp.

Member Data Documentation

◆ m_fds

int TokenPipe::m_fds[2] = {-1, -1}
private

Definition at line 78 of file tokenpipe.h.


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