Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

tap::parser::iteratorfactory(3pm) [suse man page]

TAP::Parser::IteratorFactory(3pm)			 Perl Programmers Reference Guide			 TAP::Parser::IteratorFactory(3pm)

NAME
TAP::Parser::IteratorFactory - Internal TAP::Parser Iterator VERSION
Version 3.17 SYNOPSIS
use TAP::Parser::IteratorFactory; my $factory = TAP::Parser::IteratorFactory->new; my $iter = $factory->make_iterator(*TEST); my $iter = $factory->make_iterator(@array); my $iter = $factory->make_iterator(\%hash); my $line = $iter->next; DESCRIPTION
This is a factory class for simple iterator wrappers for arrays, filehandles, and hashes. Unless you're subclassing, you probably won't need to use this module directly. METHODS
Class Methods "new" Creates a new factory class. Note: You currently don't need to instantiate a factory in order to use it. "make_iterator" Create an iterator. The type of iterator created depends on the arguments to the constructor: my $iter = TAP::Parser::Iterator->make_iterator( $filehandle ); Creates a stream iterator (see "make_stream_iterator"). my $iter = TAP::Parser::Iterator->make_iterator( $array_reference ); Creates an array iterator (see "make_array_iterator"). my $iter = TAP::Parser::Iterator->make_iterator( $hash_reference ); Creates a process iterator (see "make_process_iterator"). "make_stream_iterator" Make a new stream iterator and return it. Passes through any arguments given. Defaults to a TAP::Parser::Iterator::Stream. "make_array_iterator" Make a new array iterator and return it. Passes through any arguments given. Defaults to a TAP::Parser::Iterator::Array. "make_process_iterator" Make a new process iterator and return it. Passes through any arguments given. Defaults to a TAP::Parser::Iterator::Process. SUBCLASSING
Please see "SUBCLASSING" in TAP::Parser for a subclassing overview. There are a few things to bear in mind when creating your own "ResultFactory": 1. The factory itself is never instantiated (this may change in the future). This means that "_initialize" is never called. Example package MyIteratorFactory; use strict; use vars '@ISA'; use MyStreamIterator; use TAP::Parser::IteratorFactory; @ISA = qw( TAP::Parser::IteratorFactory ); # override stream iterator sub make_stream_iterator { my $proto = shift; MyStreamIterator->new(@_); } 1; ATTRIBUTION
Originally ripped off from Test::Harness. SEE ALSO
TAP::Object, TAP::Parser, TAP::Parser::Iterator, TAP::Parser::Iterator::Array, TAP::Parser::Iterator::Stream, TAP::Parser::Iterator::Process, perl v5.12.1 2010-04-26 TAP::Parser::IteratorFactory(3pm)

Check Out this Related Man Page

TAP::Parser::SourceHandler::Handle(3pm) 		 Perl Programmers Reference Guide		   TAP::Parser::SourceHandler::Handle(3pm)

NAME
TAP::Parser::SourceHandler::Handle - Stream TAP from an IO::Handle or a GLOB. VERSION
Version 3.26 SYNOPSIS
use TAP::Parser::Source; use TAP::Parser::SourceHandler::Executable; my $source = TAP::Parser::Source->new->raw( *TAP_FILE ); $source->assemble_meta; my $class = 'TAP::Parser::SourceHandler::Handle'; my $vote = $class->can_handle( $source ); my $iter = $class->make_iterator( $source ); DESCRIPTION
This is a raw TAP stored in an IO Handle TAP::Parser::SourceHandler class. It has 2 jobs: 1. Figure out if the TAP::Parser::Source it's given is an IO::Handle or GLOB containing raw TAP output ("can_handle"). 2. Creates an iterator for IO::Handle's & globs ("make_iterator"). Unless you're writing a plugin or subclassing TAP::Parser, you probably won't need to use this module directly. METHODS
Class Methods "can_handle" my $vote = $class->can_handle( $source ); Casts the following votes: 0.9 if $source is an IO::Handle 0.8 if $source is a glob "make_iterator" my $iterator = $class->make_iterator( $source ); Returns a new TAP::Parser::Iterator::Stream for the source. "iterator_class" The class of iterator to use, override if you're sub-classing. Defaults to TAP::Parser::Iterator::Stream. SUBCLASSING
Please see "SUBCLASSING" in TAP::Parser for a subclassing overview. SEE ALSO
TAP::Object, TAP::Parser, TAP::Parser::Iterator, TAP::Parser::Iterator::Stream, TAP::Parser::IteratorFactory, TAP::Parser::SourceHandler, TAP::Parser::SourceHandler::Executable, TAP::Parser::SourceHandler::Perl, TAP::Parser::SourceHandler::File, TAP::Parser::SourceHandler::RawTAP perl v5.18.2 2014-01-06 TAP::Parser::SourceHandler::Handle(3pm)
Man Page