Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
IStorage.h
Go to the documentation of this file.
1#ifndef ISTORAGE_H
2#define ISTORAGE_H
3
4#include <memory>
5
23template <typename Key, typename Data>
24class IStorage {
25public:
26 virtual ~IStorage() = default;
27
37 virtual void store(const Key& key, std::shared_ptr<Data> data) = 0;
38
48 virtual void assign(const Key& key, std::shared_ptr<Data> data) = 0;
49
60 virtual void store_or_assign(const Key& key, std::shared_ptr<Data> data) = 0;
61
67 virtual bool contains(const Key& key) const = 0;
68
78 virtual std::shared_ptr<Data> retrieve(const Key& key) = 0;
79
88 virtual void remove(const Key& key) = 0;
89};
90
91
92#endif // ISTORAGE_H
Generic storage interface for key–value containers.
Definition IStorage.h:24
virtual ~IStorage()=default
virtual void store(const Key &key, std::shared_ptr< Data > data)=0
Stores a new element.
virtual void store_or_assign(const Key &key, std::shared_ptr< Data > data)=0
Stores or assigns depending on key presence.
virtual void assign(const Key &key, std::shared_ptr< Data > data)=0
Assigns/replaces the data for an existing key.
virtual std::shared_ptr< Data > retrieve(const Key &key)=0
Retrieves the data associated with a key.
virtual bool contains(const Key &key) const =0
Checks if a given key is present in the storage.
virtual void remove(const Key &key)=0
Removes the entry associated with a key.