| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Class::MakeMethods::Template::Class; |
|
2
|
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
4586
|
use Class::MakeMethods::Template::Generic '-isasubclass'; |
|
|
2
|
|
|
|
|
8
|
|
|
|
2
|
|
|
|
|
33
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
$VERSION = 1.008; |
|
6
|
2
|
|
|
2
|
|
23
|
use strict; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
86
|
|
|
7
|
|
|
|
|
|
|
require 5.0; |
|
8
|
2
|
|
|
2
|
|
10
|
use Carp; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
981
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Class::MakeMethods::Template::Class - Associate information with a package |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
package MyObject; |
|
17
|
|
|
|
|
|
|
use Class::MakeMethods::Template::Class ( |
|
18
|
|
|
|
|
|
|
scalar => [ 'foo' ] |
|
19
|
|
|
|
|
|
|
); |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
package main; |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
MyObject->foo('bar') |
|
24
|
|
|
|
|
|
|
print MyObject->foo(); |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
These meta-methods provide access to class-specific values. They are similar to Static, except that each subclass has separate values. |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=cut |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub generic { |
|
33
|
|
|
|
|
|
|
{ |
|
34
|
2
|
|
|
2
|
0
|
23
|
'-import' => { |
|
35
|
|
|
|
|
|
|
'Template::Generic:generic' => '*' |
|
36
|
|
|
|
|
|
|
}, |
|
37
|
|
|
|
|
|
|
'modifier' => { |
|
38
|
|
|
|
|
|
|
}, |
|
39
|
|
|
|
|
|
|
'code_expr' => { |
|
40
|
|
|
|
|
|
|
'_VALUE_' => '_ATTR_{data}->{_SELF_CLASS_}', |
|
41
|
|
|
|
|
|
|
}, |
|
42
|
|
|
|
|
|
|
} |
|
43
|
|
|
|
|
|
|
} |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
######################################################################## |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head2 Class:scalar |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Creates methods to handle a scalar variable in the declaring package. |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
See the documentation on C for interfaces and behaviors. |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
######################################################################## |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head2 Class:array |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Creates methods to handle a array variable in the declaring package. |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
See the documentation on C for interfaces and behaviors. |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=cut |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub array { |
|
66
|
|
|
|
|
|
|
{ |
|
67
|
1
|
|
|
1
|
1
|
12
|
'-import' => { |
|
68
|
|
|
|
|
|
|
'Template::Generic:array' => '*', |
|
69
|
|
|
|
|
|
|
}, |
|
70
|
|
|
|
|
|
|
'modifier' => { |
|
71
|
|
|
|
|
|
|
'-all' => q{ _REF_VALUE_ or @{_ATTR_{data}->{_SELF_CLASS_}} = (); * }, |
|
72
|
|
|
|
|
|
|
}, |
|
73
|
|
|
|
|
|
|
'code_expr' => { |
|
74
|
|
|
|
|
|
|
'_VALUE_' => '\@{_ATTR_{data}->{_SELF_CLASS_}}', |
|
75
|
|
|
|
|
|
|
}, |
|
76
|
|
|
|
|
|
|
} |
|
77
|
|
|
|
|
|
|
} |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
######################################################################## |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head2 Class:hash |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Creates methods to handle a hash variable in the declaring package. |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
See the documentation on C for interfaces and behaviors. |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=cut |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub hash { |
|
90
|
|
|
|
|
|
|
{ |
|
91
|
0
|
|
|
0
|
1
|
|
'-import' => { |
|
92
|
|
|
|
|
|
|
'Template::Generic:hash' => '*', |
|
93
|
|
|
|
|
|
|
}, |
|
94
|
|
|
|
|
|
|
'modifier' => { |
|
95
|
|
|
|
|
|
|
'-all' => q{ _REF_VALUE_ or %{_ATTR_{data}->{_SELF_CLASS_}} = (); * }, |
|
96
|
|
|
|
|
|
|
}, |
|
97
|
|
|
|
|
|
|
'code_expr' => { |
|
98
|
|
|
|
|
|
|
'_VALUE_' => '\%{_ATTR_{data}->{_SELF_CLASS_}}', |
|
99
|
|
|
|
|
|
|
}, |
|
100
|
|
|
|
|
|
|
} |
|
101
|
|
|
|
|
|
|
} |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
1; |