Mercurial > pub > Impl
annotate Lib/IMPL/Class/Member.pm @ 288:3a9cfea098dd
*TTView refactoring: removed RequireControl method, etc.
author | sergey |
---|---|
date | Tue, 19 Feb 2013 19:58:27 +0400 |
parents | 4ddb27ff4a0b |
children |
rev | line source |
---|---|
49 | 1 package IMPL::Class::Member; |
2 use strict; | |
165 | 3 use parent qw(Exporter); |
278 | 4 our @EXPORT = qw(&public &private &protected &_direct); |
49 | 5 |
276
8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
sergey
parents:
275
diff
changeset
|
6 |
8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
sergey
parents:
275
diff
changeset
|
7 use IMPL::Const qw(:access); |
8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
sergey
parents:
275
diff
changeset
|
8 |
49 | 9 require IMPL::Class::MemberInfo; |
10 | |
11 sub public($) { | |
276
8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
sergey
parents:
275
diff
changeset
|
12 my $info = shift; |
8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
sergey
parents:
275
diff
changeset
|
13 $info->{access} = ACCESS_PUBLIC; |
278 | 14 my $implementor = delete $info->{implementor}; |
15 $implementor->Implement($info); | |
49 | 16 } |
17 | |
18 sub private($) { | |
276
8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
sergey
parents:
275
diff
changeset
|
19 my $info = shift; |
8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
sergey
parents:
275
diff
changeset
|
20 $info->{access} = ACCESS_PRIVATE; |
278 | 21 my $implementor = delete $info->{implementor}; |
22 $implementor->Implement($info); | |
49 | 23 } |
24 | |
25 sub protected($) { | |
276
8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
sergey
parents:
275
diff
changeset
|
26 my $info = shift; |
8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
sergey
parents:
275
diff
changeset
|
27 $info->{access} = ACCESS_PROTECTED; |
278 | 28 my $implementor = delete $info->{implementor}; |
29 $implementor->Implement($info); | |
30 } | |
31 | |
32 sub _direct($) { | |
33 my $info = shift; | |
34 $info->{direct} = 1; | |
35 return $info; | |
49 | 36 } |
277 | 37 |
49 | 38 1; |