Mercurial > pub > Impl
annotate Lib/IMPL/Class/Property.pm @ 142:4c9849f0f879
minor changes
| author | wizard |
|---|---|
| date | Wed, 07 Jul 2010 17:30:40 +0400 |
| parents | 0f3e369553bd |
| children | 76515373dac0 |
| rev | line source |
|---|---|
| 49 | 1 package IMPL::Class::Property; |
| 2 use strict; | |
| 3 use base qw(Exporter); | |
| 4 BEGIN { | |
| 5 our @EXPORT = qw(property prop_get prop_set owner_set prop_none prop_all prop_list CreateProperty); | |
| 6 } | |
| 7 | |
| 8 require IMPL::Class::Member; | |
| 9 require IMPL::Class::PropertyInfo; | |
| 10 | |
| 11 sub import { | |
| 12 __PACKAGE__->export_to_level(1,@_); | |
| 13 IMPL::Class::Member->export_to_level(1,@_); | |
| 14 } | |
| 15 | |
| 16 sub prop_get { 1 }; | |
| 17 sub prop_set { 2 }; | |
|
59
0f3e369553bd
Rewritten property implementation (probably become slower but more flexible)
wizard
parents:
49
diff
changeset
|
18 sub owner_set { 10 }; |
| 49 | 19 sub prop_none { 0 }; |
| 20 sub prop_all { 3 }; | |
| 21 sub prop_list { 4 }; | |
| 22 | |
| 23 sub property($$;$) { | |
| 24 my ($propName,$mutators,$attributes) = @_; | |
| 25 my $Info = new IMPL::Class::PropertyInfo( {Name => $propName, Mutators => $mutators, Class => scalar(caller), Attributes => $attributes } ); | |
| 26 return $Info; | |
| 27 } | |
| 28 | |
| 29 sub CreateProperty { | |
| 30 my ($class,$propName,$mutators,$attributes) = @_; | |
| 31 my $Info = new IMPL::Class::PropertyInfo( {Name => $propName, Mutators => $mutators, Class => $class, Attributes => $attributes} ); | |
| 32 return $Info; | |
| 33 }; | |
| 34 | |
| 35 1; |
