VRS
A file format for sensor data.
Loading...
Searching...
No Matches
Public Member Functions | Static Protected Member Functions | List of all members
vrs::LegacyFormatsProvider Class Referenceabstract

System to inject record format & data layout definitions for files created without. More...

#include <LegacyFormatsProvider.h>

Public Member Functions

virtual void registerLegacyRecordFormats (RecordableTypeId typeId)=0
 

Static Protected Member Functions

static bool addLegacyRecordFormat (RecordableTypeId typeId, Record::Type recordType, uint32_t formatVersion, const RecordFormat &format, const vector< const DataLayout * > &layouts)
 

Detailed Description

System to inject record format & data layout definitions for files created without.

Early VRS files do not include RecordFormat & DataLayout definitions, but often enough, records can easily be described with the right RecordFormat and DataLayout definitions. This allows an easier transition to RecordFormat and DataLayout, as client code can be updated to rely entirely on RecordFormatStreamPlayer to read older and newer VRS files alike. For this, you can inject RecordFormat and DataLayout definitions using this class.

Member Function Documentation

◆ addLegacyRecordFormat()

static bool vrs::LegacyFormatsProvider::addLegacyRecordFormat ( RecordableTypeId  typeId,
Record::Type  recordType,
uint32_t  formatVersion,
const RecordFormat format,
const vector< const DataLayout * > &  layouts 
)
inlinestaticprotected

Method a LegacyFormatsProvider calls to add a legacy record format definition. The signature is identical to Recordable::addRecordFormat(), except for the RecordableTypeId, which is implicit in the context of a Recordable. Attention! when you provide a RecordFormat for a record type & formatVersion, all of the streams' records of that type & formatVersion must comply with that RecordFormat.

Parameters
recordTypeThe Record::Type to define.
formatVersionThe format version to define.
formatThe RecordFormat for the records of the type and format version.
layoutsA vector of pointers to DataLayouts and nullptr. For each DataLayout content block of the RecordFormat, a pointer to a DataLayout must be provided for the matching index.
Returns
True if the RecordFormat and the layouts match as expected. Otherwise, false is returned and errors will be logged to help debug the problem.

◆ registerLegacyRecordFormats()

virtual void vrs::LegacyFormatsProvider::registerLegacyRecordFormats ( RecordableTypeId  typeId)
pure virtual

Method to implement to provide legacy definitions for a specific device type. When this method is called, call the addRecordFormat() method with the definitions.

Parameters
typeIdthe recordable type to provide record format definitions for.

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