Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
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 671 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 678 of file streams.h.

Here is the caller graph for this function:

◆ ~BufferedWriter()

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

Definition at line 680 of file streams.h.

Here is the call graph for this function:

Member Function Documentation

◆ flush()

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

Definition at line 682 of file streams.h.

Here is the caller graph for this function:

◆ operator<<()

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

Definition at line 699 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 688 of file streams.h.

Here is the call graph for this function:
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 674 of file streams.h.

◆ m_buf_pos

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

Definition at line 675 of file streams.h.

◆ m_dst

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

Definition at line 673 of file streams.h.


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