X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXChannel.pm;h=093bfb003ca2ae6e9b824f0e097d8e8f4eb48d6a;hb=0121434f428d8e7d1f31a9d69a4ee250b952b468;hp=9ba985a6773b0b1425a8d4bbf27b7ddd0fc33b45;hpb=625ce0adf070a7e900fa03714a391652db0c065a;p=spider.git diff --git a/perl/DXChannel.pm b/perl/DXChannel.pm index 9ba985a6..093bfb00 100644 --- a/perl/DXChannel.pm +++ b/perl/DXChannel.pm @@ -25,15 +25,25 @@ # package DXChannel; -require Exporter; -@ISA = qw(DXCommandmode DXProt Exporter); - use Msg; use DXUtil; use DXM; %channels = undef; +%valid = ( + call => 'Callsign', + conn => 'Msg Connection ref', + user => 'DXUser ref', + t => 'Time', + priv => 'Privilege', + state => 'Current State', + oldstate => 'Last State', + list => 'Dependant DXChannels list', + name => 'User Name', +); + + # create a new connection object [$obj = DXChannel->new($call, $msg_conn_obj, $user_obj)] sub new { @@ -173,5 +183,18 @@ sub state print "Db $self->{call} channel state $self->{oldstate} -> $self->{state}\n" if $main::debug; } +# various access routines +sub AUTOLOAD +{ + my $self = shift; + my $name = $AUTOLOAD; + + return if $name =~ /::DESTROY$/; + $name =~ s/.*:://o; + + die "Non-existant field '$AUTOLOAD'" if !$valid{$name}; + @_ ? $self->{$name} = shift : $self->{$name} ; +} + 1; __END__;