![]() |
VRS
A file format for sensor data.
|
Utility class to handle record format registry manipulations. More...
#include <LegacyFormatsProvider.h>
Public Member Functions | |
void | getLegacyRecordFormats (RecordableTypeId id, RecordFormatMap &outFormats) |
unique_ptr< DataLayout > | getLegacyDataLayout (const ContentBlockId &blockId) |
unique_ptr< DataLayout > | getLatestDataLayout (RecordableTypeId typeId, Record::Type recordType) |
bool | addLegacyRecordFormat (RecordableTypeId typeId, Record::Type recordType, uint32_t formatVersion, const RecordFormat &format, const vector< const DataLayout * > &layouts) |
Static Public Member Functions | |
static void | registerProvider (unique_ptr< LegacyFormatsProvider > provider) |
static RecordFormatRegistrar & | getInstance () |
Utility class to handle record format registry manipulations.
bool vrs::RecordFormatRegistrar::addLegacyRecordFormat | ( | RecordableTypeId | typeId, |
Record::Type | recordType, | ||
uint32_t | formatVersion, | ||
const RecordFormat & | format, | ||
const vector< const DataLayout * > & | layouts | ||
) |
VRS internal method to register a legacy record format. Do not call directly.
|
static |
Access the legacy format registry's singleton.
unique_ptr< DataLayout > vrs::RecordFormatRegistrar::getLatestDataLayout | ( | RecordableTypeId | typeId, |
Record::Type | recordType | ||
) |
Get the newest legacy DataLayout definition for a recordable type id & record type. "Latest" makes the assumption, generally true but not guaranteed, that record versions are numeric values increasing over time. Also, if the "most recent" RecordFormat definition includes multiple DataLayout blocks, the last one is returned, which is also arbitrary, but generally what's needed. These approximations are OK, because this API is meant to dig out legacy DataLayout definitions that include metadata definitions, such as unit & description, mix & max values, to be used for UI purposes when the DataLayout definition found in a file doesn't provide that information. Therefore, approximate matches are better than nothing.
unique_ptr< DataLayout > vrs::RecordFormatRegistrar::getLegacyDataLayout | ( | const ContentBlockId & | blockId | ) |
Provide DataLayout definitions for a specific ContentBlockId.
blockId | Specific content block. |
void vrs::RecordFormatRegistrar::getLegacyRecordFormats | ( | RecordableTypeId | id, |
RecordFormatMap & | outFormats | ||
) |
Use all the registered providers to get the RecordFormat definitions for a specific RecordableTypeId.
id | The RecordableTypeId to provider the formats for. |
outFormats | Map to be set the RecordFormat definitions. |
|
static |
Register a provider. Do this before reading a VRS file.
provider | The provider to register. |