blackfennec.layers.encapsulation_base package
Submodules
blackfennec.layers.encapsulation_base.base_factory_visitor module
- class blackfennec.layers.encapsulation_base.base_factory_visitor.BaseFactoryVisitor(layer, layer_base_class)[source]
Bases:
Visitor
[T
]Abstract Factory and Visitor
- This class implements the base visitor behaviour
and returns the input wrapped in an adapter/decorator like manner while caching the generated generic adapter/decorator classes.
- Python does not support overloading by Type, thus the visit
function are present for all existing core types.
blackfennec.layers.encapsulation_base.encapsulation_base module
- class blackfennec.layers.encapsulation_base.encapsulation_base.EncapsulationBase(layer, subject: Structure)[source]
Bases:
Structure
,ChangeNotificationDispatchMixin
Is the base class of the abstract visitor BaseFactoryVisitor, which means that any created object of the abstract visitor has the super class EncapsulationBase or a specialisation.
- property parent
Property for parent of this structure encapsulated in a EncapsulationBase.
- property root
Property for root of this structure encapsulated in an FactoryBase.
- Returns
encapsulates root of subject in FactoryBase class
- Return type
- property structure
- property subject
Property for access on encapsulated structure in this EncapsulationBase.
- property value
Property for value of this structure.
blackfennec.layers.encapsulation_base.list_encapsulation_base module
- class blackfennec.layers.encapsulation_base.list_encapsulation_base.ListEncapsulationBase(**kwargs)[source]
Bases:
EncapsulationBase
,List
Base Class for ecapsulations of a List.
- Contains List specific overrides of certain functions
to ensure the encapsulation of any Structure returned in order to stay in the encapsulation layer.
- add_item(item: Structure)[source]
Append item to list type.
- Parameters
item (Structure) – Item to append.
- remove_item(item: Structure)[source]
Remove item from List.
- Parameters
item (Structure) – Item to remove.
- Raises
KeyError – If the item passed is not in list and hence cannot be removed.
- replace_item(old_item: Structure, new_item: Structure) None [source]
Replace old_item with new_item.
- property value
Property for value of this structure.
blackfennec.layers.encapsulation_base.map_encapsulation_base module
- class blackfennec.layers.encapsulation_base.map_encapsulation_base.MapEncapsulationBase(**kwargs)[source]
Bases:
EncapsulationBase
,Map
Base Class for Encapsulation of a Map.
- add_item(key, value: Structure)[source]
Custom set item hook, adds self as parent or raises error.
- Parameters
key (str) – The key for the inserted item.
value (Structure) – The item which will be inserted.
- Raises
ValueError – If the key already exists
- remove_item(key)[source]
Custom delete hook, resets parent for removed structure.
- Parameters
key (any) – The key of the item to delete.
- Raises
KeyError – If the item with the key to delete is not contained in map.
- property value
Property for value of this structure.
blackfennec.layers.encapsulation_base.reference_encapsulation_base module
- class blackfennec.layers.encapsulation_base.reference_encapsulation_base.ReferenceEncapsulationBase(**kwargs)[source]
Bases:
EncapsulationBase
Reference implementation of the EncapsulationBase class.
This class is used to provide a reference implementation of the EncapsulationBase class.