def get_all_subtypes_with_tags(self):
assert self.has_enumerated_subtypes(), '<STR_LIT>'<EOL>subtypes_with_tags = []  <EOL>fifo = deque([subtype_field.data_type<EOL>for subtype_field in self.get_enumerated_subtypes()])<EOL>while fifo:<EOL><INDENT>data_type = fifo.popleft()<EOL>subtypes_with_tags.append((data_type._get_subtype_tags(), data_type))<EOL>if data_type.has_enumerated_subtypes():<EOL><INDENT>for subtype_field in data_type.get_enumerated_subtypes():<EOL><INDENT>fifo.append(subtype_field.data_type)<EOL><DEDENT><DEDENT><DEDENT>return subtypes_with_tags<EOL>
Unlike other enumerated-subtypes-related functionality, this method
returns not just direct subtypes, but all subtypes of this struct. The
tag of each subtype is the list of tags from which the type descends.

This method only applies to structs that enumerate subtypes.

Use this when you need to generate a lookup table for a root struct
that maps a generated class representing a subtype to the tag it needs
in the serialized format.

Returns:
    List[Tuple[List[String], Struct]]