tierkreis.idl.models¶
Tierkreis IDL models representation used for TSP parsing.
Module Contents¶
Classes¶
A Tierkreis worker generic type. |
|
A Tierkreis worker method argument. |
|
A Tierkreis worker method. |
|
A Tierkreis worker interface. |
|
A Tierkreis worker model. |
API¶
- class tierkreis.idl.models.GenericType¶
A Tierkreis worker generic type.
Represents a single (composed) type in worker definitions.
- Fields:
origin (ElementaryType): The base type, e.g., str in list[str]. args: (Sequence[GenericType | str]) The nested types.
e.g., list[str] in set[list[str]]
- origin: tierkreis.idl.models.ElementaryType = None¶
- args: Sequence[GenericType | str] = None¶
- classmethod from_type(t: type) Self¶
Construct a generic type from a python type.
- Parameters:
t (type) – The python type.
- Returns:
The Tierkreis type.
- Return type:
Self
- included_structs() set[GenericType]¶
Find the included structs of this type.
A struct is an instance of RestrictedNamedTuple or opaque strings. :return: The list of structs :rtype: set[GenericType]
- class tierkreis.idl.models.TypedArg¶
A Tierkreis worker method argument.
Represents a single argument to a tasks in a worker. :fields:
name (str): The argument name. t (GenericType): The argument type. has_default(bool): Whether the argument has a default value.
- t: tierkreis.idl.models.GenericType = None¶
- class tierkreis.idl.models.Method¶
A Tierkreis worker method.
Represents a tasks in a worker.
- Fields:
name (str): The method name. args (list[TypedArg]): The list of method arguments. return_type (GenericType): The method return type. return_type_is_portmapping (bool): Whether the return_type is a portmapping.
- name: tierkreis.idl.models.GenericType = None¶
- args: list[tierkreis.idl.models.TypedArg] = None¶
- return_type: tierkreis.idl.models.GenericType = None¶
- class tierkreis.idl.models.Interface¶
A Tierkreis worker interface.
Represents a list of tasks contained in the worker.
- Fields:
name (str): The worker name. methods (list[Method]): The available tasks in the worker.
- methods: list[tierkreis.idl.models.Method] = None¶
- class tierkreis.idl.models.Model¶
A Tierkreis worker model.
Represents a type in a worker.
- Fields:
is_portmapping (bool): Whether the model is a portmapping. t (GenericType): The type of the model. decl (list[TypedArg]) The list of its typed arguments.
- t: tierkreis.idl.models.GenericType = None¶
- decls: list[tierkreis.idl.models.TypedArg] = None¶
- __lt__(other: tierkreis.idl.models.Model) bool¶
Check order of two models.
Uses lexicographical ordering of the origin of the models (generic) types.