Freeciv-3.3
Loading...
Searching...
No Matches
Public Member Functions
generate_packets.SequenceType Class Reference
+ Inheritance diagram for generate_packets.SequenceType:

Public Member Functions

SizeInfo size_at (self, Location location)
 
str resize (self, Location location, str packet, str new_size)
 
"Location | None" null_condition (self, Location location)
 
str inner_cmp (self, Location location, str new, str old)
 
str get_code_cmp (self, Location location, str new, str old)
 
str inner_put (self, Location location, str packet, "str | None" diff_packet=None, int json_step=1)
 
str get_code_put_full (self, Location location, str packet)
 
str get_code_put_diff (self, Location location, str packet, str diff_packet)
 
str get_code_put (self, Location location, str packet, "str | None" diff_packet=None)
 
str inner_get (self, Location location, str packet, bool deep_diff=False, int json_step=1)
 
str get_code_get_full (self, Location location, str packet)
 
str get_code_get_diff (self, Location location, str packet)
 
str get_code_get (self, Location location, str packet, bool deep_diff=False)
 
- Public Member Functions inherited from generate_packets.FieldType
"FieldType" array (self, SizeInfo size)
 
str get_code_declaration (self, Location location)
 
str get_code_param (self, Location location)
 
str get_code_handle_arg (self, Location location, str packet)
 
str get_code_init (self, Location location, str packet)
 
str get_code_copy (self, Location location, str dest, str src)
 
str get_code_fill (self, Location location, str packet)
 
str get_code_free (self, Location location, str packet)
 
str get_code_hash (self, Location location, str packet)
 
bool is_type_compatible (self, "FieldType" other)
 
- Public Member Functions inherited from generate_packets.RawFieldType
str __str__ (self)
 
str __repr__ (self)
 

Additional Inherited Members

- Static Public Attributes inherited from generate_packets.FieldType
bool foldable = False
 
bool complex = False
 
- Static Public Attributes inherited from generate_packets.RawFieldType
str FieldTypeConstructor = typing.Callable[[str, str], RawFieldType]
 
- Protected Member Functions inherited from generate_packets.FieldType
 _compat_keys (self, Location location, str packet)
 

Detailed Description

Abstract base class (ABC) for field types representing homogenous
sequences of elements

Definition at line 1338 of file generate_packets.py.

Member Function Documentation

◆ get_code_cmp()

str generate_packets.SequenceType.get_code_cmp (   self,
Location  location,
str  new,
str  old 
)
Generate a code snippet comparing a field of this type between
the given packets and setting `differ` accordingly. The `old`
packet is one we know to have been initialized by our own code.

Reimplemented from generate_packets.FieldType.

Reimplemented in generate_packets.StrvecType.

Definition at line 1366 of file generate_packets.py.

◆ get_code_get()

str generate_packets.SequenceType.get_code_get (   self,
Location  location,
str  packet,
bool   deep_diff = False 
)
Generate a code snippet reading a field of this type from the
dataio stream.

Reimplemented from generate_packets.FieldType.

Definition at line 1758 of file generate_packets.py.

◆ get_code_get_diff()

str generate_packets.SequenceType.get_code_get_diff (   self,
Location  location,
str  packet 
)
Generate array-diff get code.

Definition at line 1665 of file generate_packets.py.

◆ get_code_get_full()

str generate_packets.SequenceType.get_code_get_full (   self,
Location  location,
str  packet 
)
Generate get code without array-diff.

Definition at line 1622 of file generate_packets.py.

◆ get_code_put()

str generate_packets.SequenceType.get_code_put (   self,
Location  location,
str  packet,
"str | None"   diff_packet = None 
)
Generate a code snippet writing a field of this type to the
dataio stream.

Reimplemented from generate_packets.FieldType.

Definition at line 1610 of file generate_packets.py.

◆ get_code_put_diff()

str generate_packets.SequenceType.get_code_put_diff (   self,
Location  location,
str  packet,
str  diff_packet 
)
Generate array-diff put code.

Definition at line 1477 of file generate_packets.py.

◆ get_code_put_full()

str generate_packets.SequenceType.get_code_put_full (   self,
Location  location,
str  packet 
)
Generate put code without array-diff.

Definition at line 1405 of file generate_packets.py.

◆ inner_cmp()

str generate_packets.SequenceType.inner_cmp (   self,
Location  location,
str  new,
str  old 
)
Generate the loop body for get_code_cmp()

This is placed at the very beginning of a scope, so variable
declarations are permitted without requiring an extra block.

Reimplemented in generate_packets.ArrayType, generate_packets.SpecvecType, and generate_packets.StrvecType.

Definition at line 1359 of file generate_packets.py.

◆ inner_get()

str generate_packets.SequenceType.inner_get (   self,
Location  location,
str  packet,
bool   deep_diff = False,
int   json_step = 1 
)
Generate the main part of the loop body for get_code_get()

Reimplemented in generate_packets.ArrayType, generate_packets.SpecvecType, and generate_packets.StrvecType.

Definition at line 1617 of file generate_packets.py.

◆ inner_put()

str generate_packets.SequenceType.inner_put (   self,
Location  location,
str  packet,
"str | None"   diff_packet = None,
int   json_step = 1 
)
Generate the main part of the loop body for get_code_put()

Reimplemented in generate_packets.ArrayType, generate_packets.SpecvecType, and generate_packets.StrvecType.

Definition at line 1400 of file generate_packets.py.

◆ null_condition()

"Location | None" generate_packets.SequenceType.null_condition (   self,
Location  location 
)
Return a code condition that if TRUE means the field cannot be used
normally and should be treated as empty, or None if this never happens

Reimplemented in generate_packets.StrvecType.

Definition at line 1353 of file generate_packets.py.

◆ resize()

str generate_packets.SequenceType.resize (   self,
Location  location,
str  packet,
str  new_size 
)
Return a code snippet updating the size of a field of this type,
or the empty string if this type doesn't need to individually transmit
and update its size

Reimplemented in generate_packets.SpecvecType, and generate_packets.StrvecType.

Definition at line 1347 of file generate_packets.py.

◆ size_at()

SizeInfo generate_packets.SequenceType.size_at (   self,
Location  location 
)
Return a size info object for a field of this type

Reimplemented in generate_packets.StrvecType, generate_packets.ArrayType, and generate_packets.SpecvecType.

Definition at line 1343 of file generate_packets.py.