classname_fieldname_join

Looks up values from an input iterator in an ordered field and produces their logical positions.

Prototype

    MCO_RET classname_fieldname_join(
        classname *handle,
        mco_seq_iterator_h result,
        mco_seq_iterator_h join_with);

Behavior

The function is generated only for ordered sequence fields. join_with must yield the same element type as the field. For each input element, result yields one mco_uint8 logical position of the matching value in the field. If duplicate field values exist, lookup uses the first matching position in field order.

The operation is lazy and consumes join_with as result is traversed. Keep the input iterator, object handle, and transaction valid. If an input value is absent, traversal returns MCO_S_NOTFOUND.

Example

    mco_uint4 keys[2] = { 20, 40 };
    mco_seq_iterator_t key_iterator;
    mco_seq_iterator_t positions;
    MCO_RET rc;

    rc = mco_seq_unget_uint4(&key_iterator, keys, 2);
    if (rc == MCO_S_OK) {
        rc = Sensor_timestamps_join(
            &sensor, &positions, &key_iterator);
    }

Traverse positions with mco_seq_next_uint8(). With binding checks enabled, reusing an already bound operand can return MCO_E_SEQ_BOUNDED.