gravitino.api.function.function_change.AddDefinition

class gravitino.api.function.function_change.AddDefinition(definition: FunctionDefinition)

Bases: FunctionChange

A FunctionChange to add a new definition to a function.

__init__(definition: FunctionDefinition)

Methods

__init__(definition)

add_definition(definition)

Create a FunctionChange to add a new definition (overload) to a function.

add_impl(parameters, implementation)

Create a FunctionChange to add an implementation to a specific definition.

definition()

Returns the definition to add.

remove_definition(parameters)

Create a FunctionChange to remove an existing definition from a function.

remove_impl(parameters, runtime)

Create a FunctionChange to remove an implementation for a specific definition.

update_comment(new_comment)

Create a FunctionChange to update the comment of a function.

update_impl(parameters, runtime, implementation)

Create a FunctionChange to update an implementation for a specific definition.

Attributes

EMPTY_PARAMS

An empty list of parameters.

EMPTY_PARAMS: List[FunctionParam] = []

An empty list of parameters.

static add_definition(definition: FunctionDefinition) FunctionChange

Create a FunctionChange to add a new definition (overload) to a function.

Args:

definition: The new definition to add.

Returns:

The change instance.

static add_impl(parameters: List[FunctionParam], implementation: FunctionImpl) FunctionChange

Create a FunctionChange to add an implementation to a specific definition.

Args:

parameters: The parameters that identify the definition to update. implementation: The implementation to add.

Returns:

The change instance.

definition() FunctionDefinition

Returns the definition to add.

static remove_definition(parameters: List[FunctionParam]) FunctionChange

Create a FunctionChange to remove an existing definition from a function.

Args:

parameters: The parameters that identify the definition to remove.

Returns:

The change instance.

static remove_impl(parameters: List[FunctionParam], runtime: RuntimeType) FunctionChange

Create a FunctionChange to remove an implementation for a specific definition.

Args:

parameters: The parameters that identify the definition to update. runtime: The runtime that identifies the implementation to remove.

Returns:

The change instance.

static update_comment(new_comment: str) FunctionChange

Create a FunctionChange to update the comment of a function.

Args:

new_comment: The new comment value.

Returns:

The change instance.

static update_impl(parameters: List[FunctionParam], runtime: RuntimeType, implementation: FunctionImpl) FunctionChange

Create a FunctionChange to update an implementation for a specific definition.

Args:

parameters: The parameters that identify the definition to update. runtime: The runtime that identifies the implementation to replace. implementation: The new implementation.

Returns:

The change instance.