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;
51 confess "already have $call in $pkg" if $list{$call};
53 my $self = $pkg->SUPER::new($call);
54 $self->{parent} = [ $ncall ];
55 $self->{flags} = $flags;
65 my $ref = $self->delparent($pref->{call});
67 my @out = delete $list{$self->{call}};
74 $call = shift if ref $call;
75 my $ref = $list{uc $call};
76 dbg("Failed to get User $call" ) if !$ref && isdbg('routerr');
83 return $self->_addlist('parent', @_);
89 return $self->_dellist('parent', @_);
93 # generic AUTOLOAD for accessors
102 return if $name =~ /::DESTROY$/;
105 confess "Non-existant field '$AUTOLOAD'" unless $valid{$name} || $Route::valid{$name};
107 # this clever line of code creates a subroutine which takes over from autoload
108 # from OO Perl - Conway
109 # *{$AUTOLOAD} = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}} ;
110 @_ ? $self->{$name} = shift : $self->{$name} ;