2 # User routing routines
4 # Copyright (c) 2001 Dirk Koopman G1TLH
16 use vars qw($VERSION $BRANCH);
17 $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
18 $BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ ) || 0;
19 $main::build += $VERSION;
20 $main::branch += $BRANCH;
22 use vars qw(%list %valid @ISA $max $filterdef);
26 parent => '0,Parent Calls,parray',
29 $filterdef = $Route::filterdef;
35 my $n = scalar(keys %list);
36 $max = $n if $n > $max;
52 confess "already have $call in $pkg" if $list{$call};
54 my $self = $pkg->SUPER::new($call);
55 $self->{parent} = [ $ncall ];
56 $self->{flags} = $flags;
66 my @out = $self->delparent($pref);
73 $call = shift if ref $call;
74 my $ref = $list{uc $call};
75 dbg("Failed to get User $call" ) if !$ref && isdbg('routerr');
82 return $self->_addlist('parent', @_);
88 return $self->_dellist('parent', @_);
92 # generic AUTOLOAD for accessors
101 return if $name =~ /::DESTROY$/;
104 confess "Non-existant field '$AUTOLOAD'" unless $valid{$name} || $Route::valid{$name};
106 # this clever line of code creates a subroutine which takes over from autoload
107 # from OO Perl - Conway
108 # *{$AUTOLOAD} = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}} ;
109 @_ ? $self->{$name} = shift : $self->{$name} ;