NAME

IPC::Shm::Tied

SYNOPSIS

This class is part of the IPC::Shm implementation.

use IPC::Shm;
my $obj = tie my %foo, 'IPC::Shm::Tied';
$obj->tiedref( \%foo );

You may use this module to tie lexicals as above, but if used on a package variable, it will behave as a lexical and be destroyed when all connections are closed.

If the call to $obj->tiedref is omitted, another tied reference will be created when another shared variable's reference to this one is dereferenced. This is not desirable behavior.

Optionally takes an IPC::Shm::Segment object as an argument. If none is supplied, IPC::Shm::Segment-anonymous> is called.

It is simpler to use the : shm interface. See perldoc IPC::Shm.

SUPERCLASS

This class is a derivative of IPC::Shm::Segment, which in turn is a derivative of IPC::Shm::Simple.

CONSTRUCTORS

TIEHASH, TIEARRAY, TIESCALAR

This package supports the tie() call.

$this->retie

When an anonymous variable is dereferenced, and in some other circumstances, it has to be tied to a variable so it can be accessed normally.

DESTRUCTOR

$this->DETACH

Called from IPC::Shm::Simple when the last in-process instance of this same segment is being DESTROYed.

TIED REFERENCE RETRIEVAL

$this->tiedref

Retrieves a reference to the object's associated tied variable. Calls retie() when necessary.

$this->tiedref( $reference )

Stores a reference to the object's associated tied variable. This allows retie() to be avoided most of the time.

$this->tiedref_clean

Removes the object's tied reference from the cache.

$this->standin_tiedref( $standin )

Returns a reference to the tied variable, given a standin hash. See IPC::Shm::Segment for more about standins.

$this->reftype( $reftype )

Stores the type of object the associated reference points to. This makes the retie() method possible for anonymous segments.

Valid values are 'HASH', 'ARRAY', and 'SCALAR'.

$this->reftype

Retrieves the reference type stored above.

VALUE CACHE METHODS

$this->vcache

Retrieves the cached copy of the deserializer's last run.

$this->vcache( $newvalue )

Stores a new cached value, discarding the old. The Storable module expects this to be a reference (no raw strings).

$this->vcache_clean

Removes the object's value cache from in-process memory.

$class->EMPTY

Returns a reference to an empty object, compatible with the vcache method above. This is an abstract method and must be implemented by inheriting classes.

SERIALIZE/DESERIALIZE

$this->FRESH

Called by IPC::Shm::Simple->fetch when a new value is actually read in from shared memory. The deserializing step happens here.

$this->flush

Serializes and writes the contents of the value cache to shared memory.

AUTHOR

Kevin Cody-Little <kcody@cpan.org>