Fermi Physics Class Libraries Module: Fixed Types



Fixed-size Data Types Sub-package

This mini-package provides uniform aliases for data types of known and obvious sizes. ZOOM packages freely use these types instead of the fundamental types (such as short or float) which may be of different byte lengths on different systems. Users are encouraged to utilize these same definitions where appropriate.

The substance of this package is an include file, FixedTypes.h. This package may be obtained from the following sources:

User Interface
Documentation and Headers

Walter Brown, Module Coordinator
Fermilab Physics Class Library Task Force

Comments, questions about getting started, feature needs, and bug/annoyance reports may be sent to zoom-support@fnal.gov or zoom@fnal.gov.


The include file FixedTypes.h defines aliases such as Float4 which may freely be used where a data type of that nature and size is wanted. The header takes information about the system from environment variables and defines each type to be the appropriate fundamental type.

If the specified data format is not supported on the platform in question (for example, not every system supports Float16), then that data type is left undefined so that usage will generate an error at compilation time.

Intended status:

Development status:

User Interface

To use FixedTypes, the user includes the header file:

The code guard is FIXEDTYPES_H; this symbol may also be used as an external code guard.

To test the presence of each data type, and verify that the header is working properly in this environment, you may compile and run the test program ZMutility/test/testFixedTypes.cc.

&> g++ -o test testFixedTypes.cc
&> test
Testing fixed-size types in environment 1:

 1  Int1 ok
 2  Int2 ok
 4  Int4 ok
 -  Int8 not available!

 1  UInt1 ok
 2  UInt2 ok
 4  UInt4 ok
 -  UInt8 not available!

 4  Float4 ok
 8  Float8 ok
 -  Float16 not available!
If the size of a type is inconsistent, the test will indicate this fact, as in:
 8  Float16 wrong!
This would indicate some mixup in the environment defining the type of system.

Documentation and headers

A User's Guide is available in postscript and in latex.

The sole header file is FixedTypes.h.

ZOOM Home Page - Fermilab at Work - Fermilab Home

Walter Brown
Last modified: January 15, 1998