NAME
Iterator::Flex::Stack - An iterator which concatenates a set of iterators
VERSION
version 0.28
METHODS
new
$iterator = Iterator::Flex::Stack->new( @iterables, ..., ?\%pars );
Returns an iterator which manages a stack of iterators. The iterator supports the pop, push, shift, unshift methods, which have the same API as the Perl builtin subroutines.
If the stack iterator is exhausted, pushing (or unshifting) a new iterator onto it will reset the state to the Iteration state. The current
and prev
methods will return The next "next" operation will retrieve the first element from the data stream,
It also provides a snapshot method, which records the iterators in the stack. This snapshot is used when the rewind
or reset
methods are called. An initial snapshot is taken when the iterator is first constructed.
The iterator returns the next value from the iterator at the top of the stack. Iterators are popped when they are exhausted.
The iterables are converted into iterators via "to_iterator" in Iterator::Flex::Factory if required.
The optional %pars
hash may contain standard signal parameters.
The iterator supports the following capabilities:
- current
- next
Because the nature of the iterators on the stack may vary, the reset
and rewind
methods may throw at runtime if an iterator on the stack does not support the required facilities.
INTERNALS
SUPPORT
Bugs
Please report any bugs or feature requests to bug-iterator-flex@rt.cpan.org or through the web interface at: https://rt.cpan.org/Public/Dist/Display.html?Name=Iterator-Flex
Source
Source is available at
https://gitlab.com/djerius/iterator-flex
and may be cloned from
https://gitlab.com/djerius/iterator-flex.git
SEE ALSO
Please see those modules/websites for more information related to this module.
AUTHOR
Diab Jerius <djerius@cpan.org>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2018 by Smithsonian Astrophysical Observatory.
This is free software, licensed under:
The GNU General Public License, Version 3, June 2007