Boost logo

Boost :

Subject: Re: [boost] [gil::io] Feedback for scanline_read_iterator
From: Christian Henning (chhenning_at_[hidden])
Date: 2013-02-18 15:46:23


Hi Phil,

> I don't follow; what two functionalities?

1) read scanline
2) skip scanline

>
> I imagine your line-by-line reading iterator would look something like
> (PSEUDO-CODE!!!):
>
>
> class line_by_line_iterator {
> buffer_t& buffer;
>
> public:
> const buffer_t& operator*() const { return buffer; }
> void operator++() { format_specific_read_one_line_into(buffer); }
> };
>
>
> I'd do it using iterator_facade.
>
> A case that this fails to manage efficiently is when your format-specific
> implementation has an efficient way to skip forward without actually
> decoding. This is not something that I've ever had to worry about, but I
> think you could do it easily enough by adding a flag and doing the read
> lazily in operator*.

you mean pass a boolean into operator*?

Thanks,
Christian


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk