Freeciv-3.3
Loading...
Searching...
No Matches
Public Member Functions | Data Fields | Static Public Attributes | Protected Member Functions
generate_packets.SpecvecType Class Reference
+ Inheritance diagram for generate_packets.SpecvecType:

Public Member Functions

 __init__ (self, StructType elem)
 
str get_code_init (self, Location location, str packet)
 
str get_code_copy (self, Location location, str dest, str src)
 
str get_code_free (self, Location location, str packet)
 
SizeInfo size_at (self, Location location)
 
str resize (self, Location location, str packet, str new_size)
 
str inner_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 inner_get (self, Location location, str packet, bool deep_diff=False, int json_step=1)
 
str __str__ (self)
 
- Public Member Functions inherited from generate_packets.SequenceType
"Location | None" null_condition (self, Location location)
 
str get_code_cmp (self, Location location, str new, str old)
 
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 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
str get_code_fill (self, Location location, str packet)
 
bool is_type_compatible (self, "FieldType" other)
 
- Public Member Functions inherited from generate_packets.RawFieldType
str __repr__ (self)
 
- Public Member Functions inherited from generate_packets.StructType
"FieldType" array (self, SizeInfo size)
 
str get_code_param (self, Location location)
 
str get_code_handle_arg (self, Location location, str packet)
 
str get_code_cmp (self, Location location, str new, str old)
 
str get_code_put (self, Location location, str packet, "str | None" diff_packet=None)
 
- Public Member Functions inherited from generate_packets.BasicType
str get_code_declaration (self, Location location)
 
str get_code_hash (self, Location location, str packet)
 
str get_code_get (self, Location location, str packet, bool deep_diff=False)
 

Data Fields

 elem
 
- Data Fields inherited from generate_packets.StructType
 struct_type
 
- Data Fields inherited from generate_packets.BasicType
 dataio_type
 
 public_type
 

Static Public Attributes

FieldType elem
 
bool complex = True
 
- 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]
 
- Static Public Attributes inherited from generate_packets.StructType
 TYPE_PATTERN = re.compile(r"^struct\s+(\w+)$")
 
str struct_type
 
- Static Public Attributes inherited from generate_packets.BasicType
str dataio_type
 
str public_type
 
str DEFAULT_REGISTRY = TypeRegistry(BasicType)
 

Protected Member Functions

Location _sub (self, Location location, int json_step=1)
 
- Protected Member Functions inherited from generate_packets.FieldType
 _compat_keys (self, Location location, str packet)
 

Detailed Description

Type information for a specialized vector field

Definition at line 1884 of file generate_packets.py.

Constructor & Destructor Documentation

◆ __init__()

generate_packets.SpecvecType.__init__ (   self,
StructType  elem 
)

Reimplemented from generate_packets.StructType.

Definition at line 1892 of file generate_packets.py.

Member Function Documentation

◆ __str__()

str generate_packets.SpecvecType.__str__ (   self)

Reimplemented from generate_packets.RawFieldType.

Definition at line 1941 of file generate_packets.py.

◆ _sub()

Location generate_packets.SpecvecType._sub (   self,
Location  location,
int   json_step = 1 
)
protected

Definition at line 1913 of file generate_packets.py.

◆ get_code_copy()

str generate_packets.SpecvecType.get_code_copy (   self,
Location  location,
str  dest,
str  src 
)
Generate a code snippet deep-copying a field of this type from
one packet struct to another that has already been initialized.

Subclasses must override this if self.complex is True

Reimplemented from generate_packets.FieldType.

Definition at line 1903 of file generate_packets.py.

◆ get_code_free()

str generate_packets.SpecvecType.get_code_free (   self,
Location  location,
str  packet 
)
Generate a code snippet deinitializing a field of this type in
the packet struct before it gets destroyed.

Subclasses must override this if self.complex is True

Reimplemented from generate_packets.FieldType.

Definition at line 1908 of file generate_packets.py.

◆ get_code_init()

str generate_packets.SpecvecType.get_code_init (   self,
Location  location,
str  packet 
)
Generate a code snippet initializing a field of this type in the
packet struct, after the struct has already been zeroed.

Subclasses must override this if self.complex is True

Reimplemented from generate_packets.FieldType.

Definition at line 1898 of file generate_packets.py.

◆ inner_cmp()

str generate_packets.SpecvecType.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 from generate_packets.SequenceType.

Definition at line 1930 of file generate_packets.py.

◆ inner_get()

str generate_packets.SpecvecType.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 from generate_packets.SequenceType.

Definition at line 1937 of file generate_packets.py.

◆ inner_put()

str generate_packets.SpecvecType.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 from generate_packets.SequenceType.

Definition at line 1933 of file generate_packets.py.

◆ resize()

str generate_packets.SpecvecType.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 from generate_packets.SequenceType.

Definition at line 1921 of file generate_packets.py.

◆ size_at()

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

Reimplemented from generate_packets.SequenceType.

Definition at line 1918 of file generate_packets.py.

Field Documentation

◆ complex

bool generate_packets.SpecvecType.complex = True
static

Definition at line 1890 of file generate_packets.py.

◆ elem [1/2]

FieldType generate_packets.SpecvecType.elem
static

Definition at line 1887 of file generate_packets.py.

◆ elem [2/2]

generate_packets.SpecvecType.elem

Definition at line 1896 of file generate_packets.py.