line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Object::Tiny::RW::XS; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
2890
|
use strict 'vars', 'subs'; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
161
|
|
4
|
|
|
|
|
|
|
BEGIN { |
5
|
3
|
|
|
3
|
|
129
|
require 5.004; |
6
|
3
|
|
|
|
|
970
|
$Object::Tiny::RW::XS::VERSION = '0.03'; |
7
|
|
|
|
|
|
|
} |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub import { |
10
|
3
|
50
|
|
3
|
|
4959
|
return unless shift eq 'Object::Tiny::RW::XS'; |
11
|
3
|
|
|
|
|
8
|
my $pkg = caller; |
12
|
3
|
|
|
|
|
17
|
my $child = !! @{"${pkg}::ISA"}; |
|
3
|
|
|
|
|
29
|
|
13
|
5
|
100
|
33
|
|
|
95
|
eval join "\n", |
|
|
|
66
|
|
|
|
|
14
|
|
|
|
|
|
|
"package $pkg;", |
15
|
|
|
|
|
|
|
($child ? () : "\@${pkg}::ISA = 'Object::Tiny::RW::XS';"), |
16
|
|
|
|
|
|
|
"use Class::XSAccessor accessors => {", |
17
|
|
|
|
|
|
|
(map { |
18
|
3
|
50
|
|
2
|
|
21
|
defined and ! ref and /^[^\W\d]\w*$/s |
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
18
|
|
19
|
|
|
|
|
|
|
or die "Invalid accessor name '$_'"; |
20
|
4
|
|
|
|
|
193
|
"'$_' => '$_'," |
21
|
|
|
|
|
|
|
} @_), |
22
|
|
|
|
|
|
|
"};"; |
23
|
2
|
50
|
|
|
|
10
|
die "Failed to generate $pkg" if $@; |
24
|
2
|
|
|
|
|
34
|
return 1; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
use Class::XSAccessor |
28
|
3
|
|
|
3
|
|
2858
|
constructor => 'new'; |
|
3
|
|
|
|
|
11624
|
|
|
3
|
|
|
|
|
21
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__END__ |