Mercurial > pub > Impl
comparison lib/IMPL/Class/Member.pm @ 407:c6e90e02dd17 ref20150831
renamed Lib->lib
| author | cin |
|---|---|
| date | Fri, 04 Sep 2015 19:40:23 +0300 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 406:f23fcb19d3c1 | 407:c6e90e02dd17 |
|---|---|
| 1 package IMPL::Class::Member; | |
| 2 use strict; | |
| 3 use parent qw(Exporter); | |
| 4 our @EXPORT = qw(&public &private &protected &_direct); | |
| 5 | |
| 6 | |
| 7 use IMPL::Const qw(:access); | |
| 8 | |
| 9 require IMPL::Class::MemberInfo; | |
| 10 | |
| 11 sub public($) { | |
| 12 my $info = shift; | |
| 13 $info->{access} = ACCESS_PUBLIC; | |
| 14 my $implementor = delete $info->{implementor}; | |
| 15 $implementor->Implement($info); | |
| 16 } | |
| 17 | |
| 18 sub private($) { | |
| 19 my $info = shift; | |
| 20 $info->{access} = ACCESS_PRIVATE; | |
| 21 my $implementor = delete $info->{implementor}; | |
| 22 $implementor->Implement($info); | |
| 23 } | |
| 24 | |
| 25 sub protected($) { | |
| 26 my $info = shift; | |
| 27 $info->{access} = ACCESS_PROTECTED; | |
| 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; | |
| 36 } | |
| 37 | |
| 38 1; |
