Zend Framework  3.0
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Movable Class Reference

Memory value container. More...

Public Member Functions

 __construct (Memory\MemoryManager $memoryManager, $id, $value)
 Object constructor.
 
 lock ()
 Lock object in memory.
 
 unlock ()
 Unlock object.
 
 isLocked ()
 Return true if object is locked.
 
 __get ($property)
 Get handler.
 
 __set ($property, $value)
 Set handler.
 
getRef ()
 Get string value reference.
 
 touch ()
 Signal, that value is updated by external code.
 
 processUpdate ()
 Process container value update.
 
 startTrace ()
 Start modifications trace.
 
 setValue ($value)
 Set value (used by memory manager when value is loaded)
 
 unloadValue ()
 Clear value (used by memory manager when value is swapped)
 
 markAsSwapped ()
 Mark, that object is swapped.
 
 isSwapped ()
 Check if object is marked as swapped.
 
 getId ()
 Get object id.
 
 destroy ()
 Destroy memory container and remove it from memory manager list.
 

Public Attributes

const LOADED = 1
 Value states.
 
const SWAPPED = 2
 
const LOCKED = 4
 

Protected Attributes

 $id
 

Detailed Description

Memory value container.

Movable (may be swapped with specified backend and unloaded).

Constructor & Destructor Documentation

__construct ( Memory\MemoryManager  $memoryManager,
  $id,
  $value 
)

Object constructor.

Parameters
\Zend\Memory\MemoryManager$memoryManager
int$id
string$value

Member Function Documentation

__get (   $property)

Get handler.

Loads object if necessary and moves it to the top of loaded objects list. Swaps objects from the bottom of loaded objects list, if necessary.

Parameters
string$property
Returns
string
Exceptions
Exception\InvalidArgumentException
__set (   $property,
  $value 
)

Set handler.

Parameters
string$property
string$value
Exceptions
Exception\InvalidArgumentException
destroy ( )

Destroy memory container and remove it from memory manager list.

We don't clean up swap because of performance considerations Cleaning is performed by Memory Manager destructor

getId ( )

Get object id.

& getRef ( )

Get string value reference.

_Must_ be used for value access before PHP v 5.2 or _may_ be used for performance considerations

Returns
&string

Implements ContainerInterface.

isLocked ( )

Return true if object is locked.

Returns
bool

Implements ContainerInterface.

isSwapped ( )

Check if object is marked as swapped.

lock ( )

Lock object in memory.

Todo:
It's possible to set "value" container attribute to avoid modification tracing, while it's locked Check, if it's more effective

Implements ContainerInterface.

markAsSwapped ( )

Mark, that object is swapped.

processUpdate ( )

Process container value update.

Must be called only by value object

setValue (   $value)

Set value (used by memory manager when value is loaded)

startTrace ( )

Start modifications trace.

touch ( )

Signal, that value is updated by external code.

Should be used together with getRef()

Implements ContainerInterface.

unloadValue ( )

Clear value (used by memory manager when value is swapped)

unlock ( )

Unlock object.

Implements ContainerInterface.

Member Data Documentation

$id
protected
const LOADED = 1

Value states.

const LOCKED = 4
const SWAPPED = 2