Beispiel #1
0
 def __init__(self, name, msgdef):
     self.size = types['u32'].size
     e_hash = {}
     for f in msgdef:
         if type(f) is dict and 'enumtype' in f:
             if f['enumtype'] != 'u32':
                 raise NotImplementedError
             continue
         ename, evalue = f
         e_hash[ename] = evalue
     self.enum = IntFlag(name, e_hash)
     types[name] = self
Beispiel #2
0
 def __init__(self, name, msgdef):
     self.size = types['u32'].size
     self.enumtype = 'u32'
     e_hash = {}
     for f in msgdef:
         if type(f) is dict and 'enumtype' in f:
             if f['enumtype'] != 'u32':
                 self.size = types[f['enumtype']].size
                 self.enumtype = f['enumtype']
             continue
         ename, evalue = f
         e_hash[ename] = evalue
     self.enum = IntFlag(name, e_hash)
     types[name] = self
Beispiel #3
0
 def __init__(self, name, msgdef, options=None):
     self.size = types['u32'].size
     self.name = name
     self.enumtype = 'u32'
     self.msgdef = msgdef
     e_hash = {}
     for f in msgdef:
         if type(f) is dict and 'enumtype' in f:
             if f['enumtype'] != 'u32':
                 self.size = types[f['enumtype']].size
                 self.enumtype = f['enumtype']
             continue
         ename, evalue = f
         e_hash[ename] = evalue
     self.enum = IntFlag(name, e_hash)
     types[name] = self
     class_types[name] = VPPEnumType
     self.options = options