1TAP::Parser::Iterator(3U)ser Contributed Perl DocumentatiToAnP::Parser::Iterator(3)
2
3
4

NAME

6       TAP::Parser::Iterator - Base class for TAP source iterators
7

VERSION

9       Version 3.42
10

SYNOPSIS

12         # to subclass:
13         use TAP::Parser::Iterator ();
14         use base 'TAP::Parser::Iterator';
15         sub _initialize {
16           # see TAP::Object...
17         }
18
19         sub next_raw { ... }
20         sub wait     { ... }
21         sub exit     { ... }
22

DESCRIPTION

24       This is a simple iterator base class that defines TAP::Parser's
25       iterator API.  Iterators are typically created from
26       TAP::Parser::SourceHandlers.
27

METHODS

29   Class Methods
30       "new"
31
32       Create an iterator.  Provided by TAP::Object.
33
34   Instance Methods
35       "next"
36
37        while ( my $item = $iter->next ) { ... }
38
39       Iterate through it, of course.
40
41       "next_raw"
42
43       Note: this method is abstract and should be overridden.
44
45        while ( my $item = $iter->next_raw ) { ... }
46
47       Iterate raw input without applying any fixes for quirky input syntax.
48
49       "handle_unicode"
50
51       If necessary switch the input stream to handle unicode. This only has
52       any effect for I/O handle based streams.
53
54       The default implementation does nothing.
55
56       "get_select_handles"
57
58       Return a list of filehandles that may be used upstream in a select()
59       call to signal that this Iterator is ready. Iterators that are not
60       handle-based should return an empty list.
61
62       The default implementation does nothing.
63
64       "wait"
65
66       Note: this method is abstract and should be overridden.
67
68        my $wait_status = $iter->wait;
69
70       Return the "wait" status for this iterator.
71
72       "exit"
73
74       Note: this method is abstract and should be overridden.
75
76        my $wait_status = $iter->exit;
77
78       Return the "exit" status for this iterator.
79

SUBCLASSING

81       Please see "SUBCLASSING" in TAP::Parser for a subclassing overview.
82
83       You must override the abstract methods as noted above.
84
85   Example
86       TAP::Parser::Iterator::Array is probably the easiest example to follow.
87       There's not much point repeating it here.
88

SEE ALSO

90       TAP::Object, TAP::Parser, TAP::Parser::Iterator::Array,
91       TAP::Parser::Iterator::Stream, TAP::Parser::Iterator::Process,
92
93
94
95perl v5.32.0                      2020-07-28          TAP::Parser::Iterator(3)
Impressum