Mercurial > pub > Impl
comparison Lib/IMPL/Object/Abstract.pm @ 194:4d0e1962161c
Replaced tabs with spaces
IMPL::Web::View - fixed document model, new features (control classes, document constructor parameters)
| author | cin |
|---|---|
| date | Tue, 10 Apr 2012 20:08:29 +0400 |
| parents | d1676be8afcc |
| children | 6b1dda998839 |
comparison
equal
deleted
inserted
replaced
| 193:8e8401c0aea4 | 194:4d0e1962161c |
|---|---|
| 17 my @sequence; | 17 my @sequence; |
| 18 | 18 |
| 19 my $refCTORS = *{"${class}::CTOR"}{HASH}; | 19 my $refCTORS = *{"${class}::CTOR"}{HASH}; |
| 20 | 20 |
| 21 foreach my $super ( @{"${class}::ISA"} ) { | 21 foreach my $super ( @{"${class}::ISA"} ) { |
| 22 my $superSequence = $cacheCTOR{$super} || cache_ctor($super); | 22 my $superSequence = $cacheCTOR{$super} || cache_ctor($super); |
| 23 | 23 |
| 24 my $mapper = $refCTORS ? $refCTORS->{$super} : undef; | 24 my $mapper = $refCTORS ? $refCTORS->{$super} : undef; |
| 25 if (ref $mapper eq 'CODE') { | 25 if (ref $mapper eq 'CODE') { |
| 26 if ($mapper == *_pass_through_mapper{CODE}) { | 26 if ($mapper == *_pass_through_mapper{CODE}) { |
| 27 push @sequence,@$superSequence; | 27 push @sequence,@$superSequence; |
| 28 } else { | 28 } else { |
| 29 push @sequence, sub { | 29 push @sequence, sub { |
| 30 my $this = shift; | 30 my $this = shift; |
| 31 $this->$_($mapper->(@_)) foreach @$superSequence; | 31 $this->$_($mapper->(@_)) foreach @$superSequence; |
| 32 } if @$superSequence; | 32 } if @$superSequence; |
| 33 } | 33 } |
| 34 } else { | 34 } else { |
| 35 warn "Unsupported mapper type, in '$class' for the super class '$super'" if $mapper; | 35 warn "Unsupported mapper type, in '$class' for the super class '$super'" if $mapper; |
| 36 push @sequence, sub { | 36 push @sequence, sub { |
| 37 my $this = shift; | 37 my $this = shift; |
| 38 $this->$_() foreach @$superSequence; | 38 $this->$_() foreach @$superSequence; |
| 39 } if @$superSequence; | 39 } if @$superSequence; |
| 40 } | 40 } |
| 41 } | 41 } |
| 42 | 42 |
| 43 push @sequence, *{"${class}::CTOR"}{CODE} if *{"${class}::CTOR"}{CODE}; | 43 push @sequence, *{"${class}::CTOR"}{CODE} if *{"${class}::CTOR"}{CODE}; |
| 44 | 44 |
| 45 $cacheCTOR{$class} = \@sequence; | 45 $cacheCTOR{$class} = \@sequence; |
| 46 return \@sequence; | 46 return \@sequence; |
| 47 } | 47 } |
| 48 | 48 |
| 49 sub dump_ctor { | 49 sub dump_ctor { |
| 50 my ($self) = @_; | 50 my ($self) = @_; |
| 51 $self = ref $self || $self; | 51 $self = ref $self || $self; |
| 52 | 52 |
| 53 warn "dumping $self .ctor"; | 53 warn "dumping $self .ctor"; |
| 54 warn "$_" foreach @{$cacheCTOR{$self}||[]}; | 54 warn "$_" foreach @{$cacheCTOR{$self}||[]}; |
| 55 } | 55 } |
| 56 | 56 |
| 57 sub callCTOR { | 57 sub callCTOR { |
| 58 my $self = shift; | 58 my $self = shift; |
| 59 my $class = ref $self; | 59 my $class = ref $self; |
| 66 | 66 |
| 67 return (ref $self || $self); | 67 return (ref $self || $self); |
| 68 } | 68 } |
| 69 | 69 |
| 70 sub typeof { | 70 sub typeof { |
| 71 ref $_[0] || $_[0]; | 71 ref $_[0] || $_[0]; |
| 72 } | 72 } |
| 73 | 73 |
| 74 sub isDisposed { | 74 sub isDisposed { |
| 75 0; | 75 0; |
| 76 } | 76 } |
