Logo Search packages:      
Sourcecode: virtualbox-ose version File versions

python::client::WeakReference Class Reference

List of all members.

Detailed Description

A weak-reference object.  You construct a weak reference by passing
any COM object you like.  If the object does not support weak
refs, you will get a standard NS_NOINTERFACE exception.

Once you have a weak-reference, you can "call" the object to get
back a strong reference.  Eg:

>>> some_ob = components.classes['...']
>>> weak_ref = WeakReference(some_ob)
>>> new_ob = weak_ref() # new_ob is effectively "some_ob" at this point
>>> # EXCEPT: new_ob may be None if some_ob has already died - a
>>> # weak reference does not keep the object alive (that is the point)

You should never hold onto this resulting strong object for a long time,
or else you defeat the purpose of the weak-reference.

Definition at line 499 of file __init__.py.

Public Member Functions

def __call__
def __init__

Private Attributes


The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index