avl._core.component module

class avl._core.component.Component(*args: Any, **kwargs: Any)[source]
__init__(name: str, parent: Component) None[source]

Initialize Component.

Parameters:
  • name (str) – Name of the component.

  • parent (Component) – Parent component.

add_child(child: Component) None[source]

Add a child component.

Parameters:

child (Component) – Child component to add.

get_child(name: str) Component | None[source]

Get a child component by name.

Parameters:

name (str) – Name of the child component.

Returns:

Child component.

Return type:

Component

get_num_children() int[source]

Get the number of child components.

Returns:

Number of child components.

Return type:

int

get_children() list[Component][source]

Get all child components.

Returns:

List of child components.

Return type:

list

async start() None[source]

Start the component and execute its phases.

raise_objection(phase: Phase | None = None, obj: Object | None = None) None[source]

Raise an objection for the current phase.

Parameters:
  • phase (Phase) – Phase to raise objection for.

  • obj (Component) – Object raising the objection.

drop_objection(phase: Phase | None = None, obj: Object | None = None) None[source]

Drop an objection for the current phase.

Parameters:
  • phase (Phase) – Phase to drop objection for.

  • obj (Component) – Object dropping the objection.