FARGOS/VISTA Object Management Environment Core  ..
FARGOS/VISTA Object Management Environment Core Table of Contents
UniversalMetaData.hpp File Reference
#include <unistd.h>
#include <sys/mman.h>
#include <stdint.h>
#include <utils/io/mapped_file.h>
#include <utils/logging/logging_api.hpp>

Go to the source code of this file.

Classes

struct  UniversalMetaData_FieldDescription
 Field Description record for self-describing meta data. More...
 
struct  UniversalMetaData_ReferenceFileHeader
 File header for self-describing meta data file format. More...
 
struct  UniversalMetaData_ReferenceRecordHeader
 Optional meta data record header used in meta data files containing variable-length records. More...
 
struct  GENERIC_META_RECORD
 Typename for qualifying MetaDataLoaderForFormat members. More...
 
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. More...
 

Macros

#define RELATIVE_FIELD_OFFSET(className, n)   (reinterpret_cast<unsigned char *>(&(((className *)(8192))-> n)) - reinterpret_cast<unsigned char *>(8192))
 Return relative offset of a field within a structure by pretending the structure was on a page-aligned boundary. More...
 
#define DESCRIBE_NAMED_FIELD_OF_CLASS(shortName, n, t, className)   { 1, SharedMemoryVariable:: t, (uint16_t) RELATIVE_FIELD_OFFSET(className,n), sizeof(((className *)(0))-> n), {""}, { shortName } }
 Convenience macro to describe an element of a structure. More...
 
#define DESCRIBE_OPTIONAL_NAMED_FIELD_OF_CLASS(group, shortName, n, t, className)   { group, SharedMemoryVariable:: t, (uint16_t) RELATIVE_FIELD_OFFSET(className,n), sizeof(((className *)(0))-> n), {""}, { shortName } }
 Convenience macro to describe an optional element of a structure. More...
 
#define DESCRIBE_OPTIONAL_OR_ZERO_FILLED_NAMED_FIELD_OF_CLASS(group, shortName, n, t, className)   { __ZERO_FILL_BIT | (group), SharedMemoryVariable:: t, (uint16_t) RELATIVE_FIELD_OFFSET(className,n), sizeof(((className *)(0))-> n), {""}, { shortName } }
 Convenience macro to describe an optional element of a structure that should be treated as zero-filled if not present. More...
 
#define DESCRIBE_FIELD_OF_CLASS(n, t, className)   DESCRIBE_NAMED_FIELD_OF_CLASS(#n, n, t, className)
 Convenience macro which is a simpler case of DESCRIBE_NAMED_FIELD_OF_CLASS. The text name of the field is the same as the name of the member element. More...
 
#define DESCRIBE_OPTIONAL_FIELD_OF_CLASS(group, n, t, className)   DESCRIBE_NAMED_FIELD_OF_CLASS(group, #n, n, t, className)
 Convenience macro which is a simpler case of DESCRIBE_OPTIONAL_NAMED_FIELD_OF_CLASS. The text name of the field is the same as the name of the member element. More...
 
#define DESCRIBE_OPTIONAL_OR_ZERO_FILLED_FIELD_OF_CLASS(group, n, t, className)   DESCRIBE_NAMED_FIELD_OF_CLASS(__ZERO_FILL_BIT | (group), #n, n, t, className)
 Convenience macro which is a simpler case of DESCRIBE_OPTIONAL_NAMED_FIELD_OF_CLASS and tags the field as to be viewed as zero-filled if not present. The text name of the field is the same as the name of the member element. More...
 

Typedefs

typedef int(* ConvertAndTransferFieldFP) (const UniversalMetaData_FieldDescription *sourceDescr, const UniversalMetaData_FieldDescription *destDescr, const unsigned char *sourceRecord, unsigned char *destinationRecord, void *userData)
 Protototype for metadata conversion callback. More...
 

Functions

int inspectMetaDataHeaderInFile (struct UniversalMetaData_ReferenceFileHeader *hdr, const char *fileName)
 Retrieve the meta data file header from a file. More...
 
int64_t writeUniversalMetaDataMetaDataToFile (const uint32_t fieldTotal, const UniversalMetaData_FieldDescription *fieldDescTbl, const char *magicNumber, const char *fileName, const uint32_t totalRecords, const void **tableBase, const uint32_t outputRecordLength)
 Generic routine to write a meta data description file. More...
 
int defaultConvertAndTransferField (const UniversalMetaData_FieldDescription *sourceDescr, const UniversalMetaData_FieldDescription *destDescr, const unsigned char *sourceRecord, unsigned char *destinationRecord, void *userData)
 Default conversion routine to convert from one described format to another. More...
 
template<typename TO_FORMAT , typename FROM_FORMAT = GENERIC_META_RECORD>
TO_FORMAT * loadAndConvertMetaData (const char *fileName, uint32_t *recTotal, ConvertAndTransferFieldFP transferFunction=defaultConvertAndTransferField, void *userData=nullptr)
 Load an existing metadata file and process the records. Normally this is used to convert from one format into another, but this is not required. More...
 
Generated: Tue Jul 28 2020 16:03:26
Support Information