component_locator_i.py
ofrak.service.component_locator_i
ComponentFilter (ABC)
dataclass
ComponentFilter()
filter(self, components)
Filter out components according to the rules this component enforces.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
components |
Set[ofrak.component.interface.ComponentInterface] |
Components to filter |
required |
Returns:
Type | Description |
---|---|
Set[ofrak.component.interface.ComponentInterface] |
All components which this filter allows |
Source code in ofrak/service/component_locator_i.py
@abstractmethod
def filter(self, components: Set[ComponentInterface]) -> Set[ComponentInterface]:
"""
Filter out components according to the rules this component enforces.
:param components: Components to filter
:return: All components which this filter allows
"""
raise NotImplementedError()
ComponentLocatorInterface
get_components_matching_filter(self, component_filter)
Get all components matching the given filter.
Source code in ofrak/service/component_locator_i.py
@abstractmethod
def get_components_matching_filter(
self, component_filter: ComponentFilter
) -> Set[ComponentInterface]:
"""
Get all components matching the given filter.
"""