NAME

Lab::Bus - Bus base class

VERSION

version 3.801

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

COPYRIGHT AND LICENSE

This software is copyright (c) 2021 by the Lab::Measurement team; in detail:

Copyright 2011-2012  Andreas K. Huettel, Florian Olbrich
          2014       Alexei Iankilevitch
          2016       Simon Reinhardt
          2017       Andreas K. Huettel
          2019       Simon Reinhardt
          2020       Andreas K. Huettel

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