RLE运算
运行长度加密 (RLE)C++ 序列方法(除了 rleDecode()
)接受一个输入参数,并生成相应结果序列或标量类型。
以下是可用的方法:
rleCount
mco_seq_rle_count_t rleCount(int pos) const
返回当前磁贴中处于位置 pos
的迭代器的重复项的数量。对于常规的非 RLE 序列始终返回 1 。
rleDecode
Sequence<T> rleDecode() const
将一个游程编码序列转换为一个普通序列。
示例
以下是展示 RLE 函数的示例代码片段:
{
mco_trans_h trans;
mco_cursor_t quote_cursor;
Quote quote;
mco_seq_iterator_t rle_high_iterator, normal_high_iterator;
MCO_RET rc;
...
for (rc = mco_cursor_first(trans, "e_cursor);
rc != MCO_S_CURSOR_END;
rc = mco_cursor_next(trans, "e_cursor))
{
Quote_from_cursor(trans, "e_cursor, "e);
Quote_high_iterator("e, &rle_high_iterator);
normal_high_iterator = rle_high_iterator.rleDecode();
...
}
...
}