Read Logical Elements
mco_seq_next_TYPE()extracts the next logical element from an iterator:MCO_RET mco_seq_next_TYPE( mco_seq_iterator_h iterator, mco_TYPE* value );
TYPEis one of the applicable suffixes described on the C Sequence Functions page. The function returns:
MCO_S_OKand stores a value in*valuefor a non-NULL element.MCO_E_SEQ_NULL_VALUEfor a NULL element. The iterator advances, but the payload is unspecified.MCO_S_CURSOR_ENDafter the last logical element.- Another error code when evaluation of the current pipeline element fails.
With RLE sequences, typed traversal expands physical runs. The number of successful logical reads is therefore independent of the storage representation.
Reset a Pipeline
Each iterator constructor installs a reset callback appropriate for the iterator and its operand tree. Call that callback to traverse the same pipeline again:
MCO_RET rc; if (iterator.reset == NULL) rc = MCO_E_ILLEGAL_PARAM; else rc = iterator.reset(&iterator);The following public functions implement standard reset callbacks. Application code normally does not select them directly; they are useful to code that implements a custom iterator:
mco_seq_reset_iterator()Resets the local position and tile state of a source iterator.mco_seq_reset_unary_iterator()Resets a unary iterator and recursively invokes its operand's installed reset callback.mco_seq_reset_binary_iterator()Resets a binary iterator and recursively invokes both installed operand reset callbacks.Example
mco_seq_iterator_t high_iterator = { 0 }; float high; MCO_RET rc; rc = Quote_high_iterator("e, &high_iterator); while (rc == MCO_S_OK) { rc = mco_seq_next_float(&high_iterator, &high); if (rc == MCO_S_OK) printf("%g\n", (double)high); else if (rc == MCO_E_SEQ_NULL_VALUE) rc = MCO_S_OK; /* Continue after the NULL element. */ } if (rc == MCO_S_CURSOR_END) rc = MCO_S_OK;For bulk extraction, including preservation of NULL bits, see
mco_seq_get_TYPE()andmco_seq_get_nullable_TYPE()on the Sequence Manipulator C Functions page. For raw physical tile traversal, see Sequence Iterator.