annotate Lib/IMPL/Class/Property.pm @ 0:03e58a454b20

Создан репозитарий
author Sergey
date Tue, 14 Jul 2009 12:54:37 +0400
parents
children 16ada169ca75
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
1 package IMPL::Class::Property;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
2 use strict;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
3 use base qw(Exporter);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
4 BEGIN {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
5 our @EXPORT = qw(property prop_get prop_set owner_set prop_none prop_all prop_list CreateProperty);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
6 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
7
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
8 require IMPL::Class::Member;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
9 require IMPL::Class::PropertyInfo;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
10
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
11 sub import {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
12 __PACKAGE__->export_to_level(1,@_);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
13 IMPL::Class::Member->export_to_level(1,@_);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
14 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
15
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
16 sub prop_get { 1 };
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
17 sub prop_set { 2 };
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
18 sub owner_set { 2 };
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
19 sub prop_none { 0 };
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
20 sub prop_all { 3 };
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
21 sub prop_list { 4 };
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
22
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
23 sub property($$;$) {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
24 my ($propName,$mutators,$attributes) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
25 my $Info = new IMPL::Class::PropertyInfo( {Name => $propName, Mutators => $mutators, Class => scalar(caller), Attributes => $attributes } );
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
26 return $Info;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
27 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
28
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
29 sub CreateProperty {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
30 my ($class,$propName,$mutators,$attributes) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
31 my $Info = new IMPL::Class::PropertyInfo( {Name => $propName, Mutators => $mutators, Class => $class, Attributes => $attributes} );
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
32 return $Info;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
33 };
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
34
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
35 1;