Register an object in the registry.
(self, obj: VppObject, logger)
| 70 | raise Exception("REG: duplicate add: %s" % obj) |
| 71 | |
| 72 | def register(self, obj: VppObject, logger) -> None: |
| 73 | """Register an object in the registry.""" |
| 74 | if obj.object_id() not in self._object_dict: |
| 75 | self._object_registry.append(obj) |
| 76 | self._object_dict[obj.object_id()] = obj |
| 77 | logger.debug("REG: registering %s" % obj) |
| 78 | else: |
| 79 | logger.debug("REG: duplicate add, ignoring (%s)" % obj) |
| 80 | |
| 81 | def unregister_all(self, logger) -> None: |
| 82 | """Remove all object registrations from registry.""" |