Package foolscap :: Module broker :: Class PBRootUnslicer
[hide private]
[frames] | no frames]

Class PBRootUnslicer

source code

           object --+        
                    |        
  slicer.BaseUnslicer --+    
                        |    
slicers.root.RootUnslicer --+
                            |
                           PBRootUnslicer
Known Subclasses:

Nested Classes [hide private]

Inherited from slicer.BaseUnslicer: __metaclass__

Instance Methods [hide private]
 
checkToken(self, typebyte, size) source code
 
openerCheckToken(self, typebyte, size, opentype) source code
 
open(self, opentype)
Return an IUnslicer object based upon the 'opentype' tuple.
source code
 
doOpen(self, opentype)
Return an IUnslicer object based upon the 'opentype' tuple.
source code
 
reportViolation(self, f) source code
 
receiveChild(self, token, ready_deferred)
Unslicers for containers should accumulate their children's ready_deferreds, then combine them in an AsyncAND when receiveClose() happens, and return the AsyncAND as the ready_deferreds half of the receiveClose() return value.
source code

Inherited from slicers.root.RootUnslicer: __init__, describe, getObject, receiveClose, setConstraint, setObject, start

Inherited from slicer.BaseUnslicer: __providedBy__, explode, finish

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  topRegistries = [{('answer'): <class 'foolscap.call.AnswerUnsl...
  openRegistries = [{('boolean'): <class 'foolscap.slicers.bool....
  logViolations = False

Inherited from slicers.root.RootUnslicer: constraint, openCount

Inherited from slicer.BaseUnslicer: __implemented__, __provides__, opentype

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

checkToken(self, typebyte, size)

source code 
Overrides: slicer.BaseUnslicer.checkToken

openerCheckToken(self, typebyte, size, opentype)

source code 
Overrides: slicer.BaseUnslicer.openerCheckToken

open(self, opentype)

source code 

Return an IUnslicer object based upon the 'opentype' tuple. Subclasses that wish to change the way opentypes are mapped to Unslicers can do so by changing this behavior.

This method does not apply constraints, it only serves to map opentype into Unslicer. Most subclasses will implement this by delegating the request to their parent (and thus, eventually, to the RootUnslicer), and will set the new child's .opener attribute so that they can do the same. Subclasses that wish to change the way opentypes are mapped to Unslicers can do so by changing this behavior.

Overrides: slicer.BaseUnslicer.open
(inherited documentation)

doOpen(self, opentype)

source code 

Return an IUnslicer object based upon the 'opentype' tuple. This object will receive all tokens destined for the subnode.

If you want to enforce a constraint, you must override this method and do two things: make sure your constraint accepts the opentype, and set a per-item constraint on the new child unslicer.

This method gets the IUnslicer from our .open() method. That might return None instead of a child unslicer if the they want a multi-token opentype tuple, so be sure to check for Noneness before adding a per-item constraint.

Overrides: slicer.BaseUnslicer.doOpen
(inherited documentation)

reportViolation(self, f)

source code 
Overrides: slicer.BaseUnslicer.reportViolation

receiveChild(self, token, ready_deferred)

source code 

Unslicers for containers should accumulate their children's ready_deferreds, then combine them in an AsyncAND when receiveClose() happens, and return the AsyncAND as the ready_deferreds half of the receiveClose() return value.

Overrides: slicer.BaseUnslicer.receiveChild
(inherited documentation)

Class Variable Details [hide private]

topRegistries

Value:
[{('answer'): <class 'foolscap.call.AnswerUnslicer'>,
  ('call'): <class 'foolscap.call.CallUnslicer'>,
  ('error'): <class 'foolscap.call.ErrorUnslicer'>}]

openRegistries

Value:
[{('boolean'): <class 'foolscap.slicers.bool.BooleanUnslicer'>,
  ('decimal'): <class 'foolscap.slicers.decimal_slicer.DecimalUnslicer\
'>,
  ('dict'): <class 'foolscap.slicers.dict.DictUnslicer'>,
  ('immutable-set'): <class 'foolscap.slicers.set.FrozenSetUnslicer'>,
  ('list'): <class 'foolscap.slicers.list.ListUnslicer'>,
  ('none'): <class 'foolscap.slicers.none.NoneUnslicer'>,
  ('reference'): <class 'foolscap.slicer.ReferenceUnslicer'>,
...