2 # This module is part of the new structure of the cluster
4 # What happens when a sentence comes in is that it is sanity
5 # checked and then is converted into a Thingy. This Thingy is what
6 # is the passed around the system.
8 # Copyright (c) 2001 Dirk Koopman G1TLH
19 use vars qw($VERSION $BRANCH %valid);
20 $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
21 $BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0));
22 $main::build += $VERSION;
23 $main::branch += $BRANCH;
26 tonode => '0,To Node',
27 fromnode => '0,From Node',
28 fromchan => '0,DXChannel Ref',
29 pcline => '0,Original PC Line',
30 qxline => '0,Original QX Line',
36 my @pkg = split /::/, ref shift;
39 # iterate down the packages looking for a 'valid'
42 my $n = join('::'. @pkg, 'valid');
44 return $r if defined $r;
53 my $self = bless {}, $pkg;
54 while (my ($k, $v) = each %{\@_}) {
55 confess "Non-existant field '$k'" unless $self->_valid($k);
66 return if $name =~ /::DESTROY$/;
69 confess "Non-existant field '$AUTOLOAD'" unless $self->_valid($name);
71 *$AUTOLOAD = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}};
72 &$AUTOLOAD($self, @_);