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

Public Member Functions

 __init__ (self, str dataio_type, str public_info)
 
 __init__ (self, str dataio_type, "re.Match[str]" public_info)
 
 __init__ (self, str dataio_type, "str | re.Match[str]" public_info)
 
str get_code_handle_param (self, Location location)
 
str get_code_handle_arg (self, Location location)
 
str get_code_cmp (self, Location location)
 
str get_code_put (self, Location location, bool deep_diff=False)
 
- Public Member Functions inherited from generate_packets.BasicType
str get_code_declaration (self, Location location)
 
str get_code_fill (self, Location location)
 
str get_code_hash (self, Location location)
 
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)
 
- Public Member Functions inherited from generate_packets.RawFieldType
str __repr__ (self)
 

Static Public Attributes

 TYPE_PATTERN = re.compile(r"^struct \w+$")
 
- Static Public Attributes inherited from generate_packets.FieldType
bool foldable = False
 

Additional Inherited Members

- Data Fields inherited from generate_packets.BasicType
 dataio_type
 
 public_type
 

Detailed Description

Type information for a field of some general struct type

Definition at line 923 of file generate_packets.py.

Constructor & Destructor Documentation

◆ __init__() [1/3]

generate_packets.StructType.__init__ (   self,
str  dataio_type,
str  public_info 
)

Reimplemented from generate_packets.BasicType.

Reimplemented in generate_packets.CmParameterType, and generate_packets.WorklistType.

Definition at line 930 of file generate_packets.py.

◆ __init__() [2/3]

generate_packets.StructType.__init__ (   self,
str  dataio_type,
"re.Match[str]"  public_info 
)

Reimplemented from generate_packets.BasicType.

Reimplemented in generate_packets.CmParameterType, and generate_packets.WorklistType.

Definition at line 932 of file generate_packets.py.

◆ __init__() [3/3]

generate_packets.StructType.__init__ (   self,
str  dataio_type,
"str | re.Match[str]"  public_info 
)

Reimplemented from generate_packets.BasicType.

Reimplemented in generate_packets.CmParameterType, and generate_packets.WorklistType.

Definition at line 933 of file generate_packets.py.

Member Function Documentation

◆ get_code_cmp()

str generate_packets.StructType.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.BasicType.

Reimplemented in generate_packets.CmParameterType.

Definition at line 955 of file generate_packets.py.

◆ get_code_handle_arg()

str generate_packets.StructType.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 from generate_packets.FieldType.

Definition at line 949 of file generate_packets.py.

◆ get_code_handle_param()

str generate_packets.StructType.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.BasicType.

Definition at line 943 of file generate_packets.py.

◆ get_code_put()

str generate_packets.StructType.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.BasicType.

Definition at line 960 of file generate_packets.py.

Field Documentation

◆ TYPE_PATTERN

generate_packets.StructType.TYPE_PATTERN = re.compile(r"^struct \w+$")
static

Definition at line 926 of file generate_packets.py.