The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Template::Flute::Iterator::Cache - Iterator caching class

DESCRIPTION

This iterator is used for caching another iterator which is used multiple times in a list. We can safely use reset method on the caching iterator, but not always on the original iterator.

ATTRIBUTES

iterator

Original iterator (required).

index

Current position.

data

Cached data.

filled

Whether cache is filled or not.

METHODS

count

Returns count of (original) iterator.

next

Returns next record, either from original iterator or our cache.

reset

Resets the iterator.

AUTHOR

Stefan Hornburg (Racke), <racke@linuxia.de>

LICENSE AND COPYRIGHT

Copyright 2014-2016 Stefan Hornburg (Racke) <racke@linuxia.de>.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.