Mercurial > pub > Impl
annotate Lib/IMPL/Class/MemberInfo.pm @ 79:2d1c3f713280
ORM concept in development
author | wizard |
---|---|
date | Mon, 05 Apr 2010 00:20:34 +0400 |
parents | 0f3e369553bd |
children | 44977efed303 |
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 | |
41 sub set { | |
42 my $this = shift; | |
43 if ($this->Frozen) { | |
59
0f3e369553bd
Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
49
diff
changeset
|
44 die new IMPL::Exception('The member information is frozen', $this->Name); |
49 | 45 } |
46 $this->SUPER::set(@_); | |
47 } | |
48 | |
49 1; |