line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Enbld::Target::AttributeCollector; |
2
|
|
|
|
|
|
|
|
3
|
20
|
|
|
20
|
|
8582
|
use strict; |
|
20
|
|
|
|
|
26
|
|
|
20
|
|
|
|
|
538
|
|
4
|
20
|
|
|
20
|
|
67
|
use warnings; |
|
20
|
|
|
|
|
22
|
|
|
20
|
|
|
|
|
513
|
|
5
|
|
|
|
|
|
|
|
6
|
20
|
|
|
20
|
|
63
|
use Carp; |
|
20
|
|
|
|
|
20
|
|
|
20
|
|
|
|
|
5448
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
176
|
|
|
176
|
0
|
18695
|
my $class = shift; |
10
|
|
|
|
|
|
|
|
11
|
176
|
|
|
|
|
464
|
return bless {}, $class; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub add { |
15
|
1403
|
|
|
1403
|
0
|
2824
|
my ( $self, $name, $param ) = @_; |
16
|
|
|
|
|
|
|
|
17
|
1403
|
100
|
|
|
|
2448
|
if ( $self->{$name} ) { |
18
|
1
|
|
|
|
|
4
|
require Enbld::Exception; |
19
|
1
|
|
|
|
|
4
|
croak( Enbld::Exception->new( $name . " is already added" ) ); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
1402
|
|
|
|
|
10958
|
require Enbld::Target::Attribute; |
23
|
1402
|
|
|
|
|
2937
|
$self->{$name} = Enbld::Target::Attribute->new( $name, $param ); |
24
|
1384
|
|
|
|
|
3842
|
$self->{$name}->link_to_collector( $self ); |
25
|
|
|
|
|
|
|
|
26
|
1384
|
|
|
|
|
2447
|
return $self; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub AUTOLOAD { |
30
|
1510
|
|
|
1510
|
|
3435
|
my $self = shift; |
31
|
|
|
|
|
|
|
|
32
|
1510
|
|
|
|
|
1666
|
my $method = our $AUTOLOAD; |
33
|
1510
|
|
|
|
|
5251
|
$method =~ s/.*:://; |
34
|
|
|
|
|
|
|
|
35
|
1510
|
100
|
|
|
|
6625
|
return $self->{$method}->to_value if ( exists $self->{$method} ); |
36
|
|
|
|
|
|
|
|
37
|
1
|
|
|
|
|
335
|
require Enbld::Exception; |
38
|
1
|
|
|
|
|
5
|
croak( Enbld::Exception->new( "'$method' is invalid method" ) ); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
0
|
|
|
sub DESTROY { |
42
|
|
|
|
|
|
|
# do nothing |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |