annotate Lib/IMPL/Class/MemberInfo.pm @ 228:431db7034a88

Для синхронизации
author andrei <andrei@nap21.upri>
date Thu, 13 Sep 2012 17:55:01 +0400
parents d1676be8afcc
children 6d8092d8ce1b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
1 package IMPL::Class::MemberInfo;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
2 use strict;
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
3 use IMPL::_core::version;
165
76515373dac0 Added Class::Template,
wizard
parents: 163
diff changeset
4 use parent qw(IMPL::Object::Accessor);
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
5
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
6 require IMPL::Exception;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
7
228
431db7034a88 Для синхронизации
andrei <andrei@nap21.upri>
parents: 180
diff changeset
8 use constant {
431db7034a88 Для синхронизации
andrei <andrei@nap21.upri>
parents: 180
diff changeset
9 MOD_PUBLIC => 1,
431db7034a88 Для синхронизации
andrei <andrei@nap21.upri>
parents: 180
diff changeset
10 MOD_PROTECTED => 2,
431db7034a88 Для синхронизации
andrei <andrei@nap21.upri>
parents: 180
diff changeset
11 MOD_PRIVATE => 3
431db7034a88 Для синхронизации
andrei <andrei@nap21.upri>
parents: 180
diff changeset
12 };
431db7034a88 Для синхронизации
andrei <andrei@nap21.upri>
parents: 180
diff changeset
13
431db7034a88 Для синхронизации
andrei <andrei@nap21.upri>
parents: 180
diff changeset
14 #TODO remove Virtual
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
15 __PACKAGE__->mk_accessors(
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
16 qw(
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
17 Name
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
18 Access
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
19 Virtual
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
20 Class
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
21 Frozen
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
22 Implementor
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
23 Attributes
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
24 )
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
25 );
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
26 __PACKAGE__->PassThroughArgs;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
27
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
28 sub CTOR {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
29 my $this = shift;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
30
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
31 die new IMPL::Exception('The name is required for the member') unless $this->Name;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
32 die new IMPL::Exception('The class is required for the member') unless $this->Class;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
33
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents: 49
diff changeset
34 $this->Attributes({}) unless defined $this->Attributes;
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
35 $this->Frozen(0);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
36 $this->Virtual(0) unless defined $this->Virtual;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
37 $this->Access(3) unless $this->Access;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
38 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
39
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
40 sub Implement {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
41 my ($this) = @_;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
42 $this->Implementor->Make($this);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
43 $this->Frozen(1);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
44 $this->Class->set_meta($this);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
45 return;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
46 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
47
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
48 1;
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
49
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
50 __END__
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
51
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
52 =pod
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
53
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
54 =head1 NAME
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
55
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
56 C<IMPL::Class::MemberInfo> - информация о члене класса.
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
57
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
58 =head1 DESCRIPTION
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
59
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
60 Данный класс является базовым для таких классов как C<IMPL::Class::PropertyInfo>, C<IMPL::Class::MethodInfo> и
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
61 предназначен для хренения метаданных.
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
62
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
63 Данный класс наследуется от C<IMPL::Object::Accessor> и не содержит в себе метаданных о своих членах.
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
64
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
65 =head1 MEMBERS
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
66
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
67 =over
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
68
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
69 =item C<[get,set] Name>
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
70
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
71 Имя члена.
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
72
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
73 =item C<[get,set] Access>
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
74
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
75 Default public.
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
76
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
77 Атрибут доступа ( public | private | protected )
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
78
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
79 =item C<[get,set] Virtual>
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
80
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
81 Default false.
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
82
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
83 Флаг виртуальности.
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
84
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
85 =item C<[get,set] Class>
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
86
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
87 Класс владелец
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
88
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
89 =item C<[get,set] Frozen>
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
90
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
91 Флаг невозможности внесения изменений
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
92
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
93 =item C<[get,set] Attributes>
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
94
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
95 Дополнительные атрибуты
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
96
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
97 =item C<Implement()>
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
98
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
99 Устанавливает C<Frozen> в C<1>, добавляет в метаданные класса.
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
100
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
101 При реализации собственного субкласса, данный метод может быть переопределен для
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
102 реализации дополнительной обработки (например, создание методов доступа для свойств).
163
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
103
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
104 =back
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
105
6ce1f052b90a temp commit
wizard
parents: 134
diff changeset
106 =cut