casa::ValType Class Reference
[Utilities]

#include <ValType.h>

Collaboration diagram for casa::ValType:

Collaboration graph
[legend]
List of all members.

Detailed Description

Data types and their undefined values.

Intended use:

Part of API

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.

Definition at line 77 of file ValType.h.

Static Public Member Functions

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.
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.
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 Bool undefBool ()
 Get the "undefined value" for this data type as the function's return value.
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 *)
 Get the "undefined value" for this data type in the argument.
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 *)
 Get the data type code for this type as the function's return value.
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 StringgetTypeStr (DataType)
 Get the name of the data type.
static const StringgetTypeStr (const Bool *)
static const StringgetTypeStr (const Char *)
static const StringgetTypeStr (const uChar *)
static const StringgetTypeStr (const Short *)
static const StringgetTypeStr (const uShort *)
static const StringgetTypeStr (const Int *)
static const StringgetTypeStr (const uInt *)
static const StringgetTypeStr (const float *)
static const StringgetTypeStr (const double *)
static const StringgetTypeStr (const Complex *)
static const StringgetTypeStr (const DComplex *)
static const StringgetTypeStr (const String *)
static const StringgetTypeStr (const TableRecord *)
static const StringgetTypeStr (const void *)
static void put (AipsIO &, const Bool *)
 Put the value into AipsIO.
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 *)
 Get the value from AipsIO.
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 *)
 Put the value into the ostream.
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)
 Check if a value is defined, i.e.
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 Member Functions

 ValType ()
 This class is not meant to be constructed.

Static Private Attributes

static const Bool undefbool
static const Char undefchar
static const uChar undefuchar
static const Short undefshort
static const uShort undefushort
static const Int undefint
static const uInt undefuint
static const float undeffloat
static const double undefdouble
static const Complex undefcomplex
static const DComplex undefdcomplex
static const String undefstring
static const String strbool
static const String strchar
static const String struchar
static const String strshort
static const String strushort
static const String strint
static const String struint
static const String strfloat
static const String strdouble
static const String strcomplex
static const String strdcomplex
static const String strstring
static const String strrecord
static const String strtable
static const String strother
static const String strunknown


Constructor & Destructor Documentation

casa::ValType::ValType (  )  [private]

This class is not meant to be constructed.


Member Function Documentation

Bool casa::ValType::undefBool (  )  [inline, static]

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

Definition at line 296 of file ValType.h.

References undefbool.

Char casa::ValType::undefChar (  )  [inline, static]

Definition at line 298 of file ValType.h.

References undefchar.

uChar casa::ValType::undefUChar (  )  [inline, static]

Definition at line 300 of file ValType.h.

References undefuchar.

Short casa::ValType::undefShort (  )  [inline, static]

Definition at line 302 of file ValType.h.

References undefshort.

uShort casa::ValType::undefUShort (  )  [inline, static]

Definition at line 304 of file ValType.h.

References undefushort.

Int casa::ValType::undefInt (  )  [inline, static]

Definition at line 306 of file ValType.h.

References undefint.

uInt casa::ValType::undefUInt (  )  [inline, static]

Definition at line 308 of file ValType.h.

References undefuint.

float casa::ValType::undefFloat (  )  [inline, static]

Definition at line 310 of file ValType.h.

References undeffloat.

double casa::ValType::undefDouble (  )  [inline, static]

Definition at line 312 of file ValType.h.

References undefdouble.

Complex casa::ValType::undefComplex (  )  [inline, static]

Definition at line 314 of file ValType.h.

References undefcomplex.

DComplex casa::ValType::undefDComplex (  )  [inline, static]

Definition at line 316 of file ValType.h.

References undefdcomplex.

String casa::ValType::undefString (  )  [inline, static]

Definition at line 318 of file ValType.h.

References undefstring.

void casa::ValType::getUndef ( Bool  )  [inline, static]

Get the "undefined value" for this data type in the argument.

The void* function is not doing anything and is for TpOther types.

Definition at line 322 of file ValType.h.

References undefbool.

void casa::ValType::getUndef ( Char  )  [inline, static]

Definition at line 324 of file ValType.h.

