ValType.h

Classes

ValType -- Data types and their undefined values. (full description)

class ValType

Interface

Public Members
static Bool undefBool ()
static Char undefChar ()
static uChar undefUChar ()
static Short undefShort ()
static uShort undefUShort ()
static Int undefInt ()
static uInt undefUInt ()
static float undefFloat ()
static double undefDouble ()
static Complex undefComplex ()
static DComplex undefDComplex ()
static String undefString ()
static void getUndef (Bool*)
static void getUndef (Char*)
static void getUndef (uChar*)
static void getUndef (Short*)
static void getUndef (uShort*)
static void getUndef (Int*)
static void getUndef (uInt*)
static void getUndef (float*)
static void getUndef (double*)
static void getUndef (Complex*)
static void getUndef (DComplex*)
static void getUndef (String*)
static void getUndef (void*)
static DataType getType (const Bool*)
static DataType getType (const Char*)
static DataType getType (const uChar*)
static DataType getType (const Short*)
static DataType getType (const uShort*)
static DataType getType (const Int*)
static DataType getType (const uInt*)
static DataType getType (const float*)
static DataType getType (const double*)
static DataType getType (const Complex*)
static DataType getType (const DComplex*)
static DataType getType (const String*)
static DataType getType (const TableRecord*)
static DataType getType (const void*)
static const String& getTypeStr (DataType)
static const String& getTypeStr (const Bool*)
static const String& getTypeStr (const Char*)
static const String& getTypeStr (const uChar*)
static const String& getTypeStr (const Short*)
static const String& getTypeStr (const uShort*)
static const String& getTypeStr (const Int*)
static const String& getTypeStr (const uInt*)
static const String& getTypeStr (const float*)
static const String& getTypeStr (const double*)
static const String& getTypeStr (const Complex*)
static const String& getTypeStr (const DComplex*)
static const String& getTypeStr (const String*)
static const String& getTypeStr (const TableRecord*)
static const String& getTypeStr (const void*)
static int getTypeSize (DataType)
static int getCanonicalSize (DataType, Bool BECanonical = True)
static void getCanonicalFunc (DataType dt, Conversion::ValueFunction*& readFunc, Conversion::ValueFunction*& writeFunc, uInt& nrElementsPerValue, Bool BECanonical = True)
static Bool isPromotable (DataType from, DataType to)
static ObjCompareFunc* getCmpFunc (DataType)
static void put (AipsIO&, const Bool*)
static void put (AipsIO&, const Char*)
static void put (AipsIO&, const uChar*)
static void put (AipsIO&, const Short*)
static void put (AipsIO&, const uShort*)
static void put (AipsIO&, const Int*)
static void put (AipsIO&, const uInt*)
static void put (AipsIO&, const float*)
static void put (AipsIO&, const double*)
static void put (AipsIO&, const Complex*)
static void put (AipsIO&, const DComplex*)
static void put (AipsIO&, const String*)
static void put (AipsIO&, const void*)
static void get (AipsIO&, Bool*)
static void get (AipsIO&, Char*)
static void get (AipsIO&, uChar*)
static void get (AipsIO&, Short*)
static void get (AipsIO&, uShort*)
static void get (AipsIO&, Int*)
static void get (AipsIO&, uInt*)
static void get (AipsIO&, float*)
static void get (AipsIO&, double*)
static void get (AipsIO&, Complex*)
static void get (AipsIO&, DComplex*)
static void get (AipsIO&, String*)
static void get (AipsIO&, void*)
static void put (ostream&, const Bool*)
static void put (ostream&, const Char*)
static void put (ostream&, const uChar*)
static void put (ostream&, const Short*)
static void put (ostream&, const uShort*)
static void put (ostream&, const Int*)
static void put (ostream&, const uInt*)
static void put (ostream&, const float*)
static void put (ostream&, const double*)
static void put (ostream&, const Complex*)
static void put (ostream&, const DComplex*)
static void put (ostream&, const String*)
static void put (ostream&, const void*)
static int isDefined (const Bool* value, const Bool* undef)
static int isDefined (const Char* value, const Char* undef)
static int isDefined (const uChar* value, const uChar* undef)
static int isDefined (const Short* value, const Short* undef)
static int isDefined (const uShort* value, const uShort* undef)
static int isDefined (const Int* value, const Int* undef)
static int isDefined (const uInt* value, const uInt* undef)
static int isDefined (const float* value, const float* undef)
static int isDefined (const double* value, const double* undef)
static int isDefined (const Complex* value, const Complex* undef)
static int isDefined (const DComplex* value, const DComplex* undef)
static int isDefined (const String* value, const String* undef)
static int isDefined (const void* value, const void* undef)
Private Members
ValType ()

Description

Review Status

Reviewed By:
Friso olnon
Date Reviewed:
1995/03/20

Prerequisite

Synopsis

Class ValType describes the data types and their "undefined values".

Supported are built-in data types, Bool, String, Complex and DComplex. As a rule, the smallest possible value of a data type is used as its "undefined value"; for String we use the null string, and for Bool the value False.

The class does not contain data. It merely defines constants and has overloaded functions that return in some form the "undefined value", the data type, or certain other information about the data type.

Member Description

static Bool undefBool ()
static Char undefChar ()
static uChar undefUChar ()
static Short undefShort ()
static uShort undefUShort ()
static Int undefInt ()
static uInt undefUInt ()
static float undefFloat ()
static double undefDouble ()
static Complex undefComplex ()
static DComplex undefDComplex ()
static String undefString ()

