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