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;
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;
71 $self->delparent($pref);
72 unless (@{$self->{parent}}) {
73 delete $list{$self->{call}};
82 $call = shift if ref $call;
83 my $ref = $list{uc $call};
84 dbg("Failed to get User $call" ) if !$ref && isdbg('routerr');
91 return $self->_addlist('parent', @_);
97 return $self->_dellist('parent', @_);
101 # generic AUTOLOAD for accessors
110 return if $name =~ /::DESTROY$/;
113 confess "Non-existant field '$AUTOLOAD'" unless $valid{$name} || $Route::valid{$name};
115 # this clever line of code creates a subroutine which takes over from autoload
116 # from OO Perl - Conway
117 # *{$AUTOLOAD} = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}} ;
118 @_ ? $self->{$name} = shift : $self->{$name} ;