FARGOS/VISTA Object Management Environment Core  ..
FARGOS/VISTA Object Management Environment Core Table of Contents
mapped_vars.h File Reference

Go to the source code of this file.

Classes

struct  MappedVarRecord
 Data structure to reference a variable record within a memory-mapped segment. More...
 

Macros

#define INIT_MAPPED_VAR(name, fmt, len)   { 0, 0, name, fmt, len, 0}
 Convenience macro to define an initialization record for a MappedVarRecord structure. More...
 
#define INIT_MAPPED_INT_VAR(name)   INIT_MAPPED_VAR(name, "=%d", sizeof(int))
 Convenience macro to define an initialization record for a MappedVarRecord representing an integer variable using text output. The output format used is "=%d", yielding output lines like "varName=NNNN". More...
 
#define MAPPED_TYPE_VAR(t, tbl, id)   ((t *)(tbl[id].address))
 Get the address of a MappedVarRecords value. More...
 
#define MAPPED_INT_VAR(tbl, id)   MAPPED_TYPE_VAR(int32_t, tbl,id)
 Get the address of a MappedVarRecords value representing an integer. More...
 
#define UPDATE_MAPPED_TYPE_VAR(t, tbl, id)   { int _l = sprintf((char *) tbl[id].outputAddress, tbl[id].formatPattern, *MAPPED_TYPE_VAR(t, tbl, id)); tbl[id].outputAddress[_l] = ' '; }
 Update (format) the output value of a MappedVarRecord element. More...
 
#define RELOAD_MAPPED_TYPE_VAR(t, tbl, id)   { int _l = sscanf((char *) tbl[id].outputAddress, tbl[id].formatPattern, MAPPED_TYPE_VAR(t, tbl, id)); }
 Reload the value represented by the formatted text into the native format held by a MappedVarRecord. More...
 
#define UPDATE_MAPPED_INT_VAR(tbl, id)   { uint32_t workBfr[6]; uint32_t _l; uint64_t _v = *MAPPED_INT_VAR(tbl, id); char *_r = int_to_ascii(workBfr, sizeof(workBfr), _v, &_l); int _i = 0; while (tbl[id].formatPattern[_i] != '%') { tbl[id].outputAddress[_i] = tbl[id].formatPattern[_i]; _i+=1; } memcpy(tbl[id].outputAddress+_i, _r, _l); }
 

Functions

int createMappedVars (const uint_fast32_t numVars, struct MappedVarRecord vars[], unsigned char **segment, size_t *segmentLenPtr, const uint_fast32_t doInit, const char *fileName)
 Create/reload an array of MappedVarRecords that is mapped by a memory mapped file. More...
 
Generated: Tue Jul 28 2020 16:03:26
Support Information