comparison Lib/IMPL/Class/MemberInfo.pm @ 0:03e58a454b20

Создан репозитарий
author Sergey
date Tue, 14 Jul 2009 12:54:37 +0400
parents
children 16ada169ca75
comparison
equal deleted inserted replaced
-1:000000000000 0:03e58a454b20
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
27 $this->Frozen(0);
28 $this->Virtual(0) unless defined $this->Virtual;
29 $this->Access(3) unless $this->Access;
30 }
31
32 sub Implement {
33 my ($this) = @_;
34 $this->Implementor->Make($this);
35 $this->Frozen(1);
36 $this->Class->set_meta($this);
37 return;
38 }
39
40 sub set {
41 my $this = shift;
42 if ($this->Frozen) {
43 die new IMPL::Exception('The member information can\'t be modified', $this->Name);
44 }
45 $this->SUPER::set(@_);
46 }
47
48 1;