Bitcoin ABC 0.30.5
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 uint8_t > 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 uint8_t > m_data
 

Detailed Description

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

Definition at line 129 of file streams.h.

Constructor & Destructor Documentation

◆ SpanReader()

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

Definition at line 141 of file streams.h.

Member Function Documentation

◆ empty()

bool SpanReader::empty ( ) const
inline

Definition at line 154 of file streams.h.

Here is the call graph for this function:

◆ GetType()

int SpanReader::GetType ( ) const
inline

Definition at line 151 of file streams.h.

◆ GetVersion()

int SpanReader::GetVersion ( ) const
inline

Definition at line 150 of file streams.h.

◆ operator>>()

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

Definition at line 144 of file streams.h.

Here is the call graph for this function:

◆ read()

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

Definition at line 156 of file streams.h.

Here is the call graph for this function:

◆ size()

size_t SpanReader::size ( ) const
inline

Definition at line 153 of file streams.h.

Here is the call graph for this function:

Member Data Documentation

◆ m_data

Span<const uint8_t> SpanReader::m_data
private

Definition at line 133 of file streams.h.

◆ m_type

const int SpanReader::m_type
private

Definition at line 131 of file streams.h.

◆ m_version

const int SpanReader::m_version
private

Definition at line 132 of file streams.h.


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