MySQL 8.3.0
Source Code Documentation
Bit_reader Class Reference

Auxiliary class to read or write a stream of bits to a memory location. More...

#include <rpl_record.h>

Inheritance diagram for Bit_reader:
[legend]

Public Member Functions

 Bit_reader (const char *ptr=nullptr)
 
 Bit_reader (const uchar *ptr)
 
bool get ()
 Read the next bit and move the read position one bit forward. More...
 
- Public Member Functions inherited from Bit_stream_base< const char, const uchar >
 Bit_stream_base (const char *ptr)
 Construct a new Bit_stream (either reader or writer). More...
 
void set_ptr (const char *ptr)
 Set the buffer pointer. More...
 
void set_ptr (const uchar *ptr)
 Set the buffer pointer, using an unsigned datatype. More...
 
uint tell () const
 
void dbug_print (const char *str) const
 Print all the bits before the current position to the debug trace. More...
 

Additional Inherited Members

- Protected Attributes inherited from Bit_stream_base< const char, const uchar >
const char * m_ptr
 Pointer to beginning of buffer where bits are read or written. More...
 
uint m_current_bit
 Current position in buffer. More...
 

Detailed Description

Auxiliary class to read or write a stream of bits to a memory location.

Call get() to read a bit and move the position one bit forward.

Constructor & Destructor Documentation

◆ Bit_reader() [1/2]

Bit_reader::Bit_reader ( const char *  ptr = nullptr)
inline

◆ Bit_reader() [2/2]

Bit_reader::Bit_reader ( const uchar ptr)
inline

Member Function Documentation

◆ get()

bool Bit_reader::get ( )
inline

Read the next bit and move the read position one bit forward.

Returns
true if the bit was 1, false if the bit was 0.

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