Freeciv-3.2
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes
generate_packets.FieldType Class Reference
+ Inheritance diagram for generate_packets.FieldType:

Public Member Functions

"FieldType" array (self, SizeInfo size)
 
str get_code_declaration (self, Location location)
 
str get_code_handle_param (self, Location location)
 
str get_code_handle_arg (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)
 
- Public Member Functions inherited from generate_packets.RawFieldType
str __str__ (self)
 
str __repr__ (self)
 

Static Public Attributes

bool foldable = False
 

Detailed Description

Abstract base class (ABC) for classes representing type information
usable for fields of a packet

Definition at line 653 of file generate_packets.py.

Member Function Documentation

◆ array()

"FieldType" generate_packets.FieldType.array (   self,
SizeInfo  size 
)
Construct a FieldType for an array with element type self and the
given size

Reimplemented from generate_packets.RawFieldType.

Definition at line 661 of file generate_packets.py.

◆ get_code_cmp()

str generate_packets.FieldType.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 in generate_packets.BasicType, generate_packets.BitvectorType, generate_packets.StructType, generate_packets.CmParameterType, generate_packets.StringType, generate_packets.MemoryType, and generate_packets.ArrayType.

Definition at line 700 of file generate_packets.py.

◆ get_code_declaration()

str generate_packets.FieldType.get_code_declaration (   self,
Location  location 
)
Generate a code snippet declaring a field with this type in a
packet struct.

Reimplemented in generate_packets.BasicType, generate_packets.SizedType, and generate_packets.ArrayType.

Definition at line 667 of file generate_packets.py.

◆ get_code_fill()

str generate_packets.FieldType.get_code_fill (   self,
Location  location 
)
Generate a code snippet moving a value of this type from dsend
arguments into a packet struct.

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

Definition at line 688 of file generate_packets.py.

◆ get_code_get()

str generate_packets.FieldType.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 in generate_packets.BasicType, generate_packets.IntType, generate_packets.FloatType, generate_packets.BitvectorType, generate_packets.StringType, generate_packets.MemoryType, and generate_packets.ArrayType.

Definition at line 712 of file generate_packets.py.

◆ get_code_handle_arg()

str generate_packets.FieldType.get_code_handle_arg (   self,
Location  location 
)
Generate a code fragment passing an argument with this type to a
handle function.

See also self.get_code_handle_param()

Reimplemented in generate_packets.StructType.

Definition at line 680 of file generate_packets.py.

◆ get_code_handle_param()

str generate_packets.FieldType.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 in generate_packets.BasicType, generate_packets.StructType, generate_packets.SizedType, and generate_packets.ArrayType.

Definition at line 673 of file generate_packets.py.

◆ get_code_hash()

str generate_packets.FieldType.get_code_hash (   self,
Location  location 
)
Generate a code snippet factoring a field of this type into a
hash computation's `result`.

Reimplemented in generate_packets.BasicType, generate_packets.IntType, and generate_packets.ArrayType.

Definition at line 694 of file generate_packets.py.

◆ get_code_put()

str generate_packets.FieldType.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 in generate_packets.BasicType, generate_packets.FloatType, generate_packets.BitvectorType, generate_packets.StructType, generate_packets.MemoryType, and generate_packets.ArrayType.

Definition at line 706 of file generate_packets.py.

Field Documentation

◆ foldable

bool generate_packets.FieldType.foldable = False
static

Definition at line 657 of file generate_packets.py.