Datasets usually contain typed data, as is the rule for data stored on the MemCom databases. By default, data are stored in little-endian IEEE format on the databases. If needed, data are transformed to the proper application format when reading and writing. The table below displays the MemCom data types and their C/C++/Fortran counterparts.
Table 2.1. MemCom data types
Type | Description | Size (bits) | C/C++ data type | Fortran data type (ftn API) |
I | Signed integer format. | 32 | mcInt32 | mcf_i4 (integer*4) |
J | Signed long integer format. | 64 | mcInt64 | mcf_i8 (integer*8) |
E | Single precision floating-point format. | 32 | mcFloat32 | mcf_r4 (real*4) |
C | Single precision complex floating-point format. | 64 | mcComplexFloat32 | mcf_c4 (complex*4) |
F | Double precision floating-point format. | 64 | mcFloat64 | mcf_r8 (real*8) |
Z | Double precision complex floating-point format | 128 | mcComplexFloat64 | mcf_c8 (complex*8) |
K | Character string. | 8 | char [] | character*n |
$ | Relational table. | - | mcRTable | mcf_rtable |
AT | Array table. | - | None | None |
ST | Sparse table. | - | None | None |
U | Unspecified format, i.e byte array (not the same as a string!) | 8 | char [] | integer*1 |
The MemCom data types are identified by character strings
as described in column 1 of the above table.
MemCom will also accept and preserve
unspecified data types. However, for the unspecified data types there
is no built-in relation between the data size and the number of bytes
required to represent a data element. In addition, unspecified data
types cannot be converted.
Auxiliary data types are defined for C/C++ and Fortran applications (see table below). These data types ensure the consistency of platform-dependent function call arguments, such as pointers (addresses in memory) of file offsets.
Table 2.2. Auxiliary data types
Data type description | Size (bits) | C/C++ data type | Fortran data type |
Variable storing the size of objects in memory. | 32/64 | mcSize | mcf_size |
Variable storing the size of objects in memory (signed!). | 32/64 | mcSSize | mcf_ssize |
Variable storing a file offset (file address) or the size of a file or portions of it. | 32/64 | mcOff | mcf_off |
Variable storing a pointer, i.e a memory address. | 32/64 | void* | mcf_ptr |
Variable storing distance between pointers. | 32/64 | ptrdiff_t | mcf_ptr |