next up previous contents
Next: Tests and Accessors Up: Record Iterators Previous: Record Iterators

Initialization

Both TRY_Record_Iter_Any objects and TRY_Record_Iter_Same objects always require a pointer to a record as an initialization argument.

Typically one initializes a TRY_Record_Iter_Any object with the just a pointer to a record or a pointer to a record and a bank key to match. TRY_Record_Iter_Same objects are typically initialized with a pointer to a record and a text string indicating the name of banks to consider matching. This is shorthand for matching the first instance of the bank name irregardless of the bank number. One can use another iterator for initialization, even an iterator of the other iterator class.

TRY_Abstract_Record *p_record ;    // argument given to Framework event module

TRY_Record_Iter_Any  iter_any1(p_record) ;     // points to first bank, if any
TRY_Record_Iter_Any  iter_any2(p_record,
                     TRY_Bank_Key("CMUO",5)) ;     // points to key match

TRY_Record_Iter_Same iter_same(p_record, "CMUO") ; // points to first CMUO bank

TRY_Record_Iter_Any  iter_any3( iter_any2) ;       // use same class for init
TRY_Record_Iter_Same iter_same2(iter_any2) ;       // use other class for init



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