2 # User routing routines
4 # Copyright (c) 2001 Dirk Koopman G1TLH
16 use vars qw(%list %valid @ISA $max $filterdef);
20 parent => '0,Parent Calls,parray',
23 $filterdef = $Route::filterdef;
29 my $n = scalar(keys %list);
30 $max = $n if $n > $max;
45 confess "already have $call in $pkg" if $list{$call};
47 my $self = $pkg->SUPER::new($call);
48 $self->{parent} = [ $ncall ];
49 $self->{flags} = $flags;
59 my $ref = $self->delparent($pref->{call});
61 my @out = delete $list{$self->{call}};
68 $call = shift if ref $call;
69 my $ref = $list{uc $call};
70 dbg('routerr', "Failed to get User $call" ) unless $ref;
77 return $self->_addlist('parent', @_);
83 return $self->_dellist('parent', @_);
87 # generic AUTOLOAD for accessors
96 return if $name =~ /::DESTROY$/;
99 confess "Non-existant field '$AUTOLOAD'" unless $valid{$name} || $Route::valid{$name};
101 # this clever line of code creates a subroutine which takes over from autoload
102 # from OO Perl - Conway
103 # *{$AUTOLOAD} = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}} ;
104 @_ ? $self->{$name} = shift : $self->{$name} ;