line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Astro::App::Satpass2::Copier; |
2
|
|
|
|
|
|
|
|
3
|
21
|
|
|
21
|
|
10957
|
use strict; |
|
21
|
|
|
|
|
44
|
|
|
21
|
|
|
|
|
572
|
|
4
|
21
|
|
|
21
|
|
101
|
use warnings; |
|
21
|
|
|
|
|
41
|
|
|
21
|
|
|
|
|
515
|
|
5
|
|
|
|
|
|
|
|
6
|
21
|
|
|
21
|
|
8657
|
use Clone (); |
|
21
|
|
|
|
|
48504
|
|
|
21
|
|
|
|
|
603
|
|
7
|
|
|
|
|
|
|
|
8
|
21
|
|
|
21
|
|
144
|
use Astro::App::Satpass2::Utils qw{ @CARP_NOT }; |
|
21
|
|
|
|
|
45
|
|
|
21
|
|
|
|
|
2162
|
|
9
|
21
|
|
|
21
|
|
574
|
use Astro::App::Satpass2::Warner; |
|
21
|
|
|
|
|
55
|
|
|
21
|
|
|
|
|
579
|
|
10
|
21
|
|
|
21
|
|
112
|
use Scalar::Util 1.26 qw{ blessed }; |
|
21
|
|
|
|
|
352
|
|
|
21
|
|
|
|
|
5383
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.051_01'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub attribute_names { |
15
|
69
|
|
|
69
|
1
|
415
|
return ( qw{ warner } ); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub class_name_of_record { |
19
|
2
|
|
|
2
|
1
|
6
|
my ( $self ) = @_; |
20
|
2
|
|
33
|
|
|
8
|
return ref $self || $self; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub clone { |
24
|
0
|
|
|
0
|
1
|
0
|
my ( $self ) = @_; |
25
|
0
|
|
|
|
|
0
|
return Clone::clone( $self ); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub copy { |
29
|
0
|
|
|
0
|
1
|
0
|
my ( $self, $copy, %skip ) = @_; |
30
|
0
|
|
|
|
|
0
|
foreach my $attr ( $self->attribute_names() ) { |
31
|
0
|
0
|
0
|
|
|
0
|
not exists $skip{$attr} |
32
|
|
|
|
|
|
|
and $copy->can( $attr ) |
33
|
|
|
|
|
|
|
and $copy->$attr( $self->$attr() ); |
34
|
|
|
|
|
|
|
} |
35
|
0
|
|
|
|
|
0
|
return $self; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub create_attribute_methods { |
39
|
60
|
|
|
60
|
1
|
227
|
my ( $self ) = @_; |
40
|
60
|
|
33
|
|
|
362
|
my $class = ref $self || $self; |
41
|
60
|
|
|
|
|
237
|
foreach my $attr ( $self->attribute_names() ) { |
42
|
348
|
100
|
|
|
|
2316
|
$class->can( $attr ) and next; |
43
|
140
|
|
|
|
|
373
|
my $method = $class . '::' . $attr; |
44
|
21
|
|
|
21
|
|
178
|
no strict qw{ refs }; |
|
21
|
|
|
|
|
77
|
|
|
21
|
|
|
|
|
10983
|
|
45
|
|
|
|
|
|
|
*$method = sub { |
46
|
3027
|
|
|
3027
|
|
6840
|
my ( $self, @args ) = @_; |
47
|
3027
|
100
|
|
|
|
5555
|
if ( @args ) { |
48
|
87
|
|
|
|
|
233
|
$self->{$attr} = $args[0]; |
49
|
87
|
|
|
|
|
236
|
return $self; |
50
|
|
|
|
|
|
|
} else { |
51
|
2940
|
|
|
|
|
9383
|
return $self->{$attr}; |
52
|
|
|
|
|
|
|
} |
53
|
140
|
|
|
|
|
943
|
}; |
54
|
|
|
|
|
|
|
} |
55
|
60
|
|
|
|
|
210
|
return; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub init { |
59
|
61
|
|
|
61
|
1
|
185
|
my ( $self, %arg ) = @_; |
60
|
|
|
|
|
|
|
exists $arg{warner} |
61
|
61
|
100
|
|
|
|
274
|
and $self->warner( delete $arg{warner} ); |
62
|
61
|
|
|
|
|
245
|
foreach my $name ( $self->attribute_names() ) { |
63
|
|
|
|
|
|
|
exists $arg{$name} |
64
|
296
|
100
|
|
|
|
755
|
and $self->$name( delete $arg{$name} ); |
65
|
|
|
|
|
|
|
} |
66
|
61
|
50
|
|
|
|
182
|
if ( %arg ) { |
67
|
0
|
|
|
|
|
0
|
my @extra = sort keys %arg; |
68
|
0
|
|
|
|
|
0
|
$self->wail( |
69
|
|
|
|
|
|
|
join ' ', 'Unknown attribute name(s):', @extra |
70
|
|
|
|
|
|
|
); |
71
|
|
|
|
|
|
|
} |
72
|
61
|
|
|
|
|
150
|
return $self; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub wail { |
76
|
1
|
|
|
1
|
1
|
375
|
my ( $self, @args ) = @_; |
77
|
1
|
|
|
|
|
7
|
return $self->warner()->wail( @args ); |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub warner { |
81
|
1310
|
|
|
1310
|
1
|
2603
|
my ( $self, @args ) = @_; |
82
|
1310
|
100
|
|
|
|
2785
|
if ( @args ) { |
83
|
812
|
|
|
|
|
1392
|
my $val = shift @args; |
84
|
812
|
100
|
33
|
|
|
6841
|
if ( ! defined $val ) { |
|
|
50
|
33
|
|
|
|
|
|
|
50
|
|
|
|
|
|
85
|
19
|
|
|
|
|
121
|
$val = Astro::App::Satpass2::Warner->new(); |
86
|
|
|
|
|
|
|
} elsif ( ! ref $val && $val->isa( |
87
|
|
|
|
|
|
|
'Astro::App::Satpass2::Warner' ) ) { |
88
|
0
|
|
|
|
|
0
|
$val = Astro::App::Satpass2::Warner->new(); |
89
|
|
|
|
|
|
|
} elsif ( ! ( blessed( $val ) && |
90
|
|
|
|
|
|
|
$val->isa('Astro::App::Satpass2::Warner' ) ) ) { |
91
|
0
|
|
|
|
|
0
|
$self->wail( |
92
|
|
|
|
|
|
|
'Warner must be undef or an Astro::App::Satpass2::Warner' |
93
|
|
|
|
|
|
|
); |
94
|
|
|
|
|
|
|
} |
95
|
812
|
|
|
|
|
2312
|
$self->{warner} = $val; |
96
|
812
|
|
|
|
|
1978
|
return $self; |
97
|
|
|
|
|
|
|
} else { |
98
|
498
|
|
33
|
|
|
2693
|
return $self->{warner} ||= Astro::App::Satpass2::Warner->new(); |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub weep { |
103
|
0
|
|
|
0
|
1
|
|
my ( $self, @args ) = @_; |
104
|
0
|
|
|
|
|
|
return $self->warner()->weep( @args ); |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
sub whinge { |
108
|
0
|
|
|
0
|
1
|
|
my ( $self, @args ) = @_; |
109
|
0
|
|
|
|
|
|
return $self->warner()->whinge( @args ); |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
1; |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
__END__ |