- def _get_packer_with_options(self, f_type, options):
- c = types[f_type].__class__
- return c(f_type, types[f_type].msgdef, options=options)
+ @classmethod
+ def _get_packer_with_options(cls, f_type, options):
+ return cls(f_type, types[f_type].msgdef, options=options)
+
+ def __repr__(self):
+ return "%s(name=%s, msgdef=%s, options=%s)" % (
+ self.__class__.__name__, self.name, self.msgdef, self.options
+ )
+
+
+class VPPEnumFlagType(VPPEnumType):
+ output_class = IntFlag
+
+ def __init__(self, name, msgdef, options=None):
+ super(VPPEnumFlagType, self).__init__(name, msgdef, options)