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
|
|
3921
|
use Build::Hopen; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
309
|
|
4
|
6
|
|
|
6
|
|
36
|
use Build::Hopen::Base; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
45
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.000008'; # TRIAL |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub outputs; |
9
|
|
|
|
|
|
|
|
10
|
6
|
|
|
6
|
|
1522
|
use parent 'Build::Hopen::G::Runnable'; |
|
6
|
|
|
|
|
15
|
|
|
6
|
|
|
|
|
46
|
|
11
|
6
|
|
|
6
|
|
324
|
use Class::Tiny qw(outputs); |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
26
|
|
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
|
14
|
my $self = shift or croak 'Need an instance'; |
36
|
5
|
100
|
|
|
|
16
|
if (@_) { # Setter |
|
|
50
|
|
|
|
|
|
37
|
2
|
50
|
0
|
|
|
18
|
croak "Cannot set `outputs` of @{[$self->name]} to non-hashref " . |
|
0
|
|
|
|
|
0
|
|
38
|
|
|
|
|
|
|
($_[0] // '(undef)') |
39
|
|
|
|
|
|
|
unless ref $_[0] eq 'HASH'; |
40
|
2
|
|
|
|
|
5
|
return $self->{outputs} = shift; |
41
|
|
|
|
|
|
|
} elsif ( exists $self->{outputs} ) { # Getter |
42
|
3
|
|
|
|
|
27
|
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__ |