ifgen.struct.methods.fields package — docs

Skip to main content
`Ctrl`+`K`

# ifgen.struct.methods.fields package

## Submodules

## ifgen.struct.methods.fields.common module

Common utilities for generating bit-field related struct methods.

ifgen.struct.methods.fields.common.bit_field_method_slug(field: dict[str, Any], member: str = '', alias: str = None) → str

  Get a method slug for a struct’s bit-field method.

ifgen.struct.methods.fields.common.bit_field_underlying(field: dict[str, Any]) → str

  Get the underlying type for a bit field.

ifgen.struct.methods.fields.common.bit_mask_literal(width: int) → str

  Get a bit-mask literal.

ifgen.struct.methods.fields.common.possible_array_arg(parent: dict[str, Any]) → str

  Determine if a method needs an array-index argument.

## ifgen.struct.methods.fields.getter module

A module implementing ‘get’ methods for bit-fields.

ifgen.struct.methods.fields.getter.bit_field_get_all_method(task: GenerateTask, writer: IndentedFileWriter, field: dict[str, Any], fields: list[dict[str, Any]], alias: str = None) → None

  Generate a ‘get’ method for multiple bit-field.

ifgen.struct.methods.fields.getter.bit_field_get_method(task: GenerateTask, parent: dict[str, Any], field: dict[str, Any], writer: IndentedFileWriter, alias: str = None) → None

  Generate a ‘get’ method for a bit-field.

ifgen.struct.methods.fields.getter.get_bit_field_statement(task: GenerateTask, field: dict[str, Any], lhs: str) → str

  Get the arithmetic statement associated with a bit-field get operation.

## ifgen.struct.methods.fields.setter module

A module implementing ‘set’ methods for bit-fields.

ifgen.struct.methods.fields.setter.bit_field_set_all_method(task: GenerateTask, writer: IndentedFileWriter, field: dict[str, Any], fields: list[dict[str, Any]], alias: str = None) → None

  Generate a ‘set’ method for multiple bit-field.

ifgen.struct.methods.fields.setter.bit_field_set_lines(task: GenerateTask, field: dict[str, Any], lhs: str = 'curr', value: str = 'value') → Iterator[str]

  Get lines that perform a bit-field’s assignment.

ifgen.struct.methods.fields.setter.bit_field_set_method(task: GenerateTask, parent: dict[str, Any], field: dict[str, Any], writer: IndentedFileWriter, alias: str = None) → None

  Generate a ‘set’ method for a bit-field.

## Module contents

A module implementing an interface for generating bit-field methods for structs.

ifgen.struct.methods.fields.bit_field(task: GenerateTask, parent: dict[str, Any], field: dict[str, Any], writer: IndentedFileWriter, read_fields: list[dict[str, Any]], write_fields: list[dict[str, Any]], alias: str = None) → None

  Generate for an individual bit-field.

ifgen.struct.methods.fields.bit_fields(task: GenerateTask, writer: IndentedFileWriter) → None

  Generate bit-field lines.

ifgen.struct.methods.fields.handle_atomic_fields_methods(task: GenerateTask, writer: IndentedFileWriter, field: dict[str, Any], read_fields: list[dict[str, Any]], write_fields: list[dict[str, Any]], alias: str = None) → None

  Handle additional bit-field methods.