ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
e57::BitpackDecoder Class Referenceabstract

#include <Decoder.h>

Inheritance diagram for e57::BitpackDecoder:
Collaboration diagram for e57::BitpackDecoder:

Public Member Functions

void destBufferSetNew (std::vector< SourceDestBuffer > &dbufs) override
 
uint64_t totalRecordsCompleted () 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
 
void dump (int indent=0, std::ostream &os=std::cout) override
 
- Public Member Functions inherited from e57::Decoder
 Decoder ()=delete
 
virtual ~Decoder ()=default
 
unsigned bytestreamNumber () const
 

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

uint64_t currentRecordIndex_ = 0
 
uint64_t maxRecordCount_ = 0
 
std::shared_ptr< SourceDestBufferImpldestBuffer_
 
std::vector< char > inBuffer_
 
size_t inBufferFirstBit_ = 0
 
size_t inBufferEndByte_ = 0
 
unsigned int inBufferAlignmentSize_
 
unsigned int bitsPerWord_
 
unsigned int bytesPerWord_
 
- 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)
 

Detailed Description

Definition at line 61 of file Decoder.h.

Constructor & Destructor Documentation

◆ BitpackDecoder()

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

Definition at line 191 of file Decoder.cpp.

Member Function Documentation

◆ destBufferSetNew()

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

Implements e57::Decoder.

Definition at line 199 of file Decoder.cpp.

References destBuffer_, e57::E57_ERROR_INTERNAL, E57_EXCEPTION2, and e57::toString().

◆ dump()

◆ 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

Definition at line 297 of file Decoder.cpp.

References bitsPerWord_, bytesPerWord_, e57::E57_ERROR_INTERNAL, E57_EXCEPTION2, 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 carefull 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.

Definition at line 209 of file Decoder.cpp.

References bitsPerWord_, bytesPerWord_, e57::E57_ERROR_INTERNAL, E57_EXCEPTION2, QtCompat::endl(), inBuffer_, inBufferEndByte_, inBufferFirstBit_, inBufferShiftDown(), inputProcessAligned(), min(), 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.

Definition at line 291 of file Decoder.cpp.

References inBufferEndByte_, and inBufferFirstBit_.

◆ totalRecordsCompleted()

uint64_t e57::BitpackDecoder::totalRecordsCompleted ( )
inlineoverridevirtual

Implements e57::Decoder.

Definition at line 66 of file Decoder.h.

References currentRecordIndex_.

Member Data Documentation

◆ bitsPerWord_

unsigned int e57::BitpackDecoder::bitsPerWord_
protected

Definition at line 94 of file Decoder.h.

Referenced by dump(), inBufferShiftDown(), and inputProcess().

◆ bytesPerWord_

unsigned int e57::BitpackDecoder::bytesPerWord_
protected

Definition at line 95 of file Decoder.h.

Referenced by dump(), inBufferShiftDown(), and inputProcess().

◆ currentRecordIndex_

uint64_t e57::BitpackDecoder::currentRecordIndex_ = 0
protected

◆ destBuffer_

std::shared_ptr<SourceDestBufferImpl> e57::BitpackDecoder::destBuffer_
protected

◆ inBuffer_

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

Definition at line 90 of file Decoder.h.

Referenced by dump(), inBufferShiftDown(), and inputProcess().

◆ inBufferAlignmentSize_

unsigned int e57::BitpackDecoder::inBufferAlignmentSize_
protected

Definition at line 93 of file Decoder.h.

Referenced by dump().

◆ inBufferEndByte_

size_t e57::BitpackDecoder::inBufferEndByte_ = 0
protected

Definition at line 92 of file Decoder.h.

Referenced by dump(), inBufferShiftDown(), inputProcess(), and stateReset().

◆ inBufferFirstBit_

size_t e57::BitpackDecoder::inBufferFirstBit_ = 0
protected

Definition at line 91 of file Decoder.h.

Referenced by dump(), inBufferShiftDown(), inputProcess(), and stateReset().

◆ maxRecordCount_

uint64_t e57::BitpackDecoder::maxRecordCount_ = 0
protected

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