References undefchar.

void casa::ValType::getUndef ( uChar  )  [inline, static]

Definition at line 326 of file ValType.h.

References undefuchar.

void casa::ValType::getUndef ( Short  )  [inline, static]

Definition at line 328 of file ValType.h.

References undefshort.

void casa::ValType::getUndef ( uShort  )  [inline, static]

Definition at line 330 of file ValType.h.

References undefushort.

void casa::ValType::getUndef ( Int  )  [inline, static]

Definition at line 332 of file ValType.h.

References undefint.

void casa::ValType::getUndef ( uInt  )  [inline, static]

Definition at line 334 of file ValType.h.

References undefuint.

void casa::ValType::getUndef ( float *   )  [inline, static]

Definition at line 336 of file ValType.h.

References undeffloat.

void casa::ValType::getUndef ( double *   )  [inline, static]

Definition at line 338 of file ValType.h.

References undefdouble.

void casa::ValType::getUndef ( Complex *   )  [inline, static]

Definition at line 340 of file ValType.h.

References undefcomplex.

void casa::ValType::getUndef ( DComplex *   )  [inline, static]

Definition at line 342 of file ValType.h.

References undefdcomplex.

void casa::ValType::getUndef ( String  )  [inline, static]

Definition at line 344 of file ValType.h.

References undefstring.

void casa::ValType::getUndef ( void *   )  [inline, static]

Definition at line 346 of file ValType.h.

DataType casa::ValType::getType ( const Bool  )  [inline, static]

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

Definition at line 349 of file ValType.h.

DataType casa::ValType::getType ( const Char  )  [inline, static]

Definition at line 351 of file ValType.h.

DataType casa::ValType::getType ( const uChar  )  [inline, static]

Definition at line 353 of file ValType.h.

DataType casa::ValType::getType ( const Short  )  [inline, static]

Definition at line 355 of file ValType.h.

DataType casa::ValType::getType ( const uShort  )  [inline, static]

Definition at line 357 of file ValType.h.

DataType casa::ValType::getType ( const Int  )  [inline, static]

Definition at line 359 of file ValType.h.

DataType casa::ValType::getType ( const uInt  )  [inline, static]

Definition at line 361 of file ValType.h.

DataType casa::ValType::getType ( const float *   )  [inline, static]

Definition at line 363 of file ValType.h.

DataType casa::ValType::getType ( const double *   )  [inline, static]

Definition at line 365 of file ValType.h.

DataType casa::ValType::getType ( const Complex *   )  [inline, static]

Definition at line 367 of file ValType.h.

DataType casa::ValType::getType ( const DComplex *   )  [inline, static]

Definition at line 369 of file ValType.h.

DataType casa::ValType::getType ( const String  )  [inline, static]

Definition at line 371 of file ValType.h.

DataType casa::ValType::getType ( const TableRecord  )  [inline, static]

Definition at line 373 of file ValType.h.

DataType casa::ValType::getType ( const void *   )  [inline, static]

Definition at line 375 of file ValType.h.

static const String& casa::ValType::getTypeStr ( DataType   )  [static]

Get the name of the data type.

The void* returns the string "Other ".

Referenced by casa::ValTypeId_global_functions_typeid::valDataTypeId().

const String & casa::ValType::getTypeStr ( const Bool  )  [inline, static]

Definition at line 378 of file ValType.h.

References strbool.

const String & casa::ValType::getTypeStr ( const Char  )  [inline, static]

Definition at line 380 of file ValType.h.

References strchar.

const String & casa::ValType::getTypeStr ( const uChar  )  [inline, static]

Definition at line 382 of file ValType.h.

References struchar.

const String & casa::ValType::getTypeStr ( const Short  )  [inline, static]

Definition at line 384 of file ValType.h.

References strshort.

const String & casa::ValType::getTypeStr ( const uShort  )  [inline, static]

Definition at line 386 of file ValType.h.

References strushort.

const String & casa::ValType::getTypeStr ( const Int  )  [inline, static]

Definition at line 388 of file ValType.h.

References strint.

const String & casa::ValType::getTypeStr ( const uInt  )  [inline, static]

Definition at line 390 of file ValType.h.

References struint.

const String & casa::ValType::getTypeStr ( const float *   )  [inline, static]

Definition at line 392 of file ValType.h.

References strfloat.

const String & casa::ValType::getTypeStr ( const double *   )  [inline, static]

Definition at line 394 of file ValType.h.

References strdouble.

const String & casa::ValType::getTypeStr ( const Complex *   )  [inline, static]

Definition at line 396 of file ValType.h.

References strcomplex.

const String & casa::ValType::getTypeStr ( const DComplex *   )  [inline, static]

Definition at line 398 of file ValType.h.

References strdcomplex.

const String & casa::ValType::getTypeStr ( const String  )  [inline, static]

Definition at line 400 of file ValType.h.

References strstring.

const String & casa::ValType::getTypeStr ( const TableRecord  )  [inline, static]

Definition at line 402 of file ValType.h.

References strrecord.

const String & casa::ValType::getTypeStr ( const void *   )  [inline, static]

Definition at line 404 of file ValType.h.

References strother.

static int casa::ValType::getTypeSize ( DataType   )  [static]

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

static int casa::ValType::getCanonicalSize ( DataType  ,
Bool  BECanonical = True 
) [static]

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 casa::ValType::getCanonicalFunc ( DataType  dt,
Conversion::ValueFunction *&  readFunc,
Conversion::ValueFunction *&  writeFunc,
uInt nrElementsPerValue,
Bool  BECanonical = True 
) [static]

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 casa::ValType::isPromotable ( DataType  from,
DataType  to 
) [static]

Test if a data type can be promoted to another.

static ObjCompareFunc* casa::ValType::getCmpFunc ( DataType   )  [static]

Get the pointer to the routine which compares two values.

void casa::ValType::put ( AipsIO ,
const Bool  
) [inline, static]

Put the value into AipsIO.

The void* function is not doing anything and is for TpOther types.

Definition at line 407 of file ValType.h.

void casa::ValType::put ( AipsIO ,
const Char  
) [inline, static]

Definition at line 409 of file ValType.h.

void casa::ValType::put ( AipsIO ,
const uChar  
) [inline, static]

Definition at line 411 of file ValType.h.

void casa::ValType::put ( AipsIO ,
const Short  
) [inline, static]

Definition at line 413 of file ValType.h.

void casa::ValType::put ( AipsIO ,
const uShort  
) [inline, static]

Definition at line 415 of file ValType.h.

void casa::ValType::put ( AipsIO ,
const Int  
) [inline, static]

Definition at line 417 of file ValType.h.

void casa::ValType::put ( AipsIO ,
const uInt  
) [inline, static]

Definition at line 419 of file ValType.h.

void casa::ValType::put ( AipsIO ,
const float *   
) [inline, static]

Definition at line 421 of file ValType.h.

void casa::ValType::put ( AipsIO ,
const double *   
) [inline, static]

Definition at line 423 of file ValType.h.

void casa::ValType::put ( AipsIO ,
const Complex *   
) [inline, static]

Definition at line 425 of file ValType.h.

void casa::ValType::put ( AipsIO ,
const DComplex *   
) [inline, static]

Definition at line 427 of file ValType.h.

void casa::ValType::put ( AipsIO ,
const String  
) [inline, static]

Definition at line 429 of file ValType.h.

References casa::value().

void casa::ValType::put ( AipsIO ,
const void *   
) [inline, static]

Definition at line 431 of file ValType.h.

void casa::ValType::get ( AipsIO ,
Bool  
) [inline, static]

Get the value from AipsIO.

The void* function is not doing anything and is for TpOther types.

Definition at line 434 of file ValType.h.

void casa::ValType::get ( AipsIO ,
Char  
) [inline, static]

Definition at line 436 of file ValType.h.

void casa::ValType::get ( AipsIO ,
uChar  
) [inline, static]

Definition at line 438 of file ValType.h.

void casa::ValType::get ( AipsIO ,
Short  
) [inline, static]

Definition at line 440 of file ValType.h.

void casa::ValType::get ( AipsIO ,
uShort  
) [inline, static]

Definition at line 442 of file ValType.h.

void casa::ValType::get ( AipsIO ,
Int  
) [inline, static]

Definition at line 444 of file ValType.h.

void casa::ValType::get ( AipsIO ,
uInt  
) [inline, static]

Definition at line 446 of file ValType.h.

void casa::ValType::get ( AipsIO ,
float *   
) [inline, static]

Definition at line 448 of file ValType.h.

void casa::ValType::get ( AipsIO ,
double *   
) [inline, static]

Definition at line 450 of file ValType.h.

void casa::ValType::get ( AipsIO ,
Complex *   
) [inline, static]

Definition at line 452 of file ValType.h.

void casa::ValType::get ( AipsIO ,
DComplex *   
) [inline, static]

Definition at line 454 of file ValType.h.

void casa::ValType::get ( AipsIO ,
String  
) [inline, static]

Definition at line 456 of file ValType.h.

References casa::value().

void casa::ValType::get ( AipsIO ,
void *   
) [inline, static]

Definition at line 458 of file ValType.h.

void casa::ValType::put ( ostream &  ,
const Bool  
) [inline, static]

Put the value into the ostream.

The void* function is not doing anything and is for TpOther types.

Definition at line 461 of file ValType.h.

void casa::ValType::put ( ostream &  ,
const Char  
) [inline, static]

Definition at line 463 of file ValType.h.

void casa::ValType::put ( ostream &  ,
const uChar  
) [inline, static]

Definition at line 465 of file ValType.h.

void casa::ValType::put ( ostream &  ,
const Short  
) [inline, static]

Definition at line 467 of file ValType.h.

void casa::ValType::put ( ostream &  ,
const uShort  
) [inline, static]

Definition at line 469 of file ValType.h.

void casa::ValType::put ( ostream &  ,
const Int  
) [inline, static]

Definition at line 471 of file ValType.h.

void casa::ValType::put ( ostream &  ,
const uInt  
) [inline, static]

Definition at line 473 of file ValType.h.

void casa::ValType::put ( ostream &  ,
const float *   
) [inline, static]

Definition at line 475 of file ValType.h.

void casa::ValType::put ( ostream &  ,
const double *   
) [inline, static]

Definition at line 477 of file ValType.h.

void casa::ValType::put ( ostream &  ,
const Complex *   
) [inline, static]

Definition at line 479 of file ValType.h.

void casa::ValType::put ( ostream &  ,
const DComplex *   
) [inline, static]

Definition at line 481 of file ValType.h.

void casa::ValType::put ( ostream &  ,
const String  
) [inline, static]

Definition at line 483 of file ValType.h.

References casa::value().

void casa::ValType::put ( ostream &  ,
const void *   
) [inline, static]

Definition at line 485 of file ValType.h.

int casa::ValType::isDefined ( const Bool value,
const Bool undef 
) [inline, static]

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.

Definition at line 489 of file ValType.h.

int casa::ValType::isDefined ( const Char value,
const Char undef 
) [inline, static]

Definition at line 491 of file ValType.h.

int casa::ValType::isDefined ( const uChar value,
const uChar undef 
) [inline, static]

Definition at line 493 of file ValType.h.

int casa::ValType::isDefined ( const Short value,
const Short undef 
) [inline, static]

Definition at line 495 of file ValType.h.

int casa::ValType::isDefined ( const uShort value,
const uShort undef 
) [inline, static]

Definition at line 497 of file ValType.h.

int casa::ValType::isDefined ( const Int value,
const Int undef 
) [inline, static]

Definition at line 499 of file ValType.h.

int casa::ValType::isDefined ( const uInt value,
const uInt undef 
) [inline, static]

Definition at line 501 of file ValType.h.

int casa::ValType::isDefined ( const float *  value,
const float *  undef 
) [inline, static]

Definition at line 503 of file ValType.h.

int casa::ValType::isDefined ( const double *  value,
const double *  undef 
) [inline, static]

Definition at line 505 of file ValType.h.

int casa::ValType::isDefined ( const Complex *  value,
const Complex *  undef 
) [inline, static]

Definition at line 507 of file ValType.h.

int casa::ValType::isDefined ( const DComplex *  value,
const DComplex *  undef 
) [inline, static]

