23template <
typename Key,
typename Data>
37 virtual void store(
const Key& key, std::shared_ptr<Data> data) = 0;
48 virtual void assign(
const Key& key, std::shared_ptr<Data> data) = 0;
67 virtual bool contains(
const Key& key)
const = 0;
78 virtual std::shared_ptr<Data>
retrieve(
const Key& key) = 0;
88 virtual void remove(
const Key& key) = 0;
Generic storage interface for key–value containers.
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.