Mercurial > pub > Impl
comparison lib/IMPL/Object/Abstract.pm @ 411:ee36115f6a34 ref20150831
sync
| author | cin |
|---|---|
| date | Mon, 21 Sep 2015 00:53:10 +0300 |
| parents | c6e90e02dd17 |
| children |
comparison
equal
deleted
inserted
replaced
| 410:9335cf010b23 | 411:ee36115f6a34 |
|---|---|
| 1 package IMPL::Object::Abstract; | 1 package IMPL::Object::Abstract; |
| 2 use strict; | 2 use strict; |
| 3 use warnings; | 3 use warnings; |
| 4 | 4 |
| 5 BEGIN { | |
| 6 require IMPL::Class::Meta; | |
| 7 } | |
| 5 use parent qw(IMPL::Class::Meta); | 8 use parent qw(IMPL::Class::Meta); |
| 6 use Carp qw(croak); | 9 use Carp qw(croak); |
| 7 | 10 |
| 8 our $MemoryLeakProtection; | 11 our $MemoryLeakProtection; |
| 9 my $Cleanup = 0; | 12 my $Cleanup = 0; |
| 10 | 13 |
| 11 my %cacheCTOR; | 14 my %cacheCTOR; |
| 15 | |
| 16 __PACKAGE__->static_accessor_own(_typeInfo => undef); | |
| 12 | 17 |
| 13 my $t = 0; | 18 my $t = 0; |
| 14 sub cache_ctor { | 19 sub cache_ctor { |
| 15 my $class = shift; | 20 my $class = shift; |
| 16 | 21 |
| 112 my $self = shift; | 117 my $self = shift; |
| 113 | 118 |
| 114 return (ref $self || $self); | 119 return (ref $self || $self); |
| 115 } | 120 } |
| 116 | 121 |
| 122 sub GetTypeInfo { | |
| 123 my $self = shift; | |
| 124 my $info = $self->_typeInfo; | |
| 125 unless($info) { | |
| 126 $info = TypeInfo->new(type => ref($self) ? $self->_typeof : $self); | |
| 127 $self->_typeInfo($info); | |
| 128 } | |
| 129 return $info; | |
| 130 } | |
| 131 | |
| 117 sub _typeof { | 132 sub _typeof { |
| 118 ref $_[0] || $_[0]; | 133 ref $_[0] || $_[0]; |
| 119 } | 134 } |
| 120 | 135 |
| 121 sub isDisposed { | 136 sub isDisposed { |
