| 1 | package IPC::Shm::Tied::SCALAR; | ||||||||||||||||||||||||||||
| 2 | 6 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 6 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 6 | ▶ | use Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | # | ||||||||||||||||||||||||||||
| 7 | # Copyright (c) 2014 by Kevin Cody-Little <kcody@cpan.org> | ||||||||||||||||||||||||||||
| 8 | # | ||||||||||||||||||||||||||||
| 9 | # This code may be modified or redistributed under the terms | ||||||||||||||||||||||||||||
| 10 | # of either the Artistic or GNU General Public licenses, at | ||||||||||||||||||||||||||||
| 11 | # the modifier or redistributor's discretion. | ||||||||||||||||||||||||||||
| 12 | # | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | =head1 NAME | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | IPC::Shm::Tied::HASH | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | This class is part of the IPC::Shm implementation. You should not be using it directly. | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | =cut | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | # Loaded from IPC::Shm::Tied, so don't reload it | ||||||||||||||||||||||||||||
| 25 | 6 | ▶ | use vars qw( @ISA ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 26 | 6 | @ISA = qw( IPC::Shm::Tied ); | |||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 6 | ▶ | use IPC::Shm::Make; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 9 | ▶ | sub EMPTY { | ||||||||||||||||||||||||||
|
Subroutine
EMPTY: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 32 | 9 | return \undef; | |||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 7 | ▶ | sub TIESCALAR { | ||||||||||||||||||||||||||
|
Subroutine
TIESCALAR: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 36 | 7 | my ( $class, $this ) = @_; | |||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 7 | return bless $this, $class; | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 35 | ▶ | sub FETCH { | ||||||||||||||||||||||||||
|
Subroutine
FETCH: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||
| 42 | 35 | my ( $this ) = @_; | |||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 35 | my $locked = $this->readlock; | |||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 35 | $this->fetch; | |||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | 35 | ▶ | $this->unlock if $locked; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 35 | my $rv = ${$this->vcache}; | |||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | 35 | ▶ | return ref( $rv ) ? getback( $rv ) : $rv; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 14 | ▶ | sub STORE { | ||||||||||||||||||||||||||
|
Subroutine
STORE: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||
| 56 | 14 | my ( $this, $value ) = @_; | |||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | 14 | makeshm( \$value ); | |||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | 14 | my $locked = $this->writelock; | |||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | 14 | $this->fetch; | |||||||||||||||||||||||||||
| 63 | 14 | my $oldval = ${$this->vcache}; | |||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | 14 | $this->vcache( \$value ); | |||||||||||||||||||||||||||
| 66 | 14 | $this->flush; | |||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | 14 | ▶ | $this->unlock if $locked; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | 14 | ▶ | $this->standin_discard( $oldval ) if ( $oldval and ref( $oldval ) ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$oldval and ref $oldval
MC/DC100%2/2
$oldval and ref $oldval
$oldval
ref $oldval
Truth table100%3/3
A and B
A= $oldvalB= ref $oldval
| |||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | 14 | return $value; | |||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | 2 | ▶ | sub CLEAR { | ||||||||||||||||||||||||||
|
Subroutine
CLEAR: called CC=4 SCAR=14.1
| |||||||||||||||||||||||||||||
| 76 | 2 | my ( $this ) = @_; | |||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | 2 | my $locked = $this->writelock; | |||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||
| 80 | 2 | $this->fetch; | |||||||||||||||||||||||||||
| 81 | 2 | my $oldval = ${$this->vcache}; | |||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||
| 83 | 2 | $this->vcache( $this->EMPTY ); | |||||||||||||||||||||||||||
| 84 | 2 | $this->flush; | |||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||
| 86 | 2 | ▶ | $this->unlock if $locked; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | 2 | ▶ | $this->standin_discard( $oldval ) if ( $oldval and ref( $oldval ) ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$oldval and ref $oldval
MC/DC0%0/2
$oldval and ref $oldval
$oldval
ref $oldval
Truth table33%1/3
A and B
A= $oldvalB= ref $oldval
| |||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | 2 | return 1; | |||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||
| 95 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||
| 97 | Kevin Cody-Little <kcody@cpan.org> | ||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||
| 99 | =cut | ||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||
| 101 | 6 | 1; | |||||||||||||||||||||||||||