Mercurial > pub > Impl
annotate Lib/IMPL/Class/Property.pm @ 254:fb52014f6931
updated web-session creation
author | sergey |
---|---|
date | Thu, 06 Dec 2012 19:58:42 +0400 |
parents | 76515373dac0 |
children | 6253872024a4 |
rev | line source |
---|---|
49 | 1 package IMPL::Class::Property; |
2 use strict; | |
165 | 3 use parent qw(Exporter); |
49 | 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; |