Bitcoin ABC 0.30.7
P2P Digital Currency
Public Types | Public Member Functions | Private Attributes | List of all members
TokenPipeEnd Class Reference

One end of a token pipe. More...

#include <tokenpipe.h>

Public Types

enum  Status { TS_ERR = -1 , TS_EOS = -2 }
 Return value constants for TokenWrite and TokenRead. More...
 

Public Member Functions

 TokenPipeEnd (int fd=-1)
 
 ~TokenPipeEnd ()
 
int TokenWrite (uint8_t token)
 Write token to endpoint. More...
 
int TokenRead ()
 Read token from endpoint. More...
 
void Close ()
 Explicit close function. More...
 
bool IsOpen ()
 Return whether endpoint is open. More...
 
 TokenPipeEnd (TokenPipeEnd &&other)
 
TokenPipeEndoperator= (TokenPipeEnd &&other)
 
 TokenPipeEnd (const TokenPipeEnd &)=delete
 
TokenPipeEndoperator= (const TokenPipeEnd &)=delete
 

Private Attributes

int m_fd = -1
 

Detailed Description

One end of a token pipe.

Definition at line 14 of file tokenpipe.h.

Member Enumeration Documentation

◆ Status

Return value constants for TokenWrite and TokenRead.

Enumerator
TS_ERR 

I/O error.

TS_EOS 

Unexpected end of stream.

Definition at line 23 of file tokenpipe.h.

Constructor & Destructor Documentation

◆ TokenPipeEnd() [1/3]

TokenPipeEnd::TokenPipeEnd ( int  fd = -1)

Definition at line 26 of file tokenpipe.cpp.

◆ ~TokenPipeEnd()

TokenPipeEnd::~TokenPipeEnd ( )

Definition at line 28 of file tokenpipe.cpp.

Here is the call graph for this function:

◆ TokenPipeEnd() [2/3]

TokenPipeEnd::TokenPipeEnd ( TokenPipeEnd &&  other)
inline

Definition at line 57 of file tokenpipe.h.

◆ TokenPipeEnd() [3/3]

TokenPipeEnd::TokenPipeEnd ( const TokenPipeEnd )
delete

Member Function Documentation

◆ Close()

void TokenPipeEnd::Close ( )

Explicit close function.

Definition at line 68 of file tokenpipe.cpp.

Here is the caller graph for this function:

◆ IsOpen()

bool TokenPipeEnd::IsOpen ( )
inline

Return whether endpoint is open.

Definition at line 54 of file tokenpipe.h.

Here is the caller graph for this function:

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

Definition at line 61 of file tokenpipe.h.

Here is the call graph for this function:

◆ TokenRead()

int TokenPipeEnd::TokenRead ( )

Read token from endpoint.

Returns
>=0 Token value, if successful. <0 if error: TS_ERR If an error happened. TS_EOS If end of stream happened.

Definition at line 49 of file tokenpipe.cpp.

Here is the caller graph for this function:

◆ TokenWrite()

int TokenPipeEnd::TokenWrite ( uint8_t  token)

Write token to endpoint.

Returns
0 If successful. <0 if error: TS_ERR If an error happened. TS_EOS If end of stream happened.

Definition at line 32 of file tokenpipe.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ m_fd

int TokenPipeEnd::m_fd = -1
private

Definition at line 16 of file tokenpipe.h.


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