|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|
Generic storage interface for key–value containers. More...
#include <IStorage.h>
Public Member Functions | |
| virtual | ~IStorage ()=default |
| virtual void | store (const Key &key, std::shared_ptr< Data > data)=0 |
| Stores a new element. | |
| virtual void | assign (const Key &key, std::shared_ptr< Data > data)=0 |
| Assigns/replaces the data for an existing key. | |
| virtual void | store_or_assign (const Key &key, std::shared_ptr< Data > data)=0 |
| Stores or assigns depending on key presence. | |
| virtual bool | contains (const Key &key) const =0 |
| Checks if a given key is present in the storage. | |
| virtual std::shared_ptr< Data > | retrieve (const Key &key)=0 |
| Retrieves the data associated with a key. | |
| virtual void | remove (const Key &key)=0 |
| Removes the entry associated with a key. | |
Generic storage interface for key–value containers.
This template defines the minimal operations required for a storage-like container:
It is used by Block as a base abstraction.
Definition at line 24 of file IStorage.h.
|
pure virtual |
Assigns/replaces the data for an existing key.
Implementations typically expect the key to exist and may error or log if it does not.
| key | Key to update. |
| data | Shared pointer to the new data object. |
Implemented in DependentBlock, and Block.
|
pure virtual |
Checks if a given key is present in the storage.
| key | Key to test. |
Implemented in Block.
|
pure virtual |
Removes the entry associated with a key.
If the key does not exist, the behavior depends on the implementation (may be a no-op, log, or throw).
| key | Key to remove. |
Implemented in Block.
|
pure virtual |
Retrieves the data associated with a key.
Semantics on non-existing keys are up to the implementation (may throw, log, or return nullptr).
| key | Key to retrieve. |
Implemented in Block.
|
pure virtual |
Stores a new element.
Behavior when the key already exists depends on the implementation (it may overwrite, ignore, or log an error).
| key | Key associated with the data. |
| data | Shared pointer to the data object. |
Implemented in Block.
|
pure virtual |