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,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;
53 my $self = $pkg->SUPER::new($call);
54 $self->{parent} = [ $ncall ];
55 $self->{flags} = $flags;
64 confess "already have $call in $pkg" if $list{$self->{call}};
78 $self->delparent($pref);
79 unless (@{$self->{parent}}) {
80 delete $list{$self->{call}};
89 $call = shift if ref $call;
90 my $ref = $list{uc $call};
91 dbg("Failed to get User $call" ) if !$ref && isdbg('routerr');
98 return $self->_addlist('parent', @_);
104 return $self->_dellist('parent', @_);
108 # generic AUTOLOAD for accessors
117 return if $name =~ /::DESTROY$/;
120 confess "Non-existant field '$AUTOLOAD'" unless $valid{$name} || $Route::valid{$name};
122 *$AUTOLOAD = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}};
123 &$AUTOLOAD($self, @_);