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

Minimal stream for reading from an existing vector by reference. More...

#include <streams.h>

Public Member Functions

 VectorReader (int type, int version, const std::vector< unsigned char > &data, size_t pos)
 
template<typename... Args>
 VectorReader (int type, int version, const std::vector< unsigned char > &data, size_t pos, Args &&... args)
 (other params same as above) More...
 
template<typename T >
VectorReaderoperator>> (T &&obj)
 
int GetVersion () const
 
int GetType () const
 
size_t size () const
 
bool empty () const
 
void read (char *dst, size_t n)
 

Private Attributes

const int m_type
 
const int m_version
 
const std::vector< unsigned char > & m_data
 
size_t m_pos = 0
 

Detailed Description

Minimal stream for reading from an existing vector by reference.

Definition at line 133 of file streams.h.

Constructor & Destructor Documentation

◆ VectorReader() [1/2]

VectorReader::VectorReader ( int  type,
int  version,
const std::vector< unsigned char > &  data,
size_t  pos 
)
inline
Parameters
[in]typeSerialization Type
[in]versionSerialization Version (including any flags)
[in]dataReferenced byte vector to overwrite/append
[in]posStarting position. Vector index where reads should start.

Definition at line 149 of file streams.h.

◆ VectorReader() [2/2]

template<typename... Args>
VectorReader::VectorReader ( int  type,
int  version,
const std::vector< unsigned char > &  data,
size_t  pos,
Args &&...  args 
)
inline

(other params same as above)

Parameters
[in]argsA list of items to deserialize starting at pos.

Definition at line 162 of file streams.h.

Here is the call graph for this function:

Member Function Documentation

◆ empty()

bool VectorReader::empty ( ) const
inline

Definition at line 181 of file streams.h.

Here is the caller graph for this function:

◆ GetType()

int VectorReader::GetType ( ) const
inline

Definition at line 178 of file streams.h.

◆ GetVersion()

int VectorReader::GetVersion ( ) const
inline

Definition at line 177 of file streams.h.

◆ operator>>()

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

Definition at line 170 of file streams.h.

Here is the call graph for this function:

◆ read()

void VectorReader::read ( char *  dst,
size_t  n 
)
inline

Definition at line 183 of file streams.h.

◆ size()

size_t VectorReader::size ( ) const
inline

Definition at line 180 of file streams.h.

Here is the caller graph for this function:

Member Data Documentation

◆ m_data

const std::vector<unsigned char>& VectorReader::m_data
private

Definition at line 138 of file streams.h.

◆ m_pos

size_t VectorReader::m_pos = 0
private

Definition at line 139 of file streams.h.

◆ m_type

const int VectorReader::m_type
private

Definition at line 136 of file streams.h.

◆ m_version

const int VectorReader::m_version
private

Definition at line 137 of file streams.h.


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