| 1 | package Iterator::Flex::Role::Rewind::Closure; | ||
| 2 | |||
| 3 | # ABSTRACT: Implement rewind as a closure stored in the registry | ||
| 4 | |||
| 5 | 41 | ▶ | use v5.28; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 41 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 41 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 41 | our $VERSION = '0.33'; | |
| 10 | |||
| 11 | 41 | ▶ | use Iterator::Flex::Base (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 41 | ▶ | use Iterator::Flex::Utils qw( :default REG_ITERATOR REG_ITER_REWIND ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | 41 | ▶ | use Role::Tiny; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | 41 | ▶ | use experimental 'signatures'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | |||
| 16 | 41 | ▶ | use namespace::clean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | |||
| 18 | |||
| 19 | |||
| 20 | |||
| 21 | |||
| 22 | |||
| 23 | |||
| 24 | |||
| 25 | |||
| 26 | |||
| 27 | |||
| 28 | ▶ | sub rewind ( $self ) { | |
|
Subroutine
rewind: called CC=1 SCAR=0.0
Pod
documented
| |||
| 29 | |||
| 30 | 89 | $self->_apply_method_to_depends( 'rewind' ); | |
| 31 | |||
| 32 | 89 | $REGISTRY{ refaddr $self }[REG_ITERATOR][REG_ITER_REWIND]->( $self ); | |
| 33 | 89 | $self->_clear_state; | |
| 34 | |||
| 35 | 89 | return; | |
| 36 | } | ||
| 37 | 41 | *__rewind__ = \&rewind; | |
| 38 | |||
| 39 | |||
| 40 | 41 | requires '_clear_state'; | |
| 41 | |||
| 42 | 41 | 1; | |
| 43 | |||
| 44 | # | ||
| 45 | # This file is part of Iterator-Flex | ||
| 46 | # | ||
| 47 | # This software is Copyright (c) 2018 by Smithsonian Astrophysical Observatory. | ||
| 48 | # | ||
| 49 | # This is free software, licensed under: | ||
| 50 | # | ||
| 51 | # The GNU General Public License, Version 3, June 2007 | ||
| 52 | # | ||
| 53 | |||
| 54 | __END__ | ||