Freeciv-3.3
|
Public Member Functions | |
__init__ (self, typing.Iterable[str] poscaps, typing.Iterable[str] negcaps, "Packet" packet, int var_number) | |
ScriptConfig | cfg (self) |
bool | gen_stats (self) |
"str | None" | log_macro (self) |
bool | gen_log (self) |
str | packet_name (self) |
str | type (self) |
bool | no_packet (self) |
bool | delta (self) |
want_force (self) | |
str | is_info (self) |
"list[str]" | reset_packets (self) |
bool | complex (self) |
bool | differ_used (self) |
str | condition (self) |
int | bits (self) |
str | receive_prototype (self) |
str | send_prototype (self) |
str | fill_send_handler (self) |
str | fill_receive_handler (self) |
str | get_copy (self, str dest, str src) |
str | get_stats (self) |
str | get_bitvector (self) |
str | get_report_part (self) |
str | get_reset_part (self) |
str | get_hash (self) |
str | get_cmp (self) |
str | get_send (self) |
str | get_delta_send_header (self, str before_return="") |
str | get_delta_send_body (self) |
str | get_receive (self) |
str | get_delta_receive_body (self) |
Data Fields | |
packet | |
var_number | |
name | |
poscaps | |
negcaps | |
fields | |
key_fields | |
other_fields | |
keys_format | |
keys_arg | |
is_info | |
Static Public Attributes | |
str | packet : "Packet" |
int | var_number |
str | name |
typing | poscaps .AbstractSet[str] |
typing | negcaps .AbstractSet[str] |
typing | fields .Sequence[Field] |
typing | key_fields .Sequence[Field] |
typing | other_fields .Sequence[Field] |
str | keys_format |
str | keys_arg |
Represents one variant of a packet. Packets with add-cap or remove-cap fields have different variants for different combinations of the relevant optional capabilities.
Definition at line 2429 of file generate_packets.py.
generate_packets.Variant.__init__ | ( | self, | |
typing.Iterable[str] | poscaps, | ||
typing.Iterable[str] | negcaps, | ||
"Packet" | packet, | ||
int | var_number | ||
) |
Definition at line 2472 of file generate_packets.py.
int generate_packets.Variant.bits | ( | self | ) |
The length of the bitvector for this variant.
Definition at line 2613 of file generate_packets.py.
ScriptConfig generate_packets.Variant.cfg | ( | self | ) |
Configuration used when generating code for this packet variant See self.packet and Packet.cfg
Definition at line 2497 of file generate_packets.py.
bool generate_packets.Variant.complex | ( | self | ) |
Whether this packet's struct requires special handling for initialization, copying, and destruction. Note that this is still True even if the complex-typed fields of the packet are excluded from this Variant.
Definition at line 2574 of file generate_packets.py.
str generate_packets.Variant.condition | ( | self | ) |
The condition determining whether this variant should be used, based on capabilities. See get_packet_handlers_fill_capability()
Definition at line 2599 of file generate_packets.py.
bool generate_packets.Variant.delta | ( | self | ) |
Whether this packet can use delta optimization See Packet.delta
Definition at line 2548 of file generate_packets.py.
bool generate_packets.Variant.differ_used | ( | self | ) |
Whether the send function needs a `differ` boolean. See get_send()
Definition at line 2583 of file generate_packets.py.
str generate_packets.Variant.fill_receive_handler | ( | self | ) |
Code to set the receive handler for this variant See get_packet_handlers_fill_initial and get_packet_handlers_fill_capability
Definition at line 2647 of file generate_packets.py.
str generate_packets.Variant.fill_send_handler | ( | self | ) |
Code to set the send handler for this variant See get_packet_handlers_fill_initial and get_packet_handlers_fill_capability
Definition at line 2628 of file generate_packets.py.
bool generate_packets.Variant.gen_log | ( | self | ) |
Whether to generate log calls for this packet variant See self.log_macro
Definition at line 2520 of file generate_packets.py.
bool generate_packets.Variant.gen_stats | ( | self | ) |
Whether to generate delta stats code for this packet variant See self.cfg and ScriptConfig.gen_stats
Definition at line 2505 of file generate_packets.py.
str generate_packets.Variant.get_bitvector | ( | self | ) |
Generate the declaration of the fields bitvector type for this packet variant
Definition at line 2684 of file generate_packets.py.
str generate_packets.Variant.get_cmp | ( | self | ) |
Generate the key comparison function for this variant
Definition at line 2752 of file generate_packets.py.
Generate code deep-copying the fields relevant to this variant from *src to *dest
Definition at line 2656 of file generate_packets.py.
str generate_packets.Variant.get_delta_receive_body | ( | self | ) |
Helper for get_receive(). Generate the part of the receive function responsible for recreating the full packet from the received delta and the last cached packet. Note: This code fragment declares variables. To comply with CodingStyle, it should be enclosed in a block {} or #ifdef.
Definition at line 3104 of file generate_packets.py.
str generate_packets.Variant.get_delta_send_body | ( | self | ) |
Helper for get_send(). Generate the part of the send function that transmits the delta between the real packet and the last cached packet. See also get_delta_send_header()
Definition at line 2997 of file generate_packets.py.
Helper for get_send(). Generate the part of the send function that determined which fields differ between the real packet and the last cached packet, and possibly discards is-info packets.
Definition at line 2920 of file generate_packets.py.
str generate_packets.Variant.get_hash | ( | self | ) |
Generate the key hash function for this variant
Definition at line 2721 of file generate_packets.py.
str generate_packets.Variant.get_receive | ( | self | ) |
Generate the receive function for this packet variant
Definition at line 3038 of file generate_packets.py.
str generate_packets.Variant.get_report_part | ( | self | ) |
Generate the part of the delta_stats_report() function specific to this packet variant
Definition at line 2691 of file generate_packets.py.
str generate_packets.Variant.get_reset_part | ( | self | ) |
Generate the part of the delta_stats_reset() function specific to this packet variant
Definition at line 2711 of file generate_packets.py.
str generate_packets.Variant.get_send | ( | self | ) |
Generate the send function for this packet variant
Definition at line 2786 of file generate_packets.py.
str generate_packets.Variant.get_stats | ( | self | ) |
Generate the declaration of the delta stats counters associated with this packet variant
Definition at line 2668 of file generate_packets.py.
str generate_packets.Variant.is_info | ( | self | ) |
Whether this is an info or game-info packet
Definition at line 2562 of file generate_packets.py.
"str | None" generate_packets.Variant.log_macro | ( | self | ) |
The log macro used to generate log calls for this packet variant, or None if no log calls should be generated See self.cfg and ScriptConfig.log_macro
Definition at line 2512 of file generate_packets.py.
bool generate_packets.Variant.no_packet | ( | self | ) |
Whether the send function should not take/need a packet struct See Packet.no_packet
Definition at line 2541 of file generate_packets.py.
str generate_packets.Variant.packet_name | ( | self | ) |
Name of the packet this is a variant of See Packet.name
Definition at line 2527 of file generate_packets.py.
str generate_packets.Variant.receive_prototype | ( | self | ) |
The prototype of this variant's receive function
Definition at line 2618 of file generate_packets.py.
"list[str]" generate_packets.Variant.reset_packets | ( | self | ) |
List of packets to reset when sending or receiving this packet See Packet.reset_packets
Definition at line 2567 of file generate_packets.py.
str generate_packets.Variant.send_prototype | ( | self | ) |
The prototype of this variant's send function
Definition at line 2623 of file generate_packets.py.
str generate_packets.Variant.type | ( | self | ) |
Type (enum constant) of the packet this is a variant of See Packet.type
Definition at line 2534 of file generate_packets.py.
generate_packets.Variant.want_force | ( | self | ) |
Whether send function takes a force_to_send boolean See Packet.want_force
Definition at line 2555 of file generate_packets.py.
Definition at line 2451 of file generate_packets.py.
generate_packets.Variant.fields |
Definition at line 2480 of file generate_packets.py.
generate_packets.Variant.is_info |
Definition at line 2928 of file generate_packets.py.
Definition at line 2454 of file generate_packets.py.
generate_packets.Variant.key_fields |
Definition at line 2485 of file generate_packets.py.
|
static |
Definition at line 2466 of file generate_packets.py.
generate_packets.Variant.keys_arg |
Definition at line 2489 of file generate_packets.py.
|
static |
Definition at line 2460 of file generate_packets.py.
generate_packets.Variant.keys_format |
Definition at line 2488 of file generate_packets.py.
|
static |
Definition at line 2440 of file generate_packets.py.
generate_packets.Variant.name |
Definition at line 2476 of file generate_packets.py.
|
static |
Definition at line 2447 of file generate_packets.py.
generate_packets.Variant.negcaps |
Definition at line 2479 of file generate_packets.py.
Definition at line 2457 of file generate_packets.py.
generate_packets.Variant.other_fields |
Definition at line 2486 of file generate_packets.py.
|
static |
Definition at line 2434 of file generate_packets.py.
generate_packets.Variant.packet |
Definition at line 2474 of file generate_packets.py.
|
static |
Definition at line 2443 of file generate_packets.py.
generate_packets.Variant.poscaps |
Definition at line 2478 of file generate_packets.py.
|
static |
Definition at line 2437 of file generate_packets.py.
generate_packets.Variant.var_number |
Definition at line 2475 of file generate_packets.py.