Package viff :: Module runtime :: Class Share
[hide private]
[frames] | no frames]

Class Share

source code


A shared number.

The Runtime operates on shares, represented by this class. Shares are asynchronous in the sense that they promise to attain a value at some point in the future.

Shares overload the arithmetic operations so that x = a + b will create a new share x, which will eventually contain the sum of a and b. Each share is associated with a Runtime and the arithmetic operations simply call back to that runtime.

Instance Methods [hide private]
 
__add__(self, other)
Addition.
source code
 
__del__(self) source code
 
__eq__(self, other)
Equality testing.
source code
 
__ge__(self, other)
Greater-than or equal comparison.
source code
 
__gt__(self, other)
Strictly greater-than comparison.
source code
 
__init__(self, runtime, field, value=None)
Initialize a share.
source code
 
__le__(self, other)
Less-than or equal comparison.
source code
 
__lt__(self, other)
Strictly less-than comparison.
source code
 
__mul__(self, other)
Multiplication.
source code
 
__neq__(self, other)
Negated equality testing.
source code
 
__pow__(self, exponent)
Exponentation to known integer exponents.
source code
 
__radd__(self, other)
Addition (reflected argument version).
source code
 
__rmul__(self, other)
Multiplication (reflected argument version).
source code
 
__rsub__(self, other)
Subtraction (reflected argument version).
source code
 
__rxor__(self, other)
Exclusive-or (reflected argument version).
source code
 
__sub__(self, other)
Subtraction.
source code
 
__xor__(self, other)
Exclusive-or.
source code
 
clone(self)
Clone a share.
source code
 
label(self) source code
 
old_init(self, runtime, field, value=None)
Initialize a share.
source code

Inherited from twisted.internet.defer.Deferred: __repr__, __str__, addBoth, addCallback, addCallbacks, addErrback, callback, chainDeferred, errback, pause, setTimeout, unpause

Inherited from twisted.internet.defer.Deferred (private): _continue, _runCallbacks, _startRunCallbacks

Class Variables [hide private]

Inherited from twisted.internet.defer.Deferred: called, debug, paused, timeoutCall

Inherited from twisted.internet.defer.Deferred (private): _debugInfo

Method Details [hide private]

__init__(self, runtime, field, value=None)
(Constructor)

source code 

Initialize a share.

If an initial value is given, it will be passed to callback right away.

Overrides: twisted.internet.defer.Deferred.__init__

clone(self)

source code 

Clone a share.

Works like util.clone_deferred except that it returns a new Share instead of a Deferred.

old_init(self, runtime, field, value=None)

source code 

Initialize a share.

If an initial value is given, it will be passed to callback right away.