Mercurial > pub > Impl
comparison Lib/IMPL/Object/AutoDispose.pm @ 275:6253872024a4
*refactoring IMPL::Class
| author | cin |
|---|---|
| date | Thu, 31 Jan 2013 02:18:31 +0400 |
| parents | 8d36073411b1 |
| children |
comparison
equal
deleted
inserted
replaced
| 274:8d36073411b1 | 275:6253872024a4 |
|---|---|
| 1 package IMPL::Object::AutoDispose; | 1 package IMPL::Object::AutoDispose; |
| 2 use strict; | 2 use strict; |
| 3 | |
| 4 use IMPL::declare { | |
| 5 base => [ | |
| 6 'IMPL::Object::Abstract' => undef | |
| 7 ] | |
| 8 }; | |
| 9 | 3 |
| 10 sub new { | 4 sub new { |
| 11 my $self = shift; | 5 my $self = shift; |
| 12 | 6 |
| 13 if (ref $self) { | 7 if (ref $self) { |
| 24 | 18 |
| 25 sub can { | 19 sub can { |
| 26 ${shift(@_)}->can(@_); | 20 ${shift(@_)}->can(@_); |
| 27 } | 21 } |
| 28 | 22 |
| 29 sub DTOR { | 23 sub DESTROY { |
| 30 ${shift(@_)}->Dispose(); | 24 ${shift(@_)}->Dispose(); |
| 31 } | |
| 32 | |
| 33 sub typeof { | |
| 34 ${shift(@_)}->typeof(@_); | |
| 35 } | |
| 36 | |
| 37 sub toString { | |
| 38 ${shift(@_)}->toString(@_); | |
| 39 } | 25 } |
| 40 | 26 |
| 41 sub AUTOLOAD { | 27 sub AUTOLOAD { |
| 42 our $AUTOLOAD; | 28 our $AUTOLOAD; |
| 43 my ($method) = ($AUTOLOAD =~ m/(\w+)$/); | 29 my ($method) = ($AUTOLOAD =~ m/(\w+)$/); |
