Bitcoin Core 29.99.0
P2P Digital Currency
Public Member Functions | Private Attributes | List of all members
BufferedWriter< S > Class Template Reference

Wrapper that buffers writes to an underlying stream. More...

#include <streams.h>

Public Member Functions

 BufferedWriter (S &stream LIFETIMEBOUND, size_t size=1<< 16)
 
 ~BufferedWriter ()
 
void flush ()
 
void write (std::span< const std::byte > src)
 
template<typename T >
BufferedWriteroperator<< (const T &obj)
 

Private Attributes

Sm_dst
 
DataBuffer m_buf
 
size_t m_buf_pos {0}
 

Detailed Description

template<typename S>
class BufferedWriter< S >

Wrapper that buffers writes to an underlying stream.

Requires underlying stream to support write_buffer() method for efficient buffer flushing and obfuscation.

Definition at line 670 of file streams.h.

Constructor & Destructor Documentation

◆ BufferedWriter()

template<typename S >
BufferedWriter< S >::BufferedWriter ( S &stream  LIFETIMEBOUND,
size_t  size = 1 << 16 
)
inlineexplicit

Definition at line 677 of file streams.h.

◆ ~BufferedWriter()

template<typename S >
BufferedWriter< S >::~BufferedWriter ( )
inline

Definition at line 679 of file streams.h.

Member Function Documentation

◆ flush()

template<typename S >
void BufferedWriter< S >::flush ( )
inline

Definition at line 681 of file streams.h.

◆ operator<<()

template<typename S >
template<typename T >
BufferedWriter & BufferedWriter< S >::operator<< ( const T obj)
inline

Definition at line 698 of file streams.h.

Here is the call graph for this function:

◆ write()

template<typename S >
void BufferedWriter< S >::write ( std::span< const std::byte >  src)
inline

Definition at line 687 of file streams.h.

Here is the caller graph for this function:

Member Data Documentation

◆ m_buf

template<typename S >
DataBuffer BufferedWriter< S >::m_buf
private

Definition at line 673 of file streams.h.

◆ m_buf_pos

template<typename S >
size_t BufferedWriter< S >::m_buf_pos {0}
private

Definition at line 674 of file streams.h.

◆ m_dst

template<typename S >
S& BufferedWriter< S >::m_dst
private

Definition at line 672 of file streams.h.


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