diff lib/IMPL/Object/Abstract.pm @ 411:ee36115f6a34 ref20150831

sync
author cin
date Mon, 21 Sep 2015 00:53:10 +0300
parents c6e90e02dd17
children
line wrap: on
line diff
--- a/lib/IMPL/Object/Abstract.pm	Mon Sep 14 01:11:53 2015 +0300
+++ b/lib/IMPL/Object/Abstract.pm	Mon Sep 21 00:53:10 2015 +0300
@@ -2,6 +2,9 @@
 use strict;
 use warnings;
 
+BEGIN {
+	require IMPL::Class::Meta;
+}
 use parent qw(IMPL::Class::Meta);
 use Carp qw(croak);
 
@@ -10,6 +13,8 @@
 
 my %cacheCTOR;
 
+__PACKAGE__->static_accessor_own(_typeInfo => undef);
+
 my $t = 0;
 sub cache_ctor {
     my $class = shift;
@@ -114,6 +119,16 @@
     return (ref $self || $self);
 }
 
+sub GetTypeInfo {
+	my $self = shift;
+	my $info = $self->_typeInfo;
+	unless($info) {
+		$info = TypeInfo->new(type => ref($self) ? $self->_typeof : $self);
+		$self->_typeInfo($info);
+	}
+	return $info;
+}
+
 sub _typeof {
     ref $_[0] || $_[0];
 }