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