e57::BitpackDecoder Class Referenceabstract

#include <Decoder.h>

Public Member Functions

void destBufferSetNew (std::vector< SourceDestBuffer > &dbufs) override
 
size_t inputProcess (const char *source, const size_t availableByteCount) override
 
virtual size_t inputProcessAligned (const char *inbuf, const size_t firstBit, const size_t endBit)=0
 
void stateReset () override
 
uint64_t totalRecordsCompleted () override
 
- Public Member Functions inherited from e57::Decoder
unsigned bytestreamNumber () const
 
 Decoder ()=delete
 
virtual void destBufferSetNew (std::vector< SourceDestBuffer > &dbufs)=0
 
virtual size_t inputProcess (const char *source, const size_t count)=0
 
virtual void stateReset ()=0
 
virtual uint64_t totalRecordsCompleted ()=0
 
virtual ~Decoder ()=default
 

Protected Member Functions

 BitpackDecoder (unsigned bytestreamNumber, SourceDestBuffer &dbuf, unsigned alignmentSize, uint64_t maxRecordCount)
 
void inBufferShiftDown ()
 
- Protected Member Functions inherited from e57::Decoder
 Decoder (unsigned bytestreamNumber)
 

Protected Attributes

unsigned int bitsPerWord_
 
unsigned int bytesPerWord_
 
uint64_t currentRecordIndex_ = 0
 
std::shared_ptr< SourceDestBufferImpldestBuffer_
 
std::vector< char > inBuffer_
 
unsigned int inBufferAlignmentSize_
 
size_t inBufferEndByte_ = 0
 
size_t inBufferFirstBit_ = 0
 
uint64_t maxRecordCount_ = 0
 
- Protected Attributes inherited from e57::Decoder
unsigned int bytestreamNumber_
 

Additional Inherited Members

- Static Public Member Functions inherited from e57::Decoder
static std::shared_ptr< DecoderDecoderFactory (unsigned bytestreamNumber, const CompressedVectorNodeImpl *cVector, std::vector< SourceDestBuffer > &dbufs, const ustring &codecPath)
 

Constructor & Destructor Documentation

◆ BitpackDecoder()

BitpackDecoder::BitpackDecoder ( unsigned  bytestreamNumber,
SourceDestBuffer dbuf,
unsigned  alignmentSize,
uint64_t  maxRecordCount 
)
protected

Member Function Documentation

◆ destBufferSetNew()

void BitpackDecoder::destBufferSetNew ( std::vector< SourceDestBuffer > &  dbufs)
overridevirtual

◆ inBufferShiftDown()

void BitpackDecoder::inBufferShiftDown ( )
protected

Move uneaten data down to beginning of inBuffer_. Keep on natural boundaries. Moves all of word that contains inBufferFirstBit.

Overlapping regions ok with memmove().

Update indexes

References bitsPerWord_, bytesPerWord_, e57::E57_ERROR_INTERNAL, inBuffer_, inBufferEndByte_, inBufferFirstBit_, and e57::toString().

Referenced by inputProcess().

◆ inputProcess()

size_t BitpackDecoder::inputProcess ( const char *  source,
const size_t  availableByteCount 
)
overridevirtual

Copy input bytes from caller, if any

Advance tail pointer.

Update amount available from caller

??? fix doc for new bit interface Now that we have input stored in an aligned buffer, call derived class to try to eat some Note that end of filled buffer may not be at a natural boundary. The subclass may transfer this partial word in a full word transfer, but it must be done carefully to only use the defined bits. inBuffer_ is a multiple of largest word size, so this full word transfer off the end will always be in defined memory.

Shift uneaten data to beginning of inBuffer_, keep on natural word boundaries.

If the lower level processing didn't eat anything on this iteration, stop looping and tell caller how much we ate or stored.

Return the number of bytes we ate/saved.

Implements e57::Decoder.

References bitsPerWord_, bytesPerWord_, e57::E57_ERROR_INTERNAL, inBuffer_, inBufferEndByte_, inBufferFirstBit_, inBufferShiftDown(), inputProcessAligned(), and e57::toString().

◆ inputProcessAligned()

virtual size_t e57::BitpackDecoder::inputProcessAligned ( const char *  inbuf,
const size_t  firstBit,
const size_t  endBit 
)
pure virtual

◆ stateReset()

void BitpackDecoder::stateReset ( )
overridevirtual

Implements e57::Decoder.

References inBufferEndByte_, and inBufferFirstBit_.

◆ totalRecordsCompleted()

uint64_t e57::BitpackDecoder::totalRecordsCompleted ( )
overridevirtual

Implements e57::Decoder.

References currentRecordIndex_.

Member Data Documentation

◆ bitsPerWord_

unsigned int e57::BitpackDecoder::bitsPerWord_
protected

Referenced by inBufferShiftDown(), and inputProcess().

◆ bytesPerWord_

unsigned int e57::BitpackDecoder::bytesPerWord_
protected

Referenced by inBufferShiftDown(), and inputProcess().

◆ currentRecordIndex_

uint64_t e57::BitpackDecoder::currentRecordIndex_ = 0
protected

◆ destBuffer_

◆ inBuffer_

std::vector<char> e57::BitpackDecoder::inBuffer_
protected

Referenced by inBufferShiftDown(), and inputProcess().

◆ inBufferAlignmentSize_

unsigned int e57::BitpackDecoder::inBufferAlignmentSize_
protected

◆ inBufferEndByte_

size_t e57::BitpackDecoder::inBufferEndByte_ = 0
protected

◆ inBufferFirstBit_

size_t e57::BitpackDecoder::inBufferFirstBit_ = 0
protected

◆ maxRecordCount_

uint64_t e57::BitpackDecoder::maxRecordCount_ = 0
protected

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