Zend Framework  1.12
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Zend_Memory_Container_Movable Class Reference

Public Member Functions

 __construct (Zend_Memory_Manager $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
 

Constructor & Destructor Documentation

__construct ( Zend_Memory_Manager  $memoryManager,
  $id,
  $value 
)

Object constructor.

Parameters
Zend_Memory_Manager$memoryManager
integer$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
Zend_Memory_Exception
__set (   $property,
  $value 
)

Set handler.

Parameters
string$property
string$value
Exceptions
Zend_Exception
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 Zend_Memory_Container_Interface.

isLocked ( )

Return true if object is locked.

Returns
boolean

Implements Zend_Memory_Container_Interface.

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 Zend_Memory_Container_Interface.

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 Zend_Memory_Container_Interface.

unloadValue ( )

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

unlock ( )

Unlock object.

Implements Zend_Memory_Container_Interface.

Member Data Documentation

$_id
protected
const LOADED = 1

Value states.

const LOCKED = 4
const SWAPPED = 2