Freeciv-3.2: generate_packets.BasicType Class Reference

Freeciv-3.2

Loading...
Searching...
No Matches
Public Member Functions | Data Fields
generate_packets.BasicType Class Reference
Inheritance diagram for generate_packets.BasicType:

## Public Member Functions

| __init__ (self, str dataio_type, str public_type)
str | get_code_declaration (self, Location location)
str | get_code_handle_param (self, Location location)
str | get_code_fill (self, Location location)
str | get_code_hash (self, Location location)
str | get_code_cmp (self, Location location)
str | get_code_put (self, Location location, bool deep_diff=False)
str | get_code_get (self, Location location, bool deep_diff=False)
str | __str__ (self)
Public Member Functions inherited from generate_packets.FieldType
"FieldType" | array (self, SizeInfo size)
str | get_code_handle_arg (self, Location location)
Public Member Functions inherited from generate_packets.RawFieldType
str | __repr__ (self)

## Data Fields

| dataio_type
| public_type

## Additional Inherited Members

Static Public Attributes inherited from generate_packets.FieldType
bool | foldable = False

## Detailed Description

    Type information for a field without any specialized treatment

Definition at line 718 of file generate_packets.py.

## Constructor & Destructor Documentation

## ◆ __init__()

generate_packets.BasicType.__init__ | ( |  | self,
|  | str | dataio_type,
|  | str | public_type
| ) |  |

Reimplemented in generate_packets.IntType, generate_packets.BoolType, generate_packets.FloatType, generate_packets.IntType, generate_packets.BoolType, generate_packets.FloatType, generate_packets.IntType, generate_packets.BoolType, generate_packets.FloatType, generate_packets.StructType, generate_packets.StructType, generate_packets.StructType, generate_packets.BitvectorType, generate_packets.CmParameterType, generate_packets.WorklistType, generate_packets.SizedType, generate_packets.StringType, and generate_packets.MemoryType.

Definition at line 721 of file generate_packets.py.

## Member Function Documentation

## ◆ __str__()

str generate_packets.BasicType.__str__ | ( |  | self | ) |

Reimplemented from generate_packets.RawFieldType.

Reimplemented in generate_packets.FloatType, and generate_packets.SizedType.

Definition at line 760 of file generate_packets.py.

## ◆ get_code_cmp()

str generate_packets.BasicType.get_code_cmp | ( |  | self,
|  | Location | location
| ) |  |

    Generate a code snippet comparing a field of this type between
    the `old` and `real_packet` and setting `differ` accordingly.

Reimplemented from generate_packets.FieldType.

Reimplemented in generate_packets.BitvectorType, generate_packets.StructType, generate_packets.CmParameterType, generate_packets.StringType, and generate_packets.MemoryType.

Definition at line 743 of file generate_packets.py.

## ◆ get_code_declaration()

str generate_packets.BasicType.get_code_declaration | ( |  | self,
|  | Location | location
| ) |  |

    Generate a code snippet declaring a field with this type in a
    packet struct.

Reimplemented from generate_packets.FieldType.

Reimplemented in generate_packets.SizedType.

Definition at line 727 of file generate_packets.py.

## ◆ get_code_fill()

str generate_packets.BasicType.get_code_fill | ( |  | self,
|  | Location | location
| ) |  |

    Generate a code snippet moving a value of this type from dsend
    arguments into a packet struct.

Reimplemented from generate_packets.FieldType.

Reimplemented in generate_packets.WorklistType, generate_packets.SizedType, generate_packets.StringType, and generate_packets.MemoryType.

Definition at line 735 of file generate_packets.py.

## ◆ get_code_get()

str generate_packets.BasicType.get_code_get | ( |  | self,
|  | Location | location,
|  | bool | deep_diff = `False`
| ) |  |

    Generate a code snippet reading a field of this type from the
    dataio stream.

Reimplemented from generate_packets.FieldType.

Reimplemented in generate_packets.IntType, generate_packets.FloatType, generate_packets.BitvectorType, generate_packets.StringType, and generate_packets.MemoryType.

Definition at line 753 of file generate_packets.py.

## ◆ get_code_handle_param()

str generate_packets.BasicType.get_code_handle_param | ( |  | self,
|  | Location | location
| ) |  |

    Generate a code fragment declaring a parameter with this type for
    a handle function.

    See also self.get_code_handle_arg()

Reimplemented from generate_packets.FieldType.

Reimplemented in generate_packets.StructType, and generate_packets.SizedType.

Definition at line 732 of file generate_packets.py.

## ◆ get_code_hash()

str generate_packets.BasicType.get_code_hash | ( |  | self,
|  | Location | location
| ) |  |

    Generate a code snippet factoring a field of this type into a
    hash computation's `result`.

Reimplemented from generate_packets.FieldType.

Reimplemented in generate_packets.IntType.

Definition at line 740 of file generate_packets.py.

## ◆ get_code_put()

str generate_packets.BasicType.get_code_put | ( |  | self,
|  | Location | location,
|  | bool | deep_diff = `False`
| ) |  |

    Generate a code snippet writing a field of this type to the
    dataio stream.

Reimplemented from generate_packets.FieldType.

Reimplemented in generate_packets.FloatType, generate_packets.BitvectorType, generate_packets.StructType, and generate_packets.MemoryType.

Definition at line 748 of file generate_packets.py.

## Field Documentation

## ◆ dataio_type

generate_packets.BasicType.dataio_type

Definition at line 722 of file generate_packets.py.

## ◆ public_type

generate_packets.BasicType.public_type

Definition at line 724 of file generate_packets.py.