VRS
A file format for sensor data.
Loading...
Searching...
No Matches
vrs::ContentBlockReader Class Referenceabstract

Abstract class to handle the interpretation of a record format's content block. More...

#include <ContentBlockReader.h>

Inheritance diagram for vrs::ContentBlockReader:
vrs::AudioBlockReader vrs::CustomBlockReader vrs::DataLayoutBlockReader vrs::EmptyBlockReader vrs::ImageBlockReader vrs::UnsupportedBlockReader

Public Member Functions

virtual ~ContentBlockReader ()
 Virtual destructor, since this is an abstract class.
virtual bool readBlock (const CurrentRecord &, RecordFormatStreamPlayer &)=0

Static Public Member Functions

static unique_ptr< ContentBlockReader > build (const RecordFormat &recordFormat, size_t blockIndex, unique_ptr< DataLayout > &&blockLayout)

Protected Member Functions

 ContentBlockReader (const RecordFormat &recordFormat, size_t blockIndex)
bool findNextContentBlockSpec (const CurrentRecord &record, RecordFormatStreamPlayer &player)
size_t findContentBlockSize (const CurrentRecord &record, RecordFormatStreamPlayer &player)
uint32_t findAudioSampleCount (const CurrentRecord &record, RecordFormatStreamPlayer &player)

Protected Attributes

const RecordFormat & recordFormat_
const size_t blockIndex_
unique_ptr< datalayout_conventions::NextContentBlockSpec > contentBlockSpec_

Detailed Description

Abstract class to handle the interpretation of a record format's content block.

Specialized versions of this class will handle specific types of content blocks.

See also
RecordFormat
ContentBlock

Member Function Documentation

◆ build()

unique_ptr< ContentBlockReader > vrs::ContentBlockReader::build ( const RecordFormat & recordFormat,
size_t blockIndex,
unique_ptr< DataLayout > && blockLayout )
static

Factory style constructor, which will determine what ContentBlockReader object needs to be created to handle the referenced block.

Parameters
recordFormatRecordFormat of the record.
blockIndexIndex of the block to build a ContentBlockReader for.
blockLayoutoptional DataLayout, if the block is a DataLayout block.
Returns
An appropriate ContentBlockReader for the given block.

◆ readBlock()

virtual bool vrs::ContentBlockReader::readBlock ( const CurrentRecord & ,
RecordFormatStreamPlayer &  )
pure virtual

Method called by RecordFormatStreamPlayer when a content block needs to be read. To be implemented by each specialized ContentBlockReader class, which can then interpret the data of the format it expects.

Implemented in vrs::AudioBlockReader, vrs::CustomBlockReader, vrs::DataLayoutBlockReader, vrs::EmptyBlockReader, vrs::ImageBlockReader, and vrs::UnsupportedBlockReader.


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