morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::ui::IBundleStore Class Referenceabstract

Where a client keeps verified files between runs, by content hash, and the digest of each application's last verified bundle. More...

#include <service_client.hpp>

Inheritance diagram for morph::ui::IBundleStore:
morph::ui::MemoryBundleStore

Public Member Functions

 IBundleStore (IBundleStore const &)=delete
IBundleStore & operator= (IBundleStore const &)=delete
 IBundleStore (IBundleStore &&)=delete
IBundleStore & operator= (IBundleStore &&)=delete
virtual std::optional< std::string > get (std::string_view hash) const =0
 Reads a file.
virtual void put (std::string const &hash, std::string bytes)=0
 Keeps a file.
virtual void remove (std::string_view hash)=0
 Drops a file.
virtual std::optional< std::string > lastDigest (std::string_view application) const =0
 The digest of an application's last verified bundle.
virtual void setLastDigest (std::string const &application, std::string digest)=0
 Records an application's last verified bundle.

Detailed Description

Where a client keeps verified files between runs, by content hash, and the digest of each application's last verified bundle.

A store is not trusted: VerifiedCache hashes what it reads back. A client calls it from whichever thread its exchange calls back on, and runs of several opens may overlap, so an implementation is safe to call from any thread.

Definition at line 46 of file service_client.hpp.

Member Function Documentation

◆ get()

virtual std::optional< std::string > morph::ui::IBundleStore::get ( std::string_view hash) const
nodiscardpure virtual

Reads a file.

Parameters
hashThe file's content hash.
Returns
Its bytes, or nothing when the store has none.

Implemented in morph::ui::MemoryBundleStore.

◆ put()

virtual void morph::ui::IBundleStore::put ( std::string const & hash,
std::string bytes )
pure virtual

Keeps a file.

Parameters
hashThe file's content hash.
bytesThe file.

Implemented in morph::ui::MemoryBundleStore.

◆ remove()

virtual void morph::ui::IBundleStore::remove ( std::string_view hash)
pure virtual

Drops a file.

Parameters
hashThe file's content hash.

Implemented in morph::ui::MemoryBundleStore.

◆ lastDigest()

virtual std::optional< std::string > morph::ui::IBundleStore::lastDigest ( std::string_view application) const
nodiscardpure virtual

The digest of an application's last verified bundle.

Parameters
applicationThe application's id.
Returns
The digest, or nothing.

Implemented in morph::ui::MemoryBundleStore.

◆ setLastDigest()

virtual void morph::ui::IBundleStore::setLastDigest ( std::string const & application,
std::string digest )
pure virtual

Records an application's last verified bundle.

Parameters
applicationThe application's id.
digestThe manifest's content hash.

Implemented in morph::ui::MemoryBundleStore.


The documentation for this class was generated from the following file: