next up previous contents
Next: Tests and Accessors Up: Bank Types Previous: Bank Types

Initialization

Typically one initializes an instance of TRY_Bank_Type with a string containing the type description

TRY_Bank_Type my_bank_type("(23I4,46R4)") ;

In some cases, one will simply pass the bank type as an argument to a function without bothering to store it explicitly in a named variable, such as

a_method( TRY_Bank_Type("(23I4,46R4)") , ...) ;

In addition to this approach, one can initialize an instance of a bank type in several ways using integers. For example, to create a type description for a bank containing int4s occupying 23 integers of space,

TRY_Bank_Type  a_mono_type(23, TRY_Ybos_Field_Format::type_id_I4) ;

where the individual type identifier codes are defined in the file TRY_YBOS_Field_Format.hh.

One must use the default constructor in some cases, such as when declaring a built-in array of bank types. Then the assign() method can be used to set the otherwise invalid bank type object to a valid value, such as

TRY_Bank_Type my_bank_type ;         // Default constructor puts it in invalid state
my_bank_type.assign("(23I4,46R4)") ; // Now valid



Robert Kennedy
Mon Jul 28 13:23:28 CDT 1997