IDS peak ICV v1.1.0
Loading...
Searching...
No Matches
IArchive Class Reference
Inheritance diagram for IArchive:

Public Member Functions

None set (self, str key, AllowedValue|IArchive value)
 Stores a value under the given key.
 
T get (self, str key, Type[T] 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.
 

Static Public Attributes

 AllowedValue
 
 T = TypeVar("T", bound=AllowedValue)
 

Detailed Description

Simplified interface for a hierarchical key-value archive system.

Provides dict-like access with restricted value types:

  • bool, int, float, str
  • IArchive (nested)
  • Lists of the above
Since
ids_peak_common 1.1

Definition at line 7 of file iarchive.py.

Member Function Documentation

◆ create_archive()

IArchive create_archive ( self)

Creates a new, empty archive instance.

Since
ids_peak_common 1.1

Reimplemented in Archive.

Definition at line 95 of file iarchive.py.

◆ get()

T get ( self,
str key,
Type[T] datatype )

Retrieves the value stored under the given key.

Parameters
keyKey of the value to retrieve.
datatypeThe expected datatype of the value.
Returns
The stored value.
Since
ids_peak_common 1.1

Reimplemented in Archive.

Definition at line 43 of file iarchive.py.

◆ get_archive()

IArchive get_archive ( self,
str key )

Retrieves the archive stored under the given key.

Parameters
keyKey of the archive to retrieve.
Returns
The stored archive.
Since
ids_peak_common 1.1

Reimplemented in Archive.

Definition at line 57 of file iarchive.py.

◆ has()

bool has ( self,
str key )

Checks whether a given key exists in the archive.

Parameters
keyThe key to check.
Returns
True if the key exists, False otherwise.
Since
ids_peak_common 1.1

Reimplemented in Archive.

Definition at line 70 of file iarchive.py.

◆ keys()

List[str] keys ( self)

Returns all keys currently stored in the archive.

Returns
List of keys.
Since
ids_peak_common 1.1

Reimplemented in Archive.

Definition at line 83 of file iarchive.py.

◆ set()

None set ( self,
str key,
AllowedValue | IArchive value )

Stores a value under the given key.

Parameters
keyKey to store the value under.
valueThe value to store (restricted types only).
Since
ids_peak_common 1.1

Reimplemented in Archive.

Definition at line 30 of file iarchive.py.

Field Documentation

◆ AllowedValue

AllowedValue
static
Initial value:
= Union[
bool, int, float, str,
List[bool], List[int], List[float], List[str], List["IArchive"]
]

Definition at line 22 of file iarchive.py.

◆ T

T = TypeVar("T", bound=AllowedValue)
static

Definition at line 27 of file iarchive.py.