| 1 | |||||||||||||||||||
| 2 | # Copyright (c) 1999-2017 Rob Fugina <robf@fugina.com> | ||||||||||||||||||
| 3 | # Distributed under the terms of the GNU Public License, Version 3.0 | ||||||||||||||||||
| 4 | |||||||||||||||||||
| 5 | package X10::EventList; | ||||||||||||||||||
| 6 | |||||||||||||||||||
| 7 | 1 | ▶ | use vars qw(@ISA); | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 8 | |||||||||||||||||||
| 9 | 1 | ▶ | use Storable; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 10 | |||||||||||||||||||
| 11 | 1 | @ISA = qw(Storable); | |||||||||||||||||
| 12 | |||||||||||||||||||
| 13 | 1 | ▶ | use strict; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 14 | |||||||||||||||||||
| 15 | sub new | ||||||||||||||||||
| 16 | 0 | ▶ | { | ||||||||||||||||
|
Subroutine
new: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||
| 17 | 0 | my $type = shift; | |||||||||||||||||
| 18 | |||||||||||||||||||
| 19 | 0 | my $self = bless { list => [] }, $type; | |||||||||||||||||
| 20 | |||||||||||||||||||
| 21 | 0 | foreach (@_) | |||||||||||||||||
| 22 | { | ||||||||||||||||||
| 23 | 0 | ▶ | if (ref $_ eq 'X10::Event') | ||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||
| 24 | { | ||||||||||||||||||
| 25 | 0 | push @{$self->{list}}, $_; | |||||||||||||||||
| 26 | } | ||||||||||||||||||
| 27 | elsif (ref $_ eq 'X10::EventList') | ||||||||||||||||||
| 28 | { | ||||||||||||||||||
| 29 | 0 | push @{$self->{list}}, $_->list; | |||||||||||||||||
| 30 | } | ||||||||||||||||||
| 31 | elsif (ref $_ eq '') | ||||||||||||||||||
| 32 | { | ||||||||||||||||||
| 33 | 0 | push @{$self->{list}}, new X10::Event($_); | |||||||||||||||||
| 34 | } | ||||||||||||||||||
| 35 | else | ||||||||||||||||||
| 36 | { | ||||||||||||||||||
| 37 | 0 | warn "Can't deal with a ", ref $_; | |||||||||||||||||
| 38 | } | ||||||||||||||||||
| 39 | } | ||||||||||||||||||
| 40 | |||||||||||||||||||
| 41 | 0 | @{$self->{list}} = grep { $_ } @{$self->{list}}; | |||||||||||||||||
| 42 | |||||||||||||||||||
| 43 | 0 | ▶ | return undef unless @{$self->{list}}; | ||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||
| 44 | |||||||||||||||||||
| 45 | 0 | return $self; | |||||||||||||||||
| 46 | } | ||||||||||||||||||
| 47 | |||||||||||||||||||
| 48 | sub as_string | ||||||||||||||||||
| 49 | 0 | ▶ | { | ||||||||||||||||
|
Subroutine
as_string: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||
| 50 | 0 | my $self = shift; | |||||||||||||||||
| 51 | |||||||||||||||||||
| 52 | 0 | join(', ', map { $_->as_string } @{$self->{list}}); | |||||||||||||||||
| 53 | } | ||||||||||||||||||
| 54 | |||||||||||||||||||
| 55 | sub list | ||||||||||||||||||
| 56 | 0 | ▶ | { | ||||||||||||||||
|
Subroutine
list: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||
| 57 | 0 | my $self = shift; | |||||||||||||||||
| 58 | 0 | @{$self->{list}}; | |||||||||||||||||
| 59 | } | ||||||||||||||||||
| 60 | |||||||||||||||||||
| 61 | ### | ||||||||||||||||||
| 62 | |||||||||||||||||||
| 63 | # build a string of words that implement this event | ||||||||||||||||||
| 64 | sub compile | ||||||||||||||||||
| 65 | 0 | ▶ | { | ||||||||||||||||
|
Subroutine
compile: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||
| 66 | 0 | my $self = shift; | |||||||||||||||||
| 67 | |||||||||||||||||||
| 68 | 0 | map { $_->compile } @{$self->{list}}; | |||||||||||||||||
| 69 | } | ||||||||||||||||||
| 70 | |||||||||||||||||||
| 71 | |||||||||||||||||||
| 72 | ### | ||||||||||||||||||
| 73 | |||||||||||||||||||
| 74 | |||||||||||||||||||
| 75 | 1 | 1; | |||||||||||||||||
| 76 | |||||||||||||||||||