| 1 | package Linux::Event::_ByteStream::Descriptor; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 127 | ▶ | use v5.36; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 127 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 127 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 127 | ▶ | use Carp qw(croak); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 127 | ▶ | use mro (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 127 | my %FRAMER_DEFINITION; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | my %CONSUMER_DEFINITION; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 127 | my %CLASS_DESCRIPTOR; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 127 | my %CONSTRUCTION_DESCRIPTOR; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 127 | my @TUNING_NAME = qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | read_size read_budget_bytes read_batch_bytes message_batch_size | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | high_watermark low_watermark max_pending_bytes max_buffer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | idle_timeout read_timeout write_timeout | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 127 | my %TUNING_NAME = map { $_ => 1 } @TUNING_NAME; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 127 | my @NATIVE_TUNING_NAME = qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | read_size read_budget_bytes read_batch_bytes message_batch_size | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | high_watermark low_watermark max_pending_bytes max_buffer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 127 | my @NATIVE_SPEC_FIELD = qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | read_size read_budget_bytes read_batch_bytes message_batch_size | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | high_watermark low_watermark max_pending_bytes max_buffer read_mode | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | deliver_cb message_cb message_batch_cb drain_cb eof_cb read_error_cb | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | write_error_cb output_limit_cb write_empty_cb framing_error_cb delimiter | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | include_delimiter max_frame fixed_size prefix_bytes prefix_little | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | include_prefix consumer_provider consumer_abi_version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | consumer_ops_address | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 127 | my %NATIVE_SPEC_FIELD = map { $_ => 1 } @NATIVE_SPEC_FIELD; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | ▶ | sub tuning_names () { @TUNING_NAME } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
tuning_names: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 9 | ▶ | sub native_tuning_names () { @NATIVE_TUNING_NAME } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
native_tuning_names: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 313 | ▶ | sub _validate_native_spec ($spec) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_validate_native_spec: called CC=10 SCAR=23.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 313 | ▶ | croak 'native descriptor requires a hash reference' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | if ref($spec) ne 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 312 | my @unknown = grep { !$NATIVE_SPEC_FIELD{$_} } keys %$spec; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 312 | ▶ | croak "unknown ordered-byte descriptor field '$unknown[0]'" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | if @unknown == 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 311 | ▶ | croak 'unknown ordered-byte descriptor fields: ' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | . join(', ', sort @unknown) if @unknown; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 311 | for my $field (@NATIVE_SPEC_FIELD) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | croak "missing ordered-byte descriptor field '$field'" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 8991 | ▶ | if !exists $spec->{$field}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 310 | my %normalized = %$spec; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | $normalized{$_} = $normalized{$_} ? 1 : 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 310 | ▶ | for qw(include_delimiter prefix_little include_prefix); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | $normalized{$_} = defined($normalized{$_}) ? 0 + $normalized{$_} : 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 310 | ▶ | for qw( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | read_size read_budget_bytes read_batch_bytes message_batch_size | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | high_watermark low_watermark max_pending_bytes max_buffer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | read_mode fixed_size prefix_bytes consumer_abi_version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | consumer_ops_address | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 310 | return \%normalized; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 144 | ▶ | sub declare_framer ($base, $target, $definition) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
declare_framer: called CC=5 SCAR=17.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 144 | ▶ | croak 'a framer may be declared only for a Linux::Event ordered-byte subclass' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$target eq $base or not $target->isa($base)
MC/DC0%0/2
$target eq $base or not $target->isa($base)
$target eq $base
not $target->isa($base)
Truth table33%1/3
A or not(B)
A= $target eq $baseB= not $target->isa($base)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | if $target eq $base || !$target->isa($base); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | croak "$target already has an ordered-byte descriptor" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 144 | ▶ | if exists $CLASS_DESCRIPTOR{$target}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | croak "$target already declares a framer" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 144 | ▶ | if exists $FRAMER_DEFINITION{$target}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 143 | $FRAMER_DEFINITION{$target} = $definition; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 143 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 319 | ▶ | sub _framer_for ($class) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_framer_for: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 319 | for my $package (@{ mro::get_linear_isa($class) }) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | return $FRAMER_DEFINITION{$package} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 1033 | ▶ | if exists $FRAMER_DEFINITION{$package}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 183 | return undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 28 | ▶ | sub declare_consumer ($base, $target, $definition) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
declare_consumer: called CC=15 SCAR=32.7
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 28 | ▶ | croak 'a native consumer may be declared only for a Linux::Event ordered-byte subclass' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$target eq $base or not $target->isa($base)
MC/DC0%0/2
$target eq $base or not $target->isa($base)
$target eq $base
not $target->isa($base)
Truth table33%1/3
A or not(B)
A= $target eq $baseB= not $target->isa($base)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | if $target eq $base || !$target->isa($base); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | croak "$target already has an ordered-byte descriptor" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 28 | ▶ | if exists $CLASS_DESCRIPTOR{$target}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | croak "$target already declares a native consumer" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 28 | ▶ | if exists $CONSUMER_DEFINITION{$target}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 28 | ▶ | croak 'native consumer declaration must be a hash reference' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | if ref($definition) ne 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | my @unknown = grep { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 28 | ▶ | $_ ne 'provider' && $_ ne 'abi_version' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition83%5/6
$_ ne 'provider' && $_ ne 'abi_version' && $_ ne 'operations_address'
$_ ne "provider" and $_ ne "abi_version"
MC/DC0%0/3
$_ ne 'provider' && $_ ne 'abi_version' && $_ ne 'operations_address'
$_ ne "provider"
$_ ne "abi_version"
$_ ne 'operations_address'
Truth table75%3/4
A and B && C
A= $_ ne "provider"B= $_ ne "abi_version"C= $_ ne 'operations_address'
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | && $_ ne 'operations_address' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | } keys %$definition; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 28 | ▶ | croak 'native consumer declaration has unknown fields: ' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | . join(', ', sort @unknown) if @unknown; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | croak 'native consumer declaration requires provider' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 28 | ▶ | if !exists($definition->{provider}) || !defined($definition->{provider}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
exists $definition->{"provider"} and defined $definition->{"provider"}
MC/DC0%0/2
exists $definition->{"provider"} and defined $definition->{"provider"}
exists $definition->{"provider"}
defined $definition->{"provider"}
Truth table33%1/3
A and B
A= exists $definition->{"provider"}B= defined $definition->{"provider"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | croak 'native consumer declaration requires a positive integer abi_version' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | if !defined($definition->{abi_version}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 28 | ▶ | || $definition->{abi_version} !~ /\A[1-9]\d*\z/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $definition->{"abi_version"} and $definition->{"abi_version"} =~ /\A[1-9]\d*\z/u
MC/DC0%0/2
defined $definition->{"abi_version"} and $definition->{"abi_version"} =~ /\A[1-9]\d*\z/u
defined $definition->{"abi_version"}
$definition->{"abi_version"} =~ /\A[1-9]\d*\z/u
Truth table33%1/3
A and B
A= defined $definition->{"abi_version"}B= $definition->{"abi_version"} =~ /\A[1-9]\d*\z/u
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | croak 'native consumer declaration requires a positive operations_address' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | if !defined($definition->{operations_address}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 28 | ▶ | || $definition->{operations_address} !~ /\A[1-9]\d*\z/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $definition->{"operations_address"} and $definition->{"operations_address"} =~ /\A[1-9]\d*\z/u
MC/DC0%0/2
defined $definition->{"operations_address"} and $definition->{"operations_address"} =~ /\A[1-9]\d*\z/u
defined $definition->{"operations_address"}
$definition->{"operations_address"} =~ /\A[1-9]\d*\z/u
Truth table33%1/3
A and B
A= defined $definition->{"operations_address"}B= $definition->{"operations_address"} =~ /\A[1-9]\d*\z/u
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 28 | $CONSUMER_DEFINITION{$target} = { %$definition }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 28 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 319 | ▶ | sub _consumer_for ($class) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_consumer_for: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 319 | for my $package (@{ mro::get_linear_isa($class) }) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | return $CONSUMER_DEFINITION{$package} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 1457 | ▶ | if exists $CONSUMER_DEFINITION{$package}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 279 | return undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 333 | ▶ | sub _validate_tuning ($target, $option) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_validate_tuning: called CC=13 SCAR=26.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | croak "$target high_watermark must be a non-negative integer" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 333 | ▶ | if $option->{high_watermark} !~ /\A\d+\z/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | croak "$target low_watermark must be a non-negative integer" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 333 | ▶ | if $option->{low_watermark} !~ /\A\d+\z/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | croak "$target low_watermark must be <= high_watermark" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 333 | ▶ | if $option->{low_watermark} > $option->{high_watermark}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | croak "$target max_pending_bytes must be a non-negative integer" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 332 | ▶ | if $option->{max_pending_bytes} !~ /\A\d+\z/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | croak "$target read_size must be a positive integer" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 331 | ▶ | if $option->{read_size} !~ /\A\d+\z/ || $option->{read_size} <= 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
not $option->{"read_size"} =~ /\A\d+\z/u or $option->{"read_size"} <= 0
MC/DC50%1/2
not $option->{"read_size"} =~ /\A\d+\z/u or $option->{"read_size"} <= 0
not $option->{"read_size"} =~ /\A\d+\z/u
$option->{"read_size"} <= 0
Truth table66%2/3
not(A) or B
A= not $option->{"read_size"} =~ /\A\d+\z/uB= $option->{"read_size"} <= 0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | croak "$target read_budget_bytes must be a non-negative integer" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 330 | ▶ | if $option->{read_budget_bytes} !~ /\A\d+\z/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | croak "$target read_batch_bytes must be a non-negative integer" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 329 | ▶ | if $option->{read_batch_bytes} !~ /\A\d+\z/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | croak "$target message_batch_size must be a non-negative integer" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 328 | ▶ | if $option->{message_batch_size} !~ /\A\d+\z/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | croak "$target max_buffer must be a positive integer" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 327 | ▶ | if $option->{max_buffer} !~ /\A\d+\z/ || $option->{max_buffer} <= 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
not $option->{"max_buffer"} =~ /\A\d+\z/u or $option->{"max_buffer"} <= 0
MC/DC0%0/2
not $option->{"max_buffer"} =~ /\A\d+\z/u or $option->{"max_buffer"} <= 0
not $option->{"max_buffer"} =~ /\A\d+\z/u
$option->{"max_buffer"} <= 0
Truth table33%1/3
not(A) or B
A= not $option->{"max_buffer"} =~ /\A\d+\z/uB= $option->{"max_buffer"} <= 0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 327 | for my $name (qw(idle_timeout read_timeout write_timeout)) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | $option->{$name} = Linux::Event::_ByteStream::_timeout_value( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 979 | $target, $name, $option->{$name}, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 326 | return $option; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 17 | ▶ | sub merge_tuning ($target, $base, $override) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
merge_tuning: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 17 | ▶ | croak "$target tuning must be a hash reference" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | if ref($override) ne 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 17 | my @unknown = grep { !$TUNING_NAME{$_} } keys %$override; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 17 | ▶ | croak "$target tuning has unknown options: " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | . join(', ', sort @unknown) if @unknown; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 16 | my %option = (%$base, %$override); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 16 | _validate_tuning($target, \%option); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 16 | return \%option; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 319 | ▶ | sub _stream_tuning_for ($class) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_stream_tuning_for: called CC=6 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 319 | my %option = ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | high_watermark => 1_048_576, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | low_watermark => 262_144, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | max_pending_bytes => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | read_size => 65_536, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | read_budget_bytes => 65_536, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | read_batch_bytes => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | message_batch_size => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | max_buffer => 8_388_608, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | idle_timeout => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | read_timeout => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | write_timeout => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 319 | ▶ | if (my $configure = $class->can('stream_tuning')) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | 100 | my @configured = $configure->($class); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 100 | my %configured; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 100 | ▶ | if (@configured == 1 && ref($configured[0]) eq 'HASH') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
@configured == 1 and ref $configured[0] eq "HASH"
MC/DC100%2/2
@configured == 1 and ref $configured[0] eq "HASH"
@configured == 1
ref $configured[0] eq "HASH"
Truth table100%3/3
A and B
A= @configured == 1B= ref $configured[0] eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 1 | %configured = %{ $configured[0] }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 99 | ▶ | croak "$class stream_tuning() returned an odd option list" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | if @configured % 2; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 98 | %configured = @configured; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 99 | my @unknown = grep { !$TUNING_NAME{$_} } keys %configured; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 99 | ▶ | croak "$class stream_tuning() returned unknown options: " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | . join(', ', sort @unknown) if @unknown; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 98 | @option{keys %configured} = values %configured; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | 317 | _validate_tuning($class, \%option); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 310 | return \%option; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 65 | ▶ | sub validate_modes ($target, $descriptor, $tuning, $callbacks) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
validate_modes: called CC=14 SCAR=37.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 65 | ▶ | if (!$descriptor->{framer}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | croak "$target message_batch_size is available only to framed ordered-byte classes" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | 58 | ▶ | if $tuning->{message_batch_size}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | croak "$target on_message requires a framed ordered-byte class" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 58 | ▶ | if $callbacks->{on_message}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | croak "$target on_messages requires a framed ordered-byte class" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 57 | ▶ | if $callbacks->{on_messages}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 57 | ▶ | if ($descriptor->{consumer}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | croak "$target raw native consumer cannot be combined with read_batch_bytes" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 0 | ▶ | if $tuning->{read_batch_bytes}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | croak "$target on_data cannot be combined with a native consumer" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 0 | ▶ | if $callbacks->{on_data}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 57 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | croak "$target read_batch_bytes is available only to raw ordered-byte classes" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 7 | ▶ | if $tuning->{read_batch_bytes}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | croak "$target on_data requires a raw ordered-byte class" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 7 | ▶ | if $callbacks->{on_data}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 7 | ▶ | if ($descriptor->{consumer}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | croak "$target native consumer cannot be combined with message_batch_size" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | ▶ | if $tuning->{message_batch_size}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | croak "$target on_message cannot be combined with a native consumer" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 0 | ▶ | if $callbacks->{on_message}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | croak "$target on_messages cannot be combined with a native consumer" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | ▶ | if $callbacks->{on_messages}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 7 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | 51 | ▶ | sub effective_input_callback ($descriptor, $tuning, $callbacks = {}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
effective_input_callback: called CC=7 SCAR=19.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | 51 | ▶ | return undef if $descriptor->{consumer}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 51 | ▶ | if (!$descriptor->{framer}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | return exists($callbacks->{on_data}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | 46 | ▶ | ? $callbacks->{on_data} : $descriptor->{callbacks}{on_data}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 5 | ▶ | my $name = $tuning->{message_batch_size} ? 'on_messages' : 'on_message'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | return exists($callbacks->{$name}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 5 | ▶ | ? $callbacks->{$name} : $descriptor->{callbacks}{$name}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | 309 | ▶ | sub _native_for ($option, $callback, $framing, $consumer) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_native_for: called CC=10 SCAR=23.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | return Linux::Event::_ByteStream::Descriptor::Native->new({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | read_size => $option->{read_size}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | read_budget_bytes => $option->{read_budget_bytes}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | read_batch_bytes => $option->{read_batch_bytes}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | message_batch_size => $option->{message_batch_size}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | high_watermark => $option->{high_watermark}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | low_watermark => $option->{low_watermark}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | max_pending_bytes => $option->{max_pending_bytes}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | max_buffer => $option->{max_buffer}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | read_mode => $framing->{read_mode}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | deliver_cb => $callback->{on_data}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | message_cb => $callback->{on_message}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | message_batch_cb => $callback->{on_messages}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | drain_cb => $callback->{on_drain} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | ? \&Linux::Event::_ByteStream::_xs_drain : undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | eof_cb => \&Linux::Event::_ByteStream::_xs_read_eof, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | read_error_cb => \&Linux::Event::_ByteStream::_xs_read_error, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | write_error_cb => \&Linux::Event::_ByteStream::_xs_write_error, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | output_limit_cb => \&Linux::Event::_ByteStream::_xs_output_limit, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | write_empty_cb => \&Linux::Event::_ByteStream::_xs_write_empty, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | framing_error_cb => \&Linux::Event::_ByteStream::_xs_framing_error, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | delimiter => $framing->{delimiter}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | include_delimiter => $framing->{include_delimiter} // 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | max_frame => $framing->{max_frame}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | fixed_size => $framing->{fixed_size} // 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | prefix_bytes => $framing->{prefix_bytes} // 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | prefix_little => $framing->{prefix_little} // 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | include_prefix => $framing->{include_prefix} // 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | consumer_provider => $consumer ? $consumer->{provider} : undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | consumer_abi_version => $consumer ? $consumer->{abi_version} : 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | consumer_ops_address => $consumer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | 309 | ▶ | ? $consumer->{operations_address} : 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
Condition100%10/10
$framing->{"include_delimiter"} // 0
$framing->{"fixed_size"} // 0
$framing->{"prefix_bytes"} // 0
$framing->{"prefix_little"} // 0
$framing->{"include_prefix"} // 0
MC/DC100%1/1
$framing->{"include_delimiter"} // 0
$framing->{"include_delimiter"}
MC/DC100%1/1
$framing->{"fixed_size"} // 0
$framing->{"fixed_size"}
MC/DC100%1/1
$framing->{"prefix_bytes"} // 0
$framing->{"prefix_bytes"}
MC/DC100%1/1
$framing->{"prefix_little"} // 0
$framing->{"prefix_little"}
MC/DC100%1/1
$framing->{"include_prefix"} // 0
$framing->{"include_prefix"}
Truth table100%2/2
A
A= $framing->{"include_delimiter"}
Truth table100%2/2
A
A= $framing->{"fixed_size"}
Truth table100%2/2
A
A= $framing->{"prefix_bytes"}
Truth table100%2/2
A
A= $framing->{"prefix_little"}
Truth table100%2/2
A
A= $framing->{"include_prefix"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | 103388 | ▶ | sub for_class ($class) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
for_class: called CC=22 SCAR=30.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | return $CONSTRUCTION_DESCRIPTOR{$class} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 103388 | ▶ | if exists $CONSTRUCTION_DESCRIPTOR{$class}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | 102277 | ▶ | return $CLASS_DESCRIPTOR{$class} if exists $CLASS_DESCRIPTOR{$class}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | 322 | ▶ | croak 'Linux::Event::_ByteStream is a private implementation base; subclass a public ordered-byte leaf' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | if $class eq 'Linux::Event::_ByteStream'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | 321 | ▶ | croak "$class is not a Linux::Event ordered-byte class" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | if !$class->isa('Linux::Event::_ByteStream'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | 321 | my $is_stream_socket = $class->isa('Linux::Event::_Socket::Stream'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | 321 | ▶ | if (!$is_stream_socket) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | 39 | ▶ | croak "$class defines socket_options() but is not a Linux::Event stream-socket class" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | if $class->can('socket_options'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | 38 | ▶ | croak "$class defines configure_socket() but is not a Linux::Event stream-socket class" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | if $class->can('configure_socket'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | 319 | my $framer = _framer_for($class); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | 319 | my $consumer = _consumer_for($class); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | 319 | my $option = _stream_tuning_for($class); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | 310 | my %callback = map { $_ => scalar $class->can($_) } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | qw(on_data on_message on_messages on_drain on_eof on_error on_close | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | on_ready on_transport_ready); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | 310 | ▶ | if ($framer) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | croak "$class read_batch_bytes is available only to raw ordered-byte classes" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | 135 | ▶ | if $option->{read_batch_bytes}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | croak "$class cannot define on_data() when it declares a framer" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | 134 | ▶ | if $callback{on_data}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | 133 | ▶ | if ($consumer) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | croak "$class native consumer cannot be combined with message_batch_size" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | 34 | ▶ | if $option->{message_batch_size}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | croak "$class native consumer cannot be combined with on_message()" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 34 | ▶ | if $callback{on_message}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | croak "$class native consumer cannot be combined with on_messages()" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | 33 | ▶ | if $callback{on_messages}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | croak "$class defines on_message() but does not declare a framer" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | 175 | ▶ | if $callback{on_message}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | croak "$class defines on_messages() but does not declare a framer" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | 175 | ▶ | if $callback{on_messages}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | croak "$class message_batch_size is available only to framed ordered-byte classes" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | 174 | ▶ | if $option->{message_batch_size}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | 173 | ▶ | if ($consumer) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | croak "$class raw native consumer cannot be combined with read_batch_bytes" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | 6 | ▶ | if $option->{read_batch_bytes}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | croak "$class native consumer cannot be combined with on_data()" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | 5 | ▶ | if $callback{on_data}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | 303 | ▶ | my $framing = $framer ? { %{ $framer->{native} } } : { read_mode => 0 }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | 303 | my $native = _native_for($option, \%callback, $framing, $consumer); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | 296 | my $descriptor = { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | class => $class, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | native => $native, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | options => $option, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | framing => $framing, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | framer => $framer, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | consumer => $consumer, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | callbacks => \%callback, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | 296 | $CLASS_DESCRIPTOR{$class} = $descriptor; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | 296 | return $descriptor; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | 50 | ▶ | sub prepared ($class, $override = {}, $callback_override = {}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
prepared: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | 50 | ▶ | croak "$class Listener stream callbacks must be a hash reference" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | if ref($callback_override) ne 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | 50 | my $base = for_class($class); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | 50 | ▶ | return $base if !%$override && !%$callback_override; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
%$override or %$callback_override
MC/DC100%2/2
%$override or %$callback_override
%$override
%$callback_override
Truth table100%3/3
A or B
A= %$overrideB= %$callback_override
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | my $option = merge_tuning( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | 7 | "$class Listener stream", $base->{options}, $override, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | 7 | my %callback = (%{ $base->{callbacks} }, %$callback_override); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | 7 | validate_modes("$class Listener stream", $base, $option, \%callback); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | my $native = _native_for( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | $option, \%callback, $base->{framing}, $base->{consumer}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | 6 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | return { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | 6 | %$base, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | native => $native, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | options => $option, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | callbacks => \%callback, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | prepared_from => $base, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | 1111 | ▶ | sub with_prepared ($class, $descriptor, $constructor, @arg) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
with_prepared: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | 1111 | ▶ | croak 'internal prepared Stream constructor must be a coderef' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | if ref($constructor) ne 'CODE'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | 1111 | local $CONSTRUCTION_DESCRIPTOR{$class} = $descriptor; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | 1111 | return $constructor->($class, @arg); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | 0 | ▶ | sub clear_cache () { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
clear_cache: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | 0 | %CLASS_DESCRIPTOR = (); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | 127 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||