Definition at line 509 of file ValType.h.

int casa::ValType::isDefined ( const String value,
const String undef 
) [inline, static]

Definition at line 511 of file ValType.h.

References casa::value().

int casa::ValType::isDefined ( const void *  value,
const void *  undef 
) [inline, static]

Definition at line 513 of file ValType.h.


Member Data Documentation

const Bool casa::ValType::undefbool [static, private]

Definition at line 259 of file ValType.h.

Referenced by getUndef(), and undefBool().

const Char casa::ValType::undefchar [static, private]

Definition at line 260 of file ValType.h.

Referenced by getUndef(), and undefChar().

const uChar casa::ValType::undefuchar [static, private]

Definition at line 261 of file ValType.h.

Referenced by getUndef(), and undefUChar().

const Short casa::ValType::undefshort [static, private]

Definition at line 262 of file ValType.h.

Referenced by getUndef(), and undefShort().

const uShort casa::ValType::undefushort [static, private]

Definition at line 263 of file ValType.h.

Referenced by getUndef(), and undefUShort().

const Int casa::ValType::undefint [static, private]

Definition at line 264 of file ValType.h.

Referenced by getUndef(), and undefInt().

const uInt casa::ValType::undefuint [static, private]

Definition at line 265 of file ValType.h.

Referenced by getUndef(), and undefUInt().

const float casa::ValType::undeffloat [static, private]

Definition at line 266 of file ValType.h.

Referenced by getUndef(), and undefFloat().

const double casa::ValType::undefdouble [static, private]

Definition at line 267 of file ValType.h.

Referenced by getUndef(), and undefDouble().

const Complex casa::ValType::undefcomplex [static, private]

Definition at line 268 of file ValType.h.

Referenced by getUndef(), and undefComplex().

const DComplex casa::ValType::undefdcomplex [static, private]

Definition at line 269 of file ValType.h.

Referenced by getUndef(), and undefDComplex().

const String casa::ValType::undefstring [static, private]

Definition at line 270 of file ValType.h.

Referenced by getUndef(), and undefString().

const String casa::ValType::strbool [static, private]

Definition at line 272 of file ValType.h.

Referenced by getTypeStr().

const String casa::ValType::strchar [static, private]

Definition at line 273 of file ValType.h.

Referenced by getTypeStr().

const String casa::ValType::struchar [static, private]

Definition at line 274 of file ValType.h.

Referenced by getTypeStr().

const String casa::ValType::strshort [static, private]

Definition at line 275 of file ValType.h.

Referenced by getTypeStr().

const String casa::ValType::strushort [static, private]

Definition at line 276 of file ValType.h.

Referenced by getTypeStr().

const String casa::ValType::strint [static, private]

Definition at line 277 of file ValType.h.

Referenced by getTypeStr().

const String casa::ValType::struint [static, private]

Definition at line 278 of file ValType.h.

Referenced by getTypeStr().

const String casa::ValType::strfloat [static, private]

Definition at line 279 of file ValType.h.

Referenced by getTypeStr().

const String casa::ValType::strdouble [static, private]

Definition at line 280 of file ValType.h.

Referenced by getTypeStr().

const String casa::ValType::strcomplex [static, private]

Definition at line 281 of file ValType.h.

Referenced by getTypeStr().

const String casa::ValType::strdcomplex [static, private]

Definition at line 282 of file ValType.h.

Referenced by getTypeStr().

const String casa::ValType::strstring [static, private]

Definition at line 283 of file ValType.h.

Referenced by getTypeStr().

const String casa::ValType::strrecord [static, private]

Definition at line 284 of file ValType.h.

Referenced by getTypeStr().

const String casa::ValType::strtable [static, private]

Definition at line 285 of file ValType.h.

const String casa::ValType::strother [static, private]

Definition at line 286 of file ValType.h.

Referenced by getTypeStr().

const String casa::ValType::strunknown [static, private]

Definition at line 287 of file ValType.h.


The documentation for this class was generated from the following file:
Generated on Mon Sep 1 22:44:30 2008 for NRAOCASA by  doxygen 1.5.1