Mercurial > pub > Impl
annotate Lib/IMPL/Class/MemberInfo.pm @ 142:4c9849f0f879
minor changes
author | wizard |
---|---|
date | Wed, 07 Jul 2010 17:30:40 +0400 |
parents | 44977efed303 |
children | 6ce1f052b90a |
rev | line source |
---|---|
49 | 1 package IMPL::Class::MemberInfo; |
2 use strict; | |
3 use base qw(IMPL::Object::Accessor); | |
4 | |
5 require IMPL::Exception; | |
6 require IMPL::Class::Member; | |
7 | |
8 __PACKAGE__->mk_accessors( | |
9 qw( | |
10 Name | |
11 Access | |
12 Virtual | |
13 Class | |
14 Frozen | |
15 Implementor | |
16 Attributes | |
17 ) | |
18 ); | |
19 __PACKAGE__->PassThroughArgs; | |
20 | |
21 sub CTOR { | |
22 my $this = shift; | |
23 | |
24 die new IMPL::Exception('The name is required for the member') unless $this->Name; | |
25 die new IMPL::Exception('The class is required for the member') unless $this->Class; | |
26 | |
59
0f3e369553bd
Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
49
diff
changeset
|
27 $this->Attributes({}) unless defined $this->Attributes; |
49 | 28 $this->Frozen(0); |
29 $this->Virtual(0) unless defined $this->Virtual; | |
30 $this->Access(3) unless $this->Access; | |
31 } | |
32 | |
33 sub Implement { | |
34 my ($this) = @_; | |
35 $this->Implementor->Make($this); | |
36 $this->Frozen(1); | |
37 $this->Class->set_meta($this); | |
38 return; | |
39 } | |
40 | |
134 | 41 #TODO: Debug version |
42 #sub set { | |
43 # my $this = shift; | |
44 # if ($this->Frozen) { | |
45 # die new IMPL::Exception('The member information is frozen', $this->Name); | |
46 # } | |
47 # $this->SUPER::set(@_); | |
48 #} | |
49 | 49 |
50 1; |