+# TODO: post 20.01, remove inherit from object.
+class Packer(object):
+ options = {}
+
+ def pack(self, data, kwargs):
+ raise NotImplementedError
+
+ def unpack(self, data, offset, result=None, ntc=False):
+ raise NotImplementedError
+
+ # override as appropriate in subclasses
+ def _get_packer_with_options(self, f_type, options):
+ return types[f_type]
+
+ def get_packer_with_options(self, f_type, options):
+ if options is not None:
+ try:
+ return self._get_packer_with_options(f_type, options)
+ except IndexError:
+ raise VPPSerializerValueError(
+ "Options not supported for {}{} ({})".
+ format(f_type, types[f_type].__class__,
+ options))
+
+
+class BaseTypes(Packer):