NAME

Bio::Tools::StateMachine::IOStateMachine - IO-based implementation of AbstractStateMachine

SYNOPSIS

    use Bio::Tools::IOStateMachine;

    # A state machine that reads input from a file
    my $sm = Bio::Tools::IOStateMachine->new( -file => 'data.txt' );

    # A state machine that reads input from a STDIN
    my $sm = Bio::Tools::IOStateMachine->new();

    # A state machine that reads input from a STDIN
    # and times out if input doesn't arrive within 30 seconds.
    my $sm = Bio::Tools::IOStateMachine->new( -timeout_sec => 30 );

DESCRIPTION

An implementation of AbstractStateMachine that samples an input stream to determine whether a state change has occurred.

EXAMPLES

To get a feel for how to use this, have look at Bio::SearchIO::psiblast which subclasses IOStateMachine.

FEEDBACK

Mailing Lists

User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated.

    bioperl-l@bioperl.org              - General discussion
    http://bio.perl.org/MailList.html  - About the mailing lists

Reporting Bugs

Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via email or the web:

    bioperl-bugs@bio.perl.org                   
    http://bio.perl.org/bioperl-bugs/           

AUTHOR

Steve Chervitz, <sac@bioperl.org>

See the FEEDBACK section for where to send bug reports and comments.

COPYRIGHT

Copyright (c) 2001 Steve Chervitz. All Rights Reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

DISCLAIMER

This software is provided "as is" without warranty of any kind.

APPENDIX

The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _

_init_state_machine()

 Argument : Named parameter -TIMEOUT_SEC => seconds,
            to specify the number of seconds to allow before throwing
            an exception if input fails to arrive within that amount of time. 

check_for_new_state()

 Purpose  : Obtains data from the input stream to be checked 
            for the existence of a new state.
 Usage    : check_for_new_state( [$ignore_blank_lines] );
 Argument : boolean: true if you want to ignore blank lines
 Returns  : the next chunk of input ($/ is not altered)
            If there is no more input, returns undef.

Subclasses should override this method and call it to obtain the chunk of data for new state testing.

next_input_chunk()

 Argument : n/a
 Returns  : The next chunk of input data from the IO stream
            To be used in determining what state the machine should be in.