line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Astro::App::Satpass2::Copier; |
2
|
|
|
|
|
|
|
|
3
|
21
|
|
|
21
|
|
10878
|
use strict; |
|
21
|
|
|
|
|
52
|
|
|
21
|
|
|
|
|
625
|
|
4
|
21
|
|
|
21
|
|
105
|
use warnings; |
|
21
|
|
|
|
|
42
|
|
|
21
|
|
|
|
|
516
|
|
5
|
|
|
|
|
|
|
|
6
|
21
|
|
|
21
|
|
8857
|
use Clone (); |
|
21
|
|
|
|
|
49421
|
|
|
21
|
|
|
|
|
606
|
|
7
|
|
|
|
|
|
|
|
8
|
21
|
|
|
21
|
|
152
|
use Astro::App::Satpass2::Utils qw{ @CARP_NOT }; |
|
21
|
|
|
|
|
45
|
|
|
21
|
|
|
|
|
1847
|
|
9
|
21
|
|
|
21
|
|
586
|
use Astro::App::Satpass2::Warner; |
|
21
|
|
|
|
|
42
|
|
|
21
|
|
|
|
|
572
|
|
10
|
21
|
|
|
21
|
|
117
|
use Scalar::Util 1.26 qw{ blessed }; |
|
21
|
|
|
|
|
353
|
|
|
21
|
|
|
|
|
5563
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.052'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub attribute_names { |
15
|
69
|
|
|
69
|
1
|
434
|
return ( qw{ warner } ); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub class_name_of_record { |
19
|
2
|
|
|
2
|
1
|
12
|
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
|
218
|
my ( $self ) = @_; |
40
|
60
|
|
33
|
|
|
360
|
my $class = ref $self || $self; |
41
|
60
|
|
|
|
|
225
|
foreach my $attr ( $self->attribute_names() ) { |
42
|
348
|
100
|
|
|
|
1955
|
$class->can( $attr ) and next; |
43
|
140
|
|
|
|
|
381
|
my $method = $class . '::' . $attr; |
44
|
21
|
|
|
21
|
|
183
|
no strict qw{ refs }; |
|
21
|
|
|
|
|
70
|
|
|
21
|
|
|
|
|
11408
|
|
45
|
|
|
|
|
|
|
*$method = sub { |
46
|
3027
|
|
|
3027
|
|
6916
|
my ( $self, @args ) = @_; |
47
|
3027
|
100
|
|
|
|
5394
|
if ( @args ) { |
48
|
87
|
|
|
|
|
236
|
$self->{$attr} = $args[0]; |
49
|
87
|
|
|
|
|
270
|
return $self; |
50
|
|
|
|
|
|
|
} else { |
51
|
2940
|
|
|
|
|
9760
|
return $self->{$attr}; |
52
|
|
|
|
|
|
|
} |
53
|
140
|
|
|
|
|
916
|
}; |
54
|
|
|
|
|
|
|
} |
55
|
60
|
|
|
|
|
239
|
return; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub init { |
59
|
61
|
|
|
61
|
1
|
180
|
my ( $self, %arg ) = @_; |
60
|
|
|
|
|
|
|
exists $arg{warner} |
61
|
61
|
100
|
|
|
|
274
|
and $self->warner( delete $arg{warner} ); |
62
|
61
|
|
|
|
|
286
|
foreach my $name ( $self->attribute_names() ) { |
63
|
|
|
|
|
|
|
exists $arg{$name} |
64
|
296
|
100
|
|
|
|
786
|
and $self->$name( delete $arg{$name} ); |
65
|
|
|
|
|
|
|
} |
66
|
61
|
50
|
|
|
|
190
|
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
|
|
|
|
|
157
|
return $self; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub wail { |
76
|
1
|
|
|
1
|
1
|
279
|
my ( $self, @args ) = @_; |
77
|
1
|
|
|
|
|
5
|
return $self->warner()->wail( @args ); |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub warner { |
81
|
1310
|
|
|
1310
|
1
|
2531
|
my ( $self, @args ) = @_; |
82
|
1310
|
100
|
|
|
|
2798
|
if ( @args ) { |
83
|
812
|
|
|
|
|
1446
|
my $val = shift @args; |
84
|
812
|
100
|
33
|
|
|
6869
|
if ( ! defined $val ) { |
|
|
50
|
33
|
|
|
|
|
|
|
50
|
|
|
|
|
|
85
|
19
|
|
|
|
|
146
|
$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
|
|
|
|
|
2617
|
$self->{warner} = $val; |
96
|
812
|
|
|
|
|
1885
|
return $self; |
97
|
|
|
|
|
|
|
} else { |
98
|
498
|
|
33
|
|
|
2990
|
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__ |