The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Lab::Bus - bus base class

SYNOPSIS

This is a base class for inheriting bus types.

DESCRIPTION

Lab::Bus is a base class for individual buses. It does not do anything on its own. For more detailed information on the use of bus objects, take a look on a child class, e.g. Lab::Bus::LinuxGPIB.

Lab::Bus::BusList contains a hash with references to all the active buses in your program. They are put there by the constructor of the individual bus Lab::Bus::new() and have two levels: Package name and a unique bus ID (GPIB board index offers itself for GPIB). This is to transparently (to the use interface) reuse bus objects, as there may only be one bus object for every (hardware) bus. weaken() is used on every reference stored in this hash, so it doesn't prevent object destruction when the last "real" reference is lost. Yes, this breaks object orientation a little, but it comes so handy!

  our %Lab::Bus::BusList = [
        $Package => {
                $UniqueID => $Object,
        }
        'Lab::Bus::GPIB' => {
                '0' => $Object,         "0" is the gpib board index
        }

Place your twin searching code in $self-_search_twin()>. Make sure it evaluates $self-IgnoreTwin()>. Look at Lab::Bus::LinuxGPIB.

CONSTRUCTOR

new

Generally called in child class constructor:

 my $self = $class->SUPER::new(@_);

Return blessed $self, with @_ accessible through $self->Config().

METHODS

config

Provides unified access to the fields in initial @_ to all the child classes.

connection_new

Empty stub function for overloading

connection_read

Empty stub function for overloading

connection_write

Empty stub function for overloading

CAVEATS/BUGS

Probably few. Mostly because there's not so much done here.

SEE ALSO

AUTHOR/COPYRIGHT

 Copyright 2004-2006 Daniel Schröer <schroeer@cpan.org>, 
           2009-2010 Daniel Schröer, Andreas K. Hüttel (L<http://www.akhuettel.de/>) and David Kalok,
           2010      Matthias Völker <mvoelker@cpan.org>
           2011      Florian Olbrich, Andreas K. Hüttel
           2012      Andreas K. Hüttel

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