FARGOS/VISTA Object Management Environment Core  ..
FARGOS/VISTA Object Management Environment Core Table of Contents
UniversalMetaData.hpp
Go to the documentation of this file.
1 /* Copyright (C) 2018 - 2020 FARGOS Development, LLC
2  * Author: Geoff Carpenter - http://www.fargos.net/gcc.html
3  */
4 
5 #ifndef _UNIVERSAL_METADATA_HPP_
6 #define _UNIVERSAL_METADATA_HPP_ "$Id: UniversalMetaData.hpp 482 2020-07-28 10:08:15Z geoff $"
8 
10 #ifndef _WIN32
11 #include <unistd.h>
12 #include <sys/mman.h>
13 #endif
14 #include <stdint.h>
15 #include <utils/io/mapped_file.h>
17 
27  uint8_t fieldGroupId;
28  uint8_t fieldType;
29  uint16_t fieldOffset;
30  uint16_t fieldLength;
31  char _pad[2];
32  char fieldName[16];
33 };
34 
39  char magicNumber[8];
40  uint8_t headerLength;
42  uint16_t totalFields;
43  uint16_t metaRecordLength;
44  char _pad1[2];
45  uint32_t totalRecords;
46  char _pad2[4];
47 };
48 
62 extern int inspectMetaDataHeaderInFile(struct UniversalMetaData_ReferenceFileHeader *hdr, const char *fileName);
63 
64 
69 // Normally only present if metaRecordLength is 0 in UniversalMetaData_ReferenceFileHeader
71  uint16_t totalRecordLength;
73  char _pad[5];
74  uint64_t fieldsPresentMask;
75 };
76 
86 #define RELATIVE_FIELD_OFFSET(className,n) (reinterpret_cast<unsigned char *>(&(((className *)(8192))-> n)) - reinterpret_cast<unsigned char *>(8192))
87 
97 #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 } }
98 
108 #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 } }
109 
111 #define __ZERO_FILL_BIT 128
112 
124 #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 } }
125 
133 #define DESCRIBE_FIELD_OF_CLASS(n,t,className) DESCRIBE_NAMED_FIELD_OF_CLASS(#n, n, t, className)
134 
143 #define DESCRIBE_OPTIONAL_FIELD_OF_CLASS(group,n,t,className) DESCRIBE_NAMED_FIELD_OF_CLASS(group, #n, n, t, className)
144 
154 #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)
155 
156 
178 extern int64_t writeUniversalMetaDataMetaDataToFile(const uint32_t fieldTotal,
179  const UniversalMetaData_FieldDescription *fieldDescTbl,
180  const char *magicNumber,
181  const char *fileName,
182  const uint32_t totalRecords, const void **tableBase,
183  const uint32_t outputRecordLength);
184 
185 
186 
199  // placeholder name
200 };
201 
202 
203 
225 template <typename RECORD_CLASS> class MetaDataLoaderForFormat : public RECORD_CLASS {
226 public:
228  static const uint16_t totalFields;
229  static const char magicNumber[sizeof(((UniversalMetaData_ReferenceFileHeader *)(nullptr))->magicNumber) + 1];
230 
249  const char *fileName,
250  const RECORD_CLASS **resultTable,
251  unsigned char **retSegmentBase,
252  size_t *retSegmentLen, size_t *retDataOffset)
253  {
254  unsigned char *segmentBase;
255  size_t segmentLen = 0; // use actual size of file
256  OS_HANDLE_TYPE fd = createMappedFile(&segmentBase, fileName,
257  &segmentLen, MAP_FILE_READONLY);
258  *retSegmentBase = segmentBase;
259  *retSegmentLen = segmentLen;
260  if (segmentBase == nullptr) {
261  LOG_COMPONENT_CERR(app,error) << "Could not open and map " <<
262  fileName << LOG_ENDLINE;
263  *resultTable = nullptr;
264  *retDataOffset = 0;
265  return (nullptr);
266  }
267 #ifndef _WIN32
268  ::close(fd); // do not need it to be open anymore
269 #else
270  CloseHandle(fd);
271 #endif
272  const UniversalMetaData_ReferenceFileHeader *hdr = reinterpret_cast<const UniversalMetaData_ReferenceFileHeader *>(segmentBase);
274  // verify magic number
275  if (memcmp(hdr->magicNumber, MetaDataLoaderForFormat<RECORD_CLASS>::magicNumber, sizeof(hdr->magicNumber)) != 0) {
276  LOG_COMPONENT_CERR(app,error) << "Wrong magic number for Meta Data in " << fileName << LOG_ENDLINE;
277  *resultTable = nullptr;
278  *retDataOffset = 0;
279  /* NOTE: segment still mapped and passed back so it can be
280  * examined; caller needs to clean up
281  */
282  return (nullptr);
283  }
284  }
285 
286  const uint_fast16_t totalFields = hdr->totalFields; // TODO: handle byte order
287  const uint_fast16_t metaRecordLength = hdr->metaRecordLength; // TODO: handle byte order
288  const uint_fast32_t totalRecords = hdr->totalRecords; // TODO: handle byte order
289 
290  const size_t dataOffset = hdr->headerLength +
292 
293  const unsigned char *startOfData =
294  reinterpret_cast<const unsigned char *>(hdr) + dataOffset;
295 
296  if (metaRecordLength != 0) { // uses fixed-length records
297  const size_t minSize = dataOffset + (totalRecords * metaRecordLength);
298  if (segmentLen < minSize) { // file was too short to hold indicated content
299  LOG_COMPONENT_CERR(app,error) << "Segment is only " << segmentLen <<
300  " but at least " << minSize <<
301  " bytes would be required for file to hold " << totalRecords <<
302  " of length " << metaRecordLength << LOG_ENDLINE;
303  *resultTable = nullptr;
304  *retDataOffset = 0;
305  return (nullptr);
306  }
307  }
308  *resultTable = reinterpret_cast<const RECORD_CLASS *>(startOfData);
309  *retDataOffset = dataOffset;
310  return (hdr);
311  }
312 
313 
327  static int dumpMetaDataToFile(const char *fileName,
328  const RECORD_CLASS **table,
329  const uint32_t totalRecords, const uint32_t recordLength) {
330  const void **tableBase = reinterpret_cast<const void **>(table);
335  fileName, totalRecords, tableBase, recordLength);
336  return (rc);
337  }
338 
339 }; // end MetaDataLoaderForFormat
340 
341 // forward declaration -- wanted by clang++ but not accepted by g++
342 //template <> MetaDataLoaderForFormat<GENERIC_META_RECORD>;
343 
344 
372  const UniversalMetaData_FieldDescription *destDescr,
373  const unsigned char *sourceRecord, unsigned char *destinationRecord,
374  void *userData);
375 
380  const UniversalMetaData_FieldDescription *destDescr,
381  const unsigned char *sourceRecord, unsigned char *destinationRecord,
382  void *userData);
383 
384 
418 template <typename TO_FORMAT,typename FROM_FORMAT=GENERIC_META_RECORD> TO_FORMAT *loadAndConvertMetaData(const char *fileName, uint32_t *recTotal,
420  void *userData=nullptr)
421 {
422  struct FieldMap {
423  const UniversalMetaData_FieldDescription *sourceField;
424  const UniversalMetaData_FieldDescription *destField;
425  };
426 
427  const FROM_FORMAT *resultTable;
428  unsigned char *segmentBase;
429  size_t segmentLen, dataOffset;
430 
433  &resultTable, &segmentBase, &segmentLen, &dataOffset);
434  if (fileHdr == nullptr) { // open, map and verification not successful
435  if (recTotal != nullptr) { // caller wants value returned
436  *recTotal = 0;
437  }
438  if (segmentBase != nullptr) { // map had succeeded
439 #ifndef _WIN32
440  munmap(segmentBase, segmentLen);
441 #else
442  UnmapViewOfFile(segmentBase);
443 #endif
444  }
445  return (nullptr);
446  }
447  /* build field-to-field mapping table */
448  const unsigned char *fieldRec = segmentBase + fileHdr->headerLength;
449  const uint_fast8_t fieldLen = fileHdr->fieldDescriptionLength;
450  const uint_fast16_t sourceFieldTotal = fileHdr->totalFields;
451 
452  /* save enough space for all of the incoming fields and
453  * any optional destination fields which might be zero-filled
454  */
455  const uint_fast16_t destFieldTotal = MetaDataLoaderForFormat<TO_FORMAT>::totalFields;
456  FieldMap *fieldMapping = new FieldMap[sourceFieldTotal + destFieldTotal];
457 
458  // treat as a set of Booleans to track which fields were processed
459  uint8_t *handledDestField = new uint8_t[destFieldTotal];
460  memset(handledDestField, 0, destFieldTotal);
461  // go through available source fields
462  for(uint_fast16_t i=0;i<sourceFieldTotal;i+=1) {
463  const UniversalMetaData_FieldDescription *fieldDesc = reinterpret_cast<const UniversalMetaData_FieldDescription *>(fieldRec);
464  fieldMapping[i].sourceField = fieldDesc;
465  fieldMapping[i].destField = nullptr; // assume not found
466  // then go through destination fields and find match, if possible
467  for(uint_fast16_t j=0;j < destFieldTotal;j+=1) {
468  // ignore case, don't require trailing null
469  if (
470 #ifdef _MSC_VER /* Visual C++ */
471  _strnicmp
472 #else /* use standard name */
473  strncasecmp
474 #endif
475  (fieldDesc->fieldName, MetaDataLoaderForFormat<TO_FORMAT>::fieldDescriptionTable[j].fieldName, sizeof(fieldDesc->fieldName)) == 0) { // found match
476  fieldMapping[i].destField = &(MetaDataLoaderForFormat<TO_FORMAT>::fieldDescriptionTable[j]);
477  handledDestField[j] = true; // note that this destination field handled
478  break;
479  }
480  }
481  fieldRec += fieldLen;
482  }
483  // add entries for any destination fields that must always be announced
484  uint_fast16_t totalFields = sourceFieldTotal;
485  for(uint_fast16_t i=0;i<MetaDataLoaderForFormat<TO_FORMAT>::totalFields;i+=1) {
486  if (handledDestField[i] == false) { // not yet handled
487  if ((MetaDataLoaderForFormat<TO_FORMAT>::fieldDescriptionTable[i].fieldGroupId & __ZERO_FILL_BIT) != 0) { // optional field zero-filled field
488  fieldMapping[totalFields].sourceField = nullptr; // no source
489  fieldMapping[totalFields].destField = &(MetaDataLoaderForFormat<TO_FORMAT>::fieldDescriptionTable[i]);
490  totalFields += 1;
491  }
492  }
493  }
494  delete[] handledDestField;
495 
496  /* now process records and convert */
497  uint_fast32_t recordTotal = fileHdr->totalRecords;
498  uint_fast32_t metaLen = fileHdr->metaRecordLength;
499  if (recTotal != nullptr) { // caller wants value returned
500  *recTotal = recordTotal;
501  }
502  TO_FORMAT *newTable = new TO_FORMAT[recordTotal];
503  const unsigned char *sourceRecord = segmentBase + dataOffset;
504  for(uint_fast32_t i=0;i<recordTotal;i+=1) {
505  uint64_t fieldMask;
506  uint_fast32_t recLen;
507  if (metaLen != 0) { // fixed-length source records
508  fieldMask = 1;
509  recLen = metaLen;
510  } else { // variable length records start with header
511  const UniversalMetaData_ReferenceRecordHeader *recHdr = reinterpret_cast<const UniversalMetaData_ReferenceRecordHeader *>(sourceRecord);
512  recLen = recHdr->totalRecordLength;
513  fieldMask = recHdr->fieldsPresentMask;
514  }
515  for(uint_fast16_t j=0;j<sourceFieldTotal;j+=1) {
516  const FieldMap &entry = fieldMapping[j]; // alias
517  uint_fast8_t groupIdSpec = entry.sourceField->fieldGroupId;
518  uint_fast8_t groupId = (groupIdSpec & 63) - 1;
519  uint64_t maskBit = static_cast<uint64_t>(1) << groupId;
520  if (OME_EXPECT_TRUE(fieldMask & maskBit)) { // field is present
521  (*transferFunction)(entry.sourceField, entry.destField,
522  sourceRecord,
523  reinterpret_cast<unsigned char *>(&(newTable[i])), userData);
524  } else if (entry.destField != nullptr) { // source field is not present, but destination field is described
525  const uint_fast8_t zeroFillIfNotPresent = entry.destField->fieldGroupId & __ZERO_FILL_BIT;
526  if (zeroFillIfNotPresent != 0) {
527  (*transferFunction)(entry.sourceField, entry.destField,
528  nullptr, /* indicate source data not present */
529  reinterpret_cast<unsigned char *>(&(newTable[i])), userData);
530  }
531  }
532  }
533  // handle missing source fields so destination can be zero-filled
534  for(uint_fast16_t j=sourceFieldTotal;j<totalFields;j+=1) {
535  const FieldMap &entry = fieldMapping[j]; // alias
536  // no source field present
537  (*transferFunction)(entry.destField, entry.destField,
538  nullptr, /* indicate not present */
539  reinterpret_cast<unsigned char *>(&(newTable[i])), userData);
540  }
541  // all fields processed, call with source/destination null to indicate
542  (*transferFunction)(nullptr, nullptr, sourceRecord,
543  reinterpret_cast<unsigned char *>(&(newTable[i])), userData);
544  sourceRecord += recLen;
545  }
546  delete[] fieldMapping;
547 #ifndef _WIN32
548  munmap(segmentBase, segmentLen);
549 #else
550  UnmapViewOfFile(segmentBase);
551 #endif
552  return (newTable);
553 }
554 
555 #undef __ZERO_FILL_BIT
556 
558 #endif
559 /* vim: set expandtab shiftwidth=4 tabstop=4: */
UniversalMetaData_ReferenceFileHeader::headerLength
uint8_t headerLength
size of this header
Definition: UniversalMetaData.hpp:40
l
Ïúíþ ð Ø ˜ ˜ __text __TEXT € __apple_names __DWARF __apple_objc __DWARF __apple_namespac__DWARF H X __apple_types __DWARF l
Definition: tmp3.o.cpp:1
UniversalMetaData.hpp
SharedMemoryVariable::SMV_TYPE_INT64
@ SMV_TYPE_INT64
Definition: shared_variable.hpp:49
UniversalMetaData_ReferenceFileHeader::totalFields
uint16_t totalFields
total fields described per record
Definition: UniversalMetaData.hpp:42
MetaDataLoaderForFormat::loadMetaDataHeader
static const UniversalMetaData_ReferenceFileHeader * loadMetaDataHeader(const char *fileName, const RECORD_CLASS **resultTable, unsigned char **retSegmentBase, size_t *retSegmentLen, size_t *retDataOffset)
Loads meta data from a file into an array of RECORD_CLASS elements.
Definition: UniversalMetaData.hpp:248
UniversalMetaData_FieldDescription::fieldLength
uint16_t fieldLength
length of field
Definition: UniversalMetaData.hpp:30
SharedMemoryVariable::SMV_TYPE_DOUBLE
@ SMV_TYPE_DOUBLE
Definition: shared_variable.hpp:52
MetaDataLoaderForFormat::dumpMetaDataToFile
static int dumpMetaDataToFile(const char *fileName, const RECORD_CLASS **table, const uint32_t totalRecords, const uint32_t recordLength)
Dump meta data description and product records to a file.
Definition: UniversalMetaData.hpp:327
UniversalMetaData_ReferenceFileHeader::fieldDescriptionLength
uint8_t fieldDescriptionLength
size of UniversalMetaData_FieldDescription (or equivalent)
Definition: UniversalMetaData.hpp:41
powersOf10
const uint32_t powersOf10[10]
Table of powers-of-10 constants as 32-bit unsigned integers.
Definition: text2int_tbl.h:37
MetaDataLoaderForFormat::totalFields
static const uint16_t totalFields
Definition: UniversalMetaData.hpp:228
UniversalMetaData_FieldDescription::fieldGroupId
uint8_t fieldGroupId
field group id (1-63)
Definition: UniversalMetaData.hpp:27
MetaDataLoaderForFormat::fieldDescriptionTable
static const UniversalMetaData_FieldDescription * fieldDescriptionTable
Definition: UniversalMetaData.hpp:227
MetaDataLoaderForFormat
Templated interface to static data that provides the description of a specific layout of meta data....
Definition: UniversalMetaData.hpp:225
SharedMemoryVariable::SMV_TYPE_STRING
@ SMV_TYPE_STRING
Definition: shared_variable.hpp:56
GENERIC_META_RECORD
Typename for qualifying MetaDataLoaderForFormat members.
Definition: UniversalMetaData.hpp:198
UniversalMetaData_ReferenceRecordHeader::_pad
char _pad[5]
Definition: UniversalMetaData.hpp:73
UniversalMetaData_FieldDescription::fieldName
char fieldName[16]
name associated with field
Definition: UniversalMetaData.hpp:32
UniversalMetaData_ReferenceFileHeader::totalRecords
uint32_t totalRecords
total product records
Definition: UniversalMetaData.hpp:45
MAP_FILE_READONLY
#define MAP_FILE_READONLY
Definition: mapped_file.h:66
UniversalMetaData_FieldDescription
Field Description record for self-describing meta data.
Definition: UniversalMetaData.hpp:26
UniversalMetaData_ReferenceFileHeader
File header for self-describing meta data file format.
Definition: UniversalMetaData.hpp:38
n4to_uint32
uint32_t n4to_uint32(const void *byteData) NONNULL_PARAMETERS(1) OME_ALWAYS_INLINE OME_ALWAYS_OPTIMIZE("-O3")
Convert a network byte order 4-byte integer into a native unsigned 32-bit value.
Definition: text2int.h:321
VariableFixedPointValue::precision
int_fast8_t precision
Definition: text2int.h:529
VariableFixedPointValue
Return value structure for representing fixed-point values with variable precision.
Definition: text2int.h:527
fixedpoint_to_ascii
char * fixedpoint_to_ascii(char *resultBfr, uint_fast8_t bfrLen, int64_t value, uint_fast8_t precision, uint_fast8_t *retStrLen, int_fast8_t outputPrecision)
Format a fixed-point value with indicated decimal places.
Definition: text2int.cpp:2734
SharedMemoryVariable::SMV_TYPE_FLOAT
@ SMV_TYPE_FLOAT
Definition: shared_variable.hpp:51
srcID
const char srcID[]
Definition: catSym.c:17
UniversalMetaData_ReferenceRecordHeader::totalRecordLength
uint16_t totalRecordLength
total bytes in record
Definition: UniversalMetaData.hpp:71
mapped_file.h
UniversalMetaData_ReferenceFileHeader::metaRecordLength
uint16_t metaRecordLength
we use fixed-size records; 0 indicates variable size
Definition: UniversalMetaData.hpp:43
OME_EXPECT_TRUE
#define OME_EXPECT_TRUE(expr)
Annotation macro for conditional expression expected to be true.
Definition: compiler_hints.h:541
writeUniversalMetaDataMetaDataToFile
int64_t writeUniversalMetaDataMetaDataToFile(const uint32_t fieldTotal, const UniversalMetaData_FieldDescription *fieldDescTbl, const char *magicNumber, const char *outputFileName, const uint32_t totalRecords, const void **tableBase, const uint32_t outputRecordLength)
Generic routine to write a meta data description file.
Definition: UniversalMetaData.cpp:41
NULL
#define NULL
Definition: tmp.o.cpp:327
ConvertAndTransferFieldFP
int(* ConvertAndTransferFieldFP)(const UniversalMetaData_FieldDescription *sourceDescr, const UniversalMetaData_FieldDescription *destDescr, const unsigned char *sourceRecord, unsigned char *destinationRecord, void *userData)
Protototype for metadata conversion callback.
Definition: UniversalMetaData.hpp:371
app
LogMaskType_t COMPONENT_LOG_MASK() app("app_logMask", &DEFAULT_sharedMemoryVariableManager, COMPONENT_LEVEL(app, defaultMask))
SharedMemoryVariable::SMV_TYPE_FIXED
@ SMV_TYPE_FIXED
Definition: shared_variable.hpp:53
float_to_ascii
char * float_to_ascii(char *resultBfr, uint_fast8_t bfrLen, double value, uint_fast8_t *retStrLen, int_fast8_t outputPrecision, bool roundValue)
Format a double-precision value with indicated decimal places.
Definition: text2int.cpp:2808
createMappedFile
int createMappedFile(unsigned char **segment, const char *fileName, size_t *segmentLenPtr, uint_fast32_t doInit)
Create or open a mapped file with the specified file name.
Definition: mapped_file.cpp:207
SharedMemoryVariable::SMV_TYPE_INT32
@ SMV_TYPE_INT32
Definition: shared_variable.hpp:47
int_to_ascii
char * int_to_ascii(uint32_t resultBfr[], uint_fast8_t bfrLen, int64_t value, uint_fast8_t *retStrLen)
Identical to uint_to_ascii(), except that negative values are accepted.
Definition: text2int.cpp:2699
UniversalMetaData_FieldDescription::_pad
char _pad[2]
Definition: UniversalMetaData.hpp:31
OME_USED
const char srcID[] OME_USED
Definition: tick_time.cpp:24
UniversalMetaData_ReferenceFileHeader::magicNumber
char magicNumber[8]
magic number to identify specific file format
Definition: UniversalMetaData.hpp:39
VariableFixedPointValue::value
int64_t value
Definition: text2int.h:528
SharedMemoryVariable::SMV_TYPE_UNSIGNED
@ SMV_TYPE_UNSIGNED
Definition: shared_variable.hpp:45
OME_EXPECT_FALSE
#define OME_EXPECT_FALSE(expr)
Annotation macro for conditional expression expected to be false.
Definition: compiler_hints.h:540
LOG_COMPONENT_CERR
#define LOG_COMPONENT_CERR(component, lvl)
Convenience macro that uses LOG_COMPONENT_INTO to conditionally log a message to standard error.
Definition: logging_api.hpp:3030
SharedMemoryVariable::SMV_TYPE_UINT32
@ SMV_TYPE_UINT32
Definition: shared_variable.hpp:48
UniversalMetaData_ReferenceRecordHeader
Optional meta data record header used in meta data files containing variable-length records.
Definition: UniversalMetaData.hpp:70
UniversalMetaData_ReferenceFileHeader::_pad1
char _pad1[2]
Definition: UniversalMetaData.hpp:44
UniversalMetaData_ReferenceRecordHeader::fieldsPresentMask
uint64_t fieldsPresentMask
bitmask specifying field groups present in record
Definition: UniversalMetaData.hpp:74
LOG_ENDLINE
#define LOG_ENDLINE
Closing clause for text line output using << operators.
Definition: logging_api.hpp:2956
OS_HANDLE_TYPE
#define OS_HANDLE_TYPE
Definition: io_processor.hpp:48
inspectMetaDataHeaderInFile
int inspectMetaDataHeaderInFile(UniversalMetaData_ReferenceFileHeader *hdr, const char *fileName)
Retrieve the meta data file header from a file.
Definition: UniversalMetaData.cpp:26
defaultConvertAndTransferField
int defaultConvertAndTransferField(const UniversalMetaData_FieldDescription *sourceDescr, const UniversalMetaData_FieldDescription *destDescr, const unsigned char *sourceFieldData, unsigned char *destinationField, void *userData)
Default conversion routine to convert from one described format to another.
Definition: UniversalMetaData.cpp:134
UniversalMetaData_FieldDescription::fieldType
uint8_t fieldType
type of field data, typically an SMV_TYPE SharedMemoryVariable enum
Definition: UniversalMetaData.hpp:28
uint_to_ascii
char * uint_to_ascii(uint32_t resultBfr[], uint_fast8_t bfrLen, uint64_t value, uint_fast8_t *retStrLen)
Quickly convert a binary integer into ASCII decimal text.
Definition: text2int.cpp:2628
SharedMemoryVariable::SMV_TYPE_UINT64
@ SMV_TYPE_UINT64
Definition: shared_variable.hpp:50
fast_ascii_to_fixedpoint
VariableFixedPointValue fast_ascii_to_fixedpoint(const char *str, uint_fast8_t len, int_fast8_t desiredPrecision)
Convert ASCII decimal text string to fixed point representation.
Definition: text2int.cpp:2888
UniversalMetaData_ReferenceRecordHeader::recordFormatVersion
uint8_t recordFormatVersion
record format version (user-defined semantics)
Definition: UniversalMetaData.hpp:72
UniversalMetaData_FieldDescription::fieldOffset
uint16_t fieldOffset
offset of field from start of record
Definition: UniversalMetaData.hpp:29
htonl
#define htonl(x)
Definition: tmp.o.cpp:3098
SharedMemoryVariable::SMV_TYPE_TINY_STRING
@ SMV_TYPE_TINY_STRING
Definition: shared_variable.hpp:54
loadAndConvertMetaData
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 for...
Definition: UniversalMetaData.hpp:418
fd
int fd
Definition: ethers.c:41
MetaDataLoaderForFormat::magicNumber
static const char magicNumber[sizeof(((UniversalMetaData_ReferenceFileHeader *)(nullptr)) ->magicNumber)+1]
Definition: UniversalMetaData.hpp:229
UniversalMetaData_ReferenceFileHeader::_pad2
char _pad2[4]
Definition: UniversalMetaData.hpp:46
LOG_CERR
#define LOG_CERR(lvl)
Convenience macro that uses LOG_INTO() to conditionally log a message to standard error.
Definition: logging_api.hpp:3014
logging_api.hpp
FARGOS Logging API.
Generated: Tue Jul 28 2020 16:03:26
Support Information