Get the "undefined value" for this data type as the function's return value.

static void getUndef (Bool*)
static void getUndef (Char*)
static void getUndef (uChar*)
static void getUndef (Short*)
static void getUndef (uShort*)
static void getUndef (Int*)
static void getUndef (uInt*)
static void getUndef (float*)
static void getUndef (double*)
static void getUndef (Complex*)
static void getUndef (DComplex*)
static void getUndef (String*)
static void getUndef (void*)

Get the "undefined value" for this data type in the argument. The void* function is not doing anything and is for TpOther types.

static DataType getType (const Bool*)
static DataType getType (const Char*)
static DataType getType (const uChar*)
static DataType getType (const Short*)
static DataType getType (const uShort*)
static DataType getType (const Int*)
static DataType getType (const uInt*)
static DataType getType (const float*)
static DataType getType (const double*)
static DataType getType (const Complex*)
static DataType getType (const DComplex*)
static DataType getType (const String*)
static DataType getType (const TableRecord*)
static DataType getType (const void*)

Get the data type code for this type as the function's return value.

static const String& getTypeStr (DataType)
static const String& getTypeStr (const Bool*)
static const String& getTypeStr (const Char*)
static const String& getTypeStr (const uChar*)
static const String& getTypeStr (const Short*)
static const String& getTypeStr (const uShort*)
static const String& getTypeStr (const Int*)
static const String& getTypeStr (const uInt*)
static const String& getTypeStr (const float*)
static const String& getTypeStr (const double*)
static const String& getTypeStr (const Complex*)
static const String& getTypeStr (const DComplex*)
static const String& getTypeStr (const String*)
static const String& getTypeStr (const TableRecord*)
static const String& getTypeStr (const void*)

Get the name of the data type. The void* returns the string "Other ".

static int getTypeSize (DataType)

Get the size of data type (in local format).

static int getCanonicalSize (DataType, Bool BECanonical = True)

Get the size of data type in canonical format.
The argument BECanonical determines if the big-endian or little-endian canonical format is used.

static void getCanonicalFunc (DataType dt, Conversion::ValueFunction*& readFunc, Conversion::ValueFunction*& writeFunc, uInt& nrElementsPerValue, Bool BECanonical = True)

Get the functions to convert to/from canonical format. These functions take the number of pixels as the length argument. It returns the number of elements per value; normally this is 1, but for complex values it is 2 (since they convert float/double).
The argument BECanonical determines if the big-endian or little-endian canonical format is used.

static Bool isPromotable (DataType from, DataType to)

Test if a data type can be promoted to another.

static ObjCompareFunc* getCmpFunc (DataType)

Get the pointer to the routine which compares two values.

static void put (AipsIO&, const Bool*)
static void put (AipsIO&, const Char*)
static void put (AipsIO&, const uChar*)
static void put (AipsIO&, const Short*)
static void put (AipsIO&, const uShort*)
static void put (AipsIO&, const Int*)
static void put (AipsIO&, const uInt*)
static void put (AipsIO&, const float*)
static void put (AipsIO&, const double*)
static void put (AipsIO&, const Complex*)
static void put (AipsIO&, const DComplex*)
static void put (AipsIO&, const String*)
static void put (AipsIO&, const void*)

Put the value into AipsIO. The void* function is not doing anything and is for TpOther types.

static void get (AipsIO&, Bool*)
static void get (AipsIO&, Char*)
static void get (AipsIO&, uChar*)
static void get (AipsIO&, Short*)
static void get (AipsIO&, uShort*)
static void get (AipsIO&, Int*)
static void get (AipsIO&, uInt*)
static void get (AipsIO&, float*)
static void get (AipsIO&, double*)
static void get (AipsIO&, Complex*)
static void get (AipsIO&, DComplex*)
static void get (AipsIO&, String*)
static void get (AipsIO&, void*)

Get the value from AipsIO. The void* function is not doing anything and is for TpOther types.

static void put (ostream&, const Bool*)
static void put (ostream&, const Char*)
static void put (ostream&, const uChar*)
static void put (ostream&, const Short*)
static void put (ostream&, const uShort*)
static void put (ostream&, const Int*)
static void put (ostream&, const uInt*)
static void put (ostream&, const float*)
static void put (ostream&, const double*)
static void put (ostream&, const Complex*)
static void put (ostream&, const DComplex*)
static void put (ostream&, const String*)
static void put (ostream&, const void*)

Put the value into the ostream. The void* function is not doing anything and is for TpOther types.

static int isDefined (const Bool* value, const Bool* undef)
static int isDefined (const Char* value, const Char* undef)
static int isDefined (const uChar* value, const uChar* undef)
static int isDefined (const Short* value, const Short* undef)
static int isDefined (const uShort* value, const uShort* undef)
static int isDefined (const Int* value, const Int* undef)
static int isDefined (const uInt* value, const uInt* undef)
static int isDefined (const float* value, const float* undef)
static int isDefined (const double* value, const double* undef)
static int isDefined (const Complex* value, const Complex* undef)
static int isDefined (const DComplex* value, const DComplex* undef)
static int isDefined (const String* value, const String* undef)
static int isDefined (const void* value, const void* undef)

Check if a value is defined, i.e. if it mismatches the given undefined value. The void* function (for non-standard data types) always returns the value 1, since such values cannot be undefined.

ValType ()

This class is not meant to be constructed.