Templated interface to static data that provides the description of a specific layout of meta data. It can also load/save such formats from/to a file.
More...
template<typename RECORD_CLASS>
class MetaDataLoaderForFormat< RECORD_CLASS >
Templated interface to static data that provides the description of a specific layout of meta data. It can also load/save such formats from/to a file.
- Parameters
-
RECORD_CLASS | is the name of the class that represents a specific record of meta data. |
Use of this class requires defining the implementation of the static members fileDescriptionTable, totalFields and magicNumber that will be associated with the RECORD_CLASS.
The loadMetaDataHeader() routine can then be used to load the table of meta data.
The writeMetaDataToFile() routine can be used to create a file of the appropriate format and is just a simple cover to the writeUniversalMetaDataMetaDataToFile() routine.
- See also
- loadAndConvertMetaData() - this facility is able to load meta data and and transform it into a different format.
template<typename RECORD_CLASS >
Loads meta data from a file into an array of RECORD_CLASS elements.
- Parameters
-
fileName | specifies the source file that will be opened for read. |
resultTable | will be set with a pointer to the loaded meta data table; If null, no data could be loaded. Note that these records are treated as read-only. |
retSegmentBase | points to a location into which the base of the mapped segment will be stored. |
retSegmentLen | points to a location into which the length of the segment will be stored. |
retDataOffset | points to a location into which an offset from the base of the segment will be stored that represents the start of the reference data table. |
- Returns
- a pointer to the meta data file's header is returned.
- Return values
-
nullptr | indicates the file could not be opened. |
References app(), createMappedFile(), fd, UniversalMetaData_ReferenceFileHeader::fieldDescriptionLength, UniversalMetaData_ReferenceFileHeader::headerLength, LOG_COMPONENT_CERR, LOG_ENDLINE, UniversalMetaData_ReferenceFileHeader::magicNumber, MAP_FILE_READONLY, UniversalMetaData_ReferenceFileHeader::metaRecordLength, OS_HANDLE_TYPE, UniversalMetaData_ReferenceFileHeader::totalFields, MetaDataLoaderForFormat< RECORD_CLASS >::totalFields, and UniversalMetaData_ReferenceFileHeader::totalRecords.
Referenced by loadAndConvertMetaData().