0
|
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 };
|
|
18 sub owner_set { 2 };
|
|
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; |