Mercurial > pub > Impl
comparison Lib/IMPL/Class/MemberInfo.pm @ 278:4ddb27ff4a0b
core refactoring
author | cin |
---|---|
date | Mon, 04 Feb 2013 02:10:37 +0400 |
parents | 6253872024a4 |
children |
comparison
equal
deleted
inserted
replaced
277:6585464c4664 | 278:4ddb27ff4a0b |
---|---|
1 package IMPL::Class::MemberInfo; | 1 package IMPL::Class::MemberInfo; |
2 use strict; | 2 use strict; |
3 use parent qw(IMPL::Object::Accessor); | |
4 | 3 |
4 use IMPL::Const qw(:prop); | |
5 BEGIN { | |
6 our @ISA = qw(IMPL::Object::Accessor); | |
7 } | |
8 | |
9 require IMPL::Object::Accessor; | |
5 require IMPL::Exception; | 10 require IMPL::Exception; |
6 | 11 |
12 # использовать ClassPropertyImplementor не получится, поскольку он будет | |
13 # создавать экземпляры PropertyInfo, который не доописан (в нем не определены | |
14 # члены) | |
7 __PACKAGE__->mk_accessors( | 15 __PACKAGE__->mk_accessors( |
8 qw( | 16 qw( |
9 name | 17 name |
10 access | 18 access |
11 class | 19 class |
12 implementor | |
13 attributes | 20 attributes |
14 ) | 21 ) |
15 ); | 22 ); |
16 __PACKAGE__->PassThroughArgs; | 23 |
24 our %CTOR = ( | |
25 'IMPL::Object::Accessor' => undef | |
26 ); | |
17 | 27 |
18 sub CTOR { | 28 sub CTOR { |
19 my $this = shift; | 29 my $this = shift; |
20 | 30 |
21 die new IMPL::Exception('The name is required for the member') unless $this->name; | 31 die new IMPL::Exception('The name is required for the member') unless $this->name; |
22 die new IMPL::Exception('The class is required for the member') unless $this->class; | 32 die new IMPL::Exception('The class is required for the member') unless $this->class; |
23 | 33 |
24 $this->attributes({}) unless defined $this->attributes; | 34 $this->attributes({}) unless defined $this->attributes; |
25 $this->access(3) unless $this->access; | 35 $this->access(3) unless $this->access; |
26 } | |
27 | |
28 sub Implement { | |
29 my ($this) = @_; | |
30 $this->implementor->Make($this); | |
31 $this->class->set_meta($this); | |
32 return; | |
33 } | 36 } |
34 | 37 |
35 1; | 38 1; |
36 | 39 |
37 __END__ | 40 __END__ |