Add in slots to object model

This commit is contained in:
Mike Auty
2025-03-24 00:58:28 +00:00
parent 0ddec14cf9
commit f0153817c5
@@ -23,6 +23,8 @@ class ReadOnlyMapping(collections.abc.Mapping):
modified, making an immutable mapping.
"""
__slots__ = ("_dict",)
def __init__(self, dictionary: Mapping[str, Any]) -> None:
self._dict = dictionary
@@ -63,6 +65,8 @@ class ObjectInformation(ReadOnlyMapping):
in a single place. These values are based on the :class:`ReadOnlyMapping` class, to prevent their modification.
"""
__slots__ = ()
def __init__(
self,
layer_name: str,
@@ -98,6 +102,8 @@ class ObjectInterface(metaclass=abc.ABCMeta):
"""A base object required to be the ancestor of every object used in
volatility."""
__slots__ = ()
def __init__(
self,
context: "interfaces.context.ContextInterface",
@@ -305,6 +311,8 @@ class Template:
constructed at resolution time and then cached.
"""
__slots__ = "_vol"
def __init__(self, type_name: str, **arguments) -> None:
"""Stores the keyword arguments for later object creation."""
# Allow the updating of template arguments whilst still in template form