VIPER REFERENCE MANUAL


NAME
iflDataSize, iflDataTypeFromRange, iflDataClosestType, iflDataMin, iflDataMax, iflDataIsSigned, iflDataIsIntegral - convenience functions for using IFL data types

HEADER FILE
#include <ifl/iflDataSize.h>

SYNOPSIS
extern "C" size_t iflDataSize ( iflDataType type, int count=1);
extern "C" iflDataType iflDataTypeFromRange ( double minVal, double maxVal, int typeMask=-1);
extern "C" iflDataType iflDataClosestType ( iflDataType desired, int allowed, int flags=0);
extern "C" double iflDataMin ( iflDataType type);
extern "C" double iflDataMax ( iflDataType type);
extern "C" inline int iflDataIsSigned ( iflDataType type);
extern "C" inline int iflDataIsIntegral ( iflDataType type);

DESCRIPTION
These functions operate on IFL data types and are provided for convenience. Each function is standalone and is not a member function of any object.

The data types used in the IFL are specified by the enumerated type, iflType, as defined in <ifl/iflTypes.h>. The following IFL data types are valid: iflBit, iflUChar, iflChar, iflUShort, iflShort, iflUInt, iflInt, iflFloat, iflDouble.

FUNCTION DESCRIPTIONS

   iflDataClosestType()
extern "C" iflDataType iflDataClosestType ( iflDataType desired, int allowed, int flags=0);

This function returns the data type closest to the desired type in the set specified by the mask of data types in allowed. The flags parameter is the logical or of any of the folowing options:

iflDataWantSigned consider only signed types from allowed (unless there aren't any, then fall back on unsigned values)
iflDataAnySign consider both signed and unsigned types. The default behaviour is to consider types that match the signed/unsigned nature of desired.
iflDataDemote don't allow type promotion; only consider types of the same size of smaller.

   iflDataIsIntegral()
extern "C" inline int iflDataIsIntegral ( iflDataType type);

This function returns TRUE if type is an integral valued IFL type. If type is a floating point IFL type, then FALSE is returned.

   iflDataIsSigned()
extern "C" inline int iflDataIsSigned ( iflDataType type);

This function returns TRUE if type is a signed IFL type. If type is an unsigned IFL type, then FALSE is returned.

   iflDataMax()
extern "C" double iflDataMax ( iflDataType type);

This function returns the maximum value possible for the given IFL data type, type.

   iflDataMin()
extern "C" double iflDataMin ( iflDataType type);

This function returns the minimum value possible for the given IFL data type, type.

   iflDataSize()
extern "C" size_t iflDataSize ( iflDataType type, int count=1);

This function returns the size in bytes required to hold the number of values specified by \f2count\fP, of the given data type, type.

   iflDataTypeFromRange()
extern "C" iflDataType iflDataTypeFromRange ( double minVal, double maxVal, int typeMask=-1);

This function returns the IFL data type required to hold the range of values specified by minVal and maxVal.