1TAP::Parser::Iterator(3pPme)rl Programmers Reference GuiTdAeP::Parser::Iterator(3pm)
2
3
4
6 TAP::Parser::Iterator - Internal base class for TAP::Parser Iterators
7
9 Version 3.17
10
12 # see TAP::Parser::IteratorFactory for general usage
13
14 # to subclass:
15 use vars qw(@ISA);
16 use TAP::Parser::Iterator ();
17 @ISA = qw(TAP::Parser::Iterator);
18 sub _initialize {
19 # see TAP::Object...
20 }
21
23 This is a simple iterator base class that defines TAP::Parser's
24 iterator API. See "TAP::Parser::IteratorFactory" for the preferred way
25 of creating iterators.
26
28 Class Methods
29 "new"
30
31 Create an iterator. Provided by TAP::Object.
32
33 Instance Methods
34 "next"
35
36 while ( my $item = $iter->next ) { ... }
37
38 Iterate through it, of course.
39
40 "next_raw"
41
42 Note: this method is abstract and should be overridden.
43
44 while ( my $item = $iter->next_raw ) { ... }
45
46 Iterate raw input without applying any fixes for quirky input syntax.
47
48 "handle_unicode"
49
50 If necessary switch the input stream to handle unicode. This only has
51 any effect for I/O handle based streams.
52
53 The default implementation does nothing.
54
55 "get_select_handles"
56
57 Return a list of filehandles that may be used upstream in a select()
58 call to signal that this Iterator is ready. Iterators that are not
59 handle-based should return an empty list.
60
61 The default implementation does nothing.
62
63 "wait"
64
65 Note: this method is abstract and should be overridden.
66
67 my $wait_status = $iter->wait;
68
69 Return the "wait" status for this iterator.
70
71 "exit"
72
73 Note: this method is abstract and should be overridden.
74
75 my $wait_status = $iter->exit;
76
77 Return the "exit" status for this iterator.
78
80 Please see "SUBCLASSING" in TAP::Parser for a subclassing overview.
81
82 You must override the abstract methods as noted above.
83
84 Example
85 TAP::Parser::Iterator::Array is probably the easiest example to follow.
86 There's not much point repeating it here.
87
89 TAP::Object, TAP::Parser, TAP::Parser::IteratorFactory,
90 TAP::Parser::Iterator::Array, TAP::Parser::Iterator::Stream,
91 TAP::Parser::Iterator::Process,
92
93
94
95perl v5.12.4 2011-06-07 TAP::Parser::Iterator(3pm)