e57::BitpackFloatEncoder Class Reference

#include <Encoder.h>

Public Member Functions

 BitpackFloatEncoder (unsigned bytestreamNumber, SourceDestBuffer &sbuf, unsigned outputMaxSize, FloatPrecision precision)
 
float bitsPerRecord () override
 
uint64_t processRecords (size_t recordCount) override
 
bool registerFlushToOutput () override
 
- Public Member Functions inherited from e57::BitpackEncoder
float bitsPerRecord () override=0
 
uint64_t currentRecordIndex () override
 
size_t outputAvailable () const override
 
void outputClear () override
 get data from encoder More...
 
size_t outputGetMaxSize () override
 
void outputRead (char *dest, const size_t byteCount) override
 number of bytes that can be read More...
 
void outputSetMaxSize (unsigned byteCount) override
 
uint64_t processRecords (size_t recordCount) override=0
 
bool registerFlushToOutput () override=0
 
unsigned sourceBufferNextIndex () override
 
void sourceBufferSetNew (std::vector< SourceDestBuffer > &sbufs) override
 
- Public Member Functions inherited from e57::Encoder
virtual float bitsPerRecord ()=0
 
unsigned bytestreamNumber () const
 
virtual uint64_t currentRecordIndex ()=0
 
virtual size_t outputAvailable () const =0
 
virtual void outputClear ()=0
 get data from encoder More...
 
virtual size_t outputGetMaxSize ()=0
 
virtual void outputRead (char *dest, const size_t byteCount)=0
 number of bytes that can be read More...
 
virtual void outputSetMaxSize (unsigned byteCount)=0
 
virtual uint64_t processRecords (size_t recordCount)=0
 
virtual bool registerFlushToOutput ()=0
 
virtual unsigned sourceBufferNextIndex ()=0
 
virtual void sourceBufferSetNew (std::vector< SourceDestBuffer > &sbufs)=0
 
virtual ~Encoder ()=default
 

Protected Attributes

FloatPrecision precision_
 
- Protected Attributes inherited from e57::BitpackEncoder
uint64_t currentRecordIndex_
 
std::vector< char > outBuffer_
 
size_t outBufferAlignmentSize_
 
size_t outBufferEnd_
 
size_t outBufferFirst_
 
std::shared_ptr< SourceDestBufferImplsourceBuffer_
 
- Protected Attributes inherited from e57::Encoder
unsigned bytestreamNumber_
 

Additional Inherited Members

- Static Public Member Functions inherited from e57::Encoder
static std::shared_ptr< EncoderEncoderFactory (unsigned bytestreamNumber, std::shared_ptr< CompressedVectorNodeImpl > cVector, std::vector< SourceDestBuffer > &sbuf, ustring &codecPath)
 
- Protected Member Functions inherited from e57::BitpackEncoder
 BitpackEncoder (unsigned bytestreamNumber, SourceDestBuffer &sbuf, unsigned outputMaxSize, unsigned alignmentSize)
 ================ More...
 
void outBufferShiftDown ()
 
- Protected Member Functions inherited from e57::Encoder
 Encoder (unsigned bytestreamNumber)
 

Constructor & Destructor Documentation

◆ BitpackFloatEncoder()

BitpackFloatEncoder::BitpackFloatEncoder ( unsigned  bytestreamNumber,
SourceDestBuffer sbuf,
unsigned  outputMaxSize,
FloatPrecision  precision 
)

Member Function Documentation

◆ bitsPerRecord()

float BitpackFloatEncoder::bitsPerRecord ( )
overridevirtual

Implements e57::BitpackEncoder.

References e57::E57_SINGLE, and precision_.

◆ processRecords()

uint64_t BitpackFloatEncoder::processRecords ( size_t  recordCount)
overridevirtual

Before we add any more, try to shift current contents of outBuffer_ down to beginning of buffer. This leaves outBufferEnd_ at a natural boundary.

Figure out how many records will fit in output.

Can't process more records than will safely fit in output stream

Form the starting address for next available location in outBuffer

Copy floats from sourceBuffer_ to outBuffer_

E57_DOUBLE precision

Form the starting address for next available location in outBuffer

Copy doubles from sourceBuffer_ to outBuffer_

Update end of outBuffer

Update counts of records processed

Implements e57::BitpackEncoder.

References e57::BitpackEncoder::currentRecordIndex_, e57::E57_ERROR_INTERNAL, e57::E57_SINGLE, e57::BitpackEncoder::outBuffer_, e57::BitpackEncoder::outBufferEnd_, e57::BitpackEncoder::outBufferShiftDown(), precision_, e57::BitpackEncoder::sourceBuffer_, and e57::toString().

◆ registerFlushToOutput()

bool BitpackFloatEncoder::registerFlushToOutput ( )
overridevirtual

Since have no registers in encoder, return success

Implements e57::BitpackEncoder.

Member Data Documentation

◆ precision_

FloatPrecision e57::BitpackFloatEncoder::precision_
protected

Referenced by bitsPerRecord(), and processRecords().


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