Crashpad
 
Loading...
Searching...
No Matches
crashpad::LengthDelimitedRingBufferReader< RingBufferDataType > Class Template Referencefinal

Reads variable-length data buffers from a RingBufferData, delimited by Base128 varint-encoded length delimiters. More...

#include "client/length_delimited_ring_buffer.h"

Public Member Functions

constexpr LengthDelimitedRingBufferReader (RingBufferDataType &ring_buffer)
 Constructs a reader which holds a reference to ring_buffer.
 
 LengthDelimitedRingBufferReader (const LengthDelimitedRingBufferReader &)=delete
 
LengthDelimitedRingBufferReaderoperator= (const LengthDelimitedRingBufferReader &)=delete
 
bool Pop (std::vector< uint8_t > &target_buffer)
 Pops off the next buffer from the front of the ring buffer.
 
void ResetForTesting ()
 Resets the state of the reader (e.g., for testing).
 

Detailed Description

template<typename RingBufferDataType>
class crashpad::LengthDelimitedRingBufferReader< RingBufferDataType >

Reads variable-length data buffers from a RingBufferData, delimited by Base128 varint-encoded length delimiters.

Holds a reference to a RingBufferData with the capacity to hold RingBufferDataType::size() bytes of variable-length buffers each preceded by its length (encoded as a Base128 length varint).

Provides reading capabilities via Pop().

Constructor & Destructor Documentation

◆ LengthDelimitedRingBufferReader()

template<typename RingBufferDataType>
crashpad::LengthDelimitedRingBufferReader< RingBufferDataType >::LengthDelimitedRingBufferReader ( RingBufferDataType & ring_buffer)
inlineexplicitconstexpr

Constructs a reader which holds a reference to ring_buffer.

Parameters
[in]ring_bufferThe ring buffer from which data will be read. This object must outlive the lifetime of ring_buffer.

Member Function Documentation

◆ Pop()

template<typename RingBufferDataType>
bool crashpad::LengthDelimitedRingBufferReader< RingBufferDataType >::Pop ( std::vector< uint8_t > & target_buffer)
inline

Pops off the next buffer from the front of the ring buffer.

Parameters
[in]target_bufferOn success, the buffer into which data will be read.
Returns
On success, returns true and advances ring_buffer.data_range past the end of the buffer read. Otherwise, returns false.

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