@@ -224,14 +224,11 @@ def generate_channel_size_dict(self, the_parsed_topology_xml, xml_filename):
224224 if self .verbose :
225225 print ("Processing Channel %s" % channel_name )
226226 chan_type = chan .get_type ()
227- # if channel is enum
228- if type (chan_type ) == type (tuple ()):
229- chan_size = 4
230227 # if channel type is string
231228 # elif chan_type == "string":
232229 # chan_size = int(chan.get_size()) + 2 # FIXME: buffer size storage size magic number - needs to be turned into a constant
233230 # if channel is serializable
234- elif chan_type in self .size_dict :
231+ if chan_type in self .size_dict :
235232 chan_size = self .size_dict [chan_type ]
236233 else :
237234 chan_size = self .get_type_size (chan_type , chan .get_size ())
@@ -506,10 +503,7 @@ def process_serializable_files(self, serializable_file_list):
506503 member_comment ,
507504 _ ,
508505 ) in serializable_model .get_members ():
509- # if enumeration
510- if type (member_type ) == type (tuple ()):
511- type_size = 4 # Fixme: can we put this in a constant somewhere?
512- elif (
506+ if (
513507 member_type in self .size_dict .keys ()
514508 ): # See if it is a registered type
515509 type_size = self .size_dict [member_type ]
@@ -536,9 +530,9 @@ def process_enum_files(self, enum_file_list):
536530 enum_file = search_for_file ("Enumeration" , enum_file )
537531 enum_model = XmlEnumParser .XmlEnumParser (enum_file )
538532 enum_type = enum_model .get_namespace () + "::" + enum_model .get_name ()
539- self . add_type_size (
540- enum_type , 4
541- ) # Fixme: can we put this in a constant somewhere?
533+ serialize_type = enum_model . get_serialize_type ()
534+ enum_size = self . get_type_size ( serialize_type , None )
535+ self . add_type_size ( enum_type , enum_size )
542536
543537 def process_array_files (self , array_file_list ):
544538 for array_file in array_file_list :
@@ -552,9 +546,7 @@ def process_array_files(self, array_file_list):
552546 array_size = int (array_model .get_size ())
553547 elem_type = array_model .get_type ()
554548 elem_type_size = None
555- if type (elem_type ) == type (tuple ()):
556- elem_type_size = 4 # Fixme: can we put this in a constant somewhere?
557- elif elem_type in self .size_dict .keys (): # See if it is a registered type
549+ if elem_type in self .size_dict .keys (): # See if it is a registered type
558550 elem_type_size = self .size_dict [elem_type ]
559551 else :
560552 elem_type_size = self .get_type_size (elem_type , 1 ) # Fixme: strings?
0 commit comments