line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package IPC::PrettyPipe::Queue; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: A simple queue |
4
|
|
|
|
|
|
|
|
5
|
14
|
|
|
14
|
|
108
|
use Moo; |
|
14
|
|
|
|
|
44
|
|
|
14
|
|
|
|
|
126
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.11'; # TRIAL |
8
|
|
|
|
|
|
|
|
9
|
14
|
|
|
14
|
|
5578
|
use namespace::clean; |
|
14
|
|
|
|
|
33
|
|
|
14
|
|
|
|
|
117
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has elements => ( |
13
|
|
|
|
|
|
|
is => 'ro', |
14
|
|
|
|
|
|
|
init_arg => undef, |
15
|
|
|
|
|
|
|
default => sub { [] }, |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
45
|
|
|
45
|
1
|
27657
|
sub empty { !!!@{ $_[0]->elements } } |
|
45
|
|
|
|
|
202
|
|
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
0
|
1
|
0
|
sub nelements { scalar @{ $_[0]->elements } } |
|
0
|
|
|
|
|
0
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub push { |
23
|
|
|
|
|
|
|
|
24
|
299
|
|
|
299
|
1
|
7677
|
my ( $self, $elem ) = ( shift, shift ); |
25
|
|
|
|
|
|
|
|
26
|
299
|
50
|
|
|
|
1403
|
die( "incompatible element\n" ) |
27
|
|
|
|
|
|
|
unless $elem->does( 'IPC::PrettyPipe::Queue::Element' ); |
28
|
|
|
|
|
|
|
|
29
|
299
|
|
|
|
|
7518
|
my $elements = $self->elements; |
30
|
|
|
|
|
|
|
|
31
|
299
|
100
|
|
|
|
816
|
if ( @$elements ) { |
32
|
|
|
|
|
|
|
## no critic (ProhibitAccessOfPrivateData) |
33
|
135
|
|
|
|
|
434
|
$elements->[-1]->_set_last( 0 ); |
34
|
135
|
|
|
|
|
312
|
$elem->_set_last( 1 ); |
35
|
135
|
|
|
|
|
327
|
$elem->_set_first( 0 ); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
else { |
38
|
|
|
|
|
|
|
|
39
|
164
|
|
|
|
|
534
|
$elem->_set_last( 1 ); |
40
|
164
|
|
|
|
|
456
|
$elem->_set_first( 1 ); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
299
|
|
|
|
|
459
|
push @{$elements}, $elem; |
|
299
|
|
|
|
|
757
|
|
45
|
|
|
|
|
|
|
|
46
|
299
|
|
|
|
|
812
|
return; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
# |
52
|
|
|
|
|
|
|
# This file is part of IPC-PrettyPipe |
53
|
|
|
|
|
|
|
# |
54
|
|
|
|
|
|
|
# This software is Copyright (c) 2018 by Smithsonian Astrophysical Observatory. |
55
|
|
|
|
|
|
|
# |
56
|
|
|
|
|
|
|
# This is free software, licensed under: |
57
|
|
|
|
|
|
|
# |
58
|
|
|
|
|
|
|
# The GNU General Public License, Version 3, June 2007 |
59
|
|
|
|
|
|
|
# |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
__END__ |