Freeciv-3.2
Loading...
Searching...
No Matches
Public Member Functions | Data Fields | Protected Attributes | Static Protected Attributes
generate_packets.Location Class Reference

Public Member Functions

 __init__ (self, str name, "str | None" location=None, int depth=0)
 
"Location" deeper (self, str new_location)
 
str index (self)
 
"Location" sub (self)
 
str __str__ (self)
 
str __repr__ (self)
 

Data Fields

 name
 
 location
 
 depth
 

Protected Attributes

 _INDICES
 

Static Protected Attributes

str _INDICES = "ijk"
 

Detailed Description

Roughly represents a location in memory for the generated code;
outside of recursive field types like arrays, this will usually just be
a field of a packet, but it serves to concisely handle the recursion.

Definition at line 350 of file generate_packets.py.

Constructor & Destructor Documentation

◆ __init__()

generate_packets.Location.__init__ (   self,
str  name,
"str | None"   location = None,
int   depth = 0 
)

Definition at line 357 of file generate_packets.py.

Member Function Documentation

◆ __repr__()

str generate_packets.Location.__repr__ (   self)

Definition at line 392 of file generate_packets.py.

◆ __str__()

str generate_packets.Location.__str__ (   self)

Definition at line 389 of file generate_packets.py.

◆ deeper()

"Location" generate_packets.Location.deeper (   self,
str  new_location 
)
Return the given string as a new Location with the same name as
self and incremented depth

Definition at line 369 of file generate_packets.py.

◆ index()

str generate_packets.Location.index (   self)
The index name for the current depth

Definition at line 375 of file generate_packets.py.

◆ sub()

"Location" generate_packets.Location.sub (   self)
A location one level deeper with the current index subscript
added to the end.

`field` ~> `field[i]` ~> `field[i][j]` etc.

Definition at line 382 of file generate_packets.py.

Field Documentation

◆ _INDICES [1/2]

str generate_packets.Location._INDICES = "ijk"
staticprotected

Definition at line 355 of file generate_packets.py.

◆ _INDICES [2/2]

generate_packets.Location._INDICES
protected

Definition at line 377 of file generate_packets.py.

◆ depth

generate_packets.Location.depth

Definition at line 365 of file generate_packets.py.

◆ location

generate_packets.Location.location

Definition at line 361 of file generate_packets.py.

◆ name

generate_packets.Location.name

Definition at line 358 of file generate_packets.py.