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

Minimal stream for reading from an existing byte array by Span. More...

#include <streams.h>

Collaboration diagram for SpanReader:
[legend]

Public Member Functions

 SpanReader (int type, int version, Span< const unsigned char > data)
 
template<typename T >
SpanReaderoperator>> (T &&obj)
 
int GetVersion () const
 
int GetType () const
 
size_t size () const
 
bool empty () const
 
void read (Span< std::byte > dst)
 

Private Attributes

const int m_type
 
const int m_version
 
Span< const unsigned char > m_data
 

Detailed Description

Minimal stream for reading from an existing byte array by Span.

Definition at line 133 of file streams.h.

Constructor & Destructor Documentation

◆ SpanReader()

SpanReader::SpanReader ( int  type,
int  version,
Span< const unsigned char >  data 
)
inline
Parameters
[in]typeSerialization Type
[in]versionSerialization Version (including any flags)
[in]dataReferenced byte vector to overwrite/append

Definition at line 147 of file streams.h.

Member Function Documentation

◆ empty()

bool SpanReader::empty ( ) const
inline

Definition at line 162 of file streams.h.

Here is the call graph for this function:

◆ GetType()

int SpanReader::GetType ( ) const
inline

Definition at line 159 of file streams.h.

◆ GetVersion()

int SpanReader::GetVersion ( ) const
inline

Definition at line 158 of file streams.h.

◆ operator>>()

template<typename T >
SpanReader& SpanReader::operator>> ( T &&  obj)
inline

Definition at line 151 of file streams.h.

Here is the call graph for this function:

◆ read()

void SpanReader::read ( Span< std::byte >  dst)
inline

Definition at line 164 of file streams.h.

Here is the call graph for this function:

◆ size()

size_t SpanReader::size ( ) const
inline

Definition at line 161 of file streams.h.

Here is the call graph for this function:

Member Data Documentation

◆ m_data

Span<const unsigned char> SpanReader::m_data
private

Definition at line 138 of file streams.h.

◆ m_type

const int SpanReader::m_type
private

Definition at line 136 of file streams.h.

◆ m_version

const int SpanReader::m_version
private

Definition at line 137 of file streams.h.


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