![]() |
IDS peak ICV v1.1.0
|

Public Member Functions | |
| None | __init__ (self, Dict[str, Archive.AllowedValue]|None data=None) |
| None | set (self, str key, AllowedValue value) |
| Stores a value under the given key. | |
| T | get (self, str key, Type[T]|None datatype) |
| Retrieves the value stored under the given key. | |
| IArchive | get_archive (self, str key) |
| Retrieves the archive stored under the given key. | |
| bool | has (self, str key) |
| Checks whether a given key exists in the archive. | |
| List[str] | keys (self) |
| Returns all keys currently stored in the archive. | |
| IArchive | create_archive (self) |
| Creates a new, empty archive instance. | |
| str | __str__ (self) |
| Human-readable string representation of the archive. | |
| str | __repr__ (self) |
| bool | __eq__ (self, Any other) |
Static Public Attributes | |
| AllowedValue = IArchive.AllowedValue | IArchive | |
Protected Member Functions | |
| bool | _compare_values (self, Any lhs, Any rhs) |
| None | _validate_value (self, str key, Any value) |
| Ensures the provided value matches the allowed types. | |
Protected Attributes | |
| Dict | _storage = data |
Static Protected Attributes | |
| tuple | _ALLOWED_SCALARS = (bool, int, float, str, IArchive) |
A simple key-value store with type checking, similar to a dict.
Supports only:
Definition at line 11 of file archive.py.
| None __init__ | ( | self, | |
| Dict[str, Archive.AllowedValue] | None | data = None ) |
Definition at line 26 of file archive.py.
| bool __eq__ | ( | self, | |
| Any | other ) |
Definition at line 137 of file archive.py.
| str __repr__ | ( | self | ) |
Definition at line 134 of file archive.py.
| str __str__ | ( | self | ) |
Human-readable string representation of the archive.
Definition at line 125 of file archive.py.
|
protected |
Definition at line 150 of file archive.py.
|
protected |
Ensures the provided value matches the allowed types.
| key | The key for which the value is being validated. |
| value | The value to check. |
| NotSupportedException | If the type is not supported. |
Definition at line 163 of file archive.py.
| IArchive create_archive | ( | self | ) |
Creates a new, empty archive instance.
Reimplemented from IArchive.
Definition at line 117 of file archive.py.
Retrieves the value stored under the given key.
| key | Key of the value to retrieve. |
| datatype | The expected datatype of the value. If None is given, the type check is not executed. |
| CorruptedException | If the key is not found or the specified datatype is not the type of the stored value. |
Reimplemented from IArchive.
Definition at line 47 of file archive.py.
| IArchive get_archive | ( | self, | |
| str | key ) |
Retrieves the archive stored under the given key.
| key | Key of the archive to retrieve. |
| CorruptedException | If the key is not found or the specified datatype is not of type archive. |
Reimplemented from IArchive.
Definition at line 72 of file archive.py.
| bool has | ( | self, | |
| str | key ) |
Checks whether a given key exists in the archive.
| key | The key to check. |
Reimplemented from IArchive.
Definition at line 94 of file archive.py.
| List[str] keys | ( | self | ) |
Returns all keys currently stored in the archive.
Reimplemented from IArchive.
Definition at line 106 of file archive.py.
| None set | ( | self, | |
| str | key, | ||
| AllowedValue | value ) |
Stores a value under the given key.
| key | Key to store the value under. |
| value | The value to store (restricted types only). |
Reimplemented from IArchive.
Definition at line 34 of file archive.py.
|
staticprotected |
Definition at line 161 of file archive.py.
|
protected |
Definition at line 32 of file archive.py.
|
static |
Definition at line 24 of file archive.py.