line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Build::Hopen::G::Node - base class for hopen nodes |
2
|
|
|
|
|
|
|
package Build::Hopen::G::Node; |
3
|
6
|
|
|
6
|
|
3496
|
use Build::Hopen; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
288
|
|
4
|
6
|
|
|
6
|
|
36
|
use Build::Hopen::Base; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
33
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.000007'; # TRIAL |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub outputs; |
9
|
|
|
|
|
|
|
|
10
|
6
|
|
|
6
|
|
1395
|
use parent 'Build::Hopen::G::Runnable'; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
60
|
|
11
|
6
|
|
|
6
|
|
326
|
use Class::Tiny qw(outputs); |
|
6
|
|
|
|
|
18
|
|
|
6
|
|
|
|
|
22
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 NAME |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Build::Hopen::G::Node - The base class for all hopen nodes |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 VARIABLES |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head2 outputs |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Hashref of the outputs from the last time this node was run. Default C<{}>. |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=cut |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 FUNCTIONS |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head2 outputs |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
Custom accessor for outputs, which enforces the invariant that outputs must |
30
|
|
|
|
|
|
|
be hashrefs. |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub outputs { |
35
|
5
|
50
|
|
5
|
1
|
12
|
my $self = shift or croak 'Need an instance'; |
36
|
5
|
100
|
|
|
|
12
|
if (@_) { # Setter |
|
|
50
|
|
|
|
|
|
37
|
2
|
50
|
0
|
|
|
8
|
croak "Cannot set `outputs` of @{[$self->name]} to non-hashref " . |
|
0
|
|
|
|
|
0
|
|
38
|
|
|
|
|
|
|
($_[0] // '(undef)') |
39
|
|
|
|
|
|
|
unless ref $_[0] eq 'HASH'; |
40
|
2
|
|
|
|
|
7
|
return $self->{outputs} = shift; |
41
|
|
|
|
|
|
|
} elsif ( exists $self->{outputs} ) { # Getter |
42
|
3
|
|
|
|
|
24
|
return $self->{outputs}; |
43
|
|
|
|
|
|
|
} else { # Default |
44
|
0
|
|
|
|
|
|
return +{}; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
} #outputs() |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
#DEBUG: sub BUILD { use Data::Dumper; say __PACKAGE__,Dumper(\@_); } |
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
__END__ |