File Coverage

blib/lib/X10/EventList.pm
Criterion Covered Total %
statement 9 38 23.6
branch 0 8 0.0
condition n/a
subroutine 3 7 42.8
pod 0 4 0.0
total 12 57 21.0


line stmt bran cond sub pod time code
1             package X10::EventList;
2              
3 1     1   5 use vars qw(@ISA);
  1         3  
  1         43  
4              
5 1     1   5 use Storable;
  1         2  
  1         94  
6              
7             @ISA = qw(Storable);
8              
9 1     1   6 use strict;
  1         1  
  1         337  
10              
11             sub new
12             {
13 0     0 0   my $type = shift;
14              
15 0           my $self = bless { list => [] }, $type;
16              
17 0           foreach (@_)
18             {
19 0 0         if (ref $_ eq 'X10::Event')
    0          
    0          
20             {
21 0           push @{$self->{list}}, $_;
  0            
22             }
23             elsif (ref $_ eq 'X10::EventList')
24             {
25 0           push @{$self->{list}}, $_->list;
  0            
26             }
27             elsif (ref $_ eq '')
28             {
29 0           push @{$self->{list}}, new X10::Event($_);
  0            
30             }
31             else
32             {
33 0           warn "Can't deal with a ", ref $_;
34             }
35             }
36              
37 0           @{$self->{list}} = grep { $_ } @{$self->{list}};
  0            
  0            
  0            
38              
39 0 0         return undef unless @{$self->{list}};
  0            
40              
41 0           return $self;
42             }
43              
44             sub as_string
45             {
46 0     0 0   my $self = shift;
47              
48 0           join(', ', map { $_->as_string } @{$self->{list}});
  0            
  0            
49             }
50              
51             sub list
52             {
53 0     0 0   my $self = shift;
54 0           @{$self->{list}};
  0            
55             }
56              
57             ###
58              
59             # build a string of words that implement this event
60             sub compile
61             {
62 0     0 0   my $self = shift;
63              
64 0           map { $_->compile } @{$self->{list}};
  0            
  0            
65             }
66              
67              
68             ###
69              
70              
71             1;
72