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

An IBundleStore in memory: it lasts as long as the process. Safe to call from any thread. More...

#include <service_client.hpp>

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

Public Member Functions

std::optional< std::string > get (std::string_view hash) const override
 Reads a file.
void put (std::string const &hash, std::string bytes) override
 Keeps a file.
void remove (std::string_view hash) override
 Drops a file.
std::optional< std::string > lastDigest (std::string_view application) const override
 The digest of an application's last verified bundle.
void setLastDigest (std::string const &application, std::string digest) override
 Records an application's last verified bundle.
std::size_t size () const
 How many files the store holds.
Public Member Functions inherited from morph::ui::IBundleStore
 IBundleStore (IBundleStore const &)=delete
IBundleStore & operator= (IBundleStore const &)=delete
 IBundleStore (IBundleStore &&)=delete
IBundleStore & operator= (IBundleStore &&)=delete

Detailed Description

An IBundleStore in memory: it lasts as long as the process. Safe to call from any thread.

Definition at line 83 of file service_client.hpp.

Member Function Documentation

◆ get()

std::optional< std::string > morph::ui::MemoryBundleStore::get ( std::string_view hash) const
inlinenodiscardoverridevirtual

Reads a file.

Parameters
hashThe file's content hash.
Returns
Its bytes, or nothing.

Implements morph::ui::IBundleStore.

Definition at line 88 of file service_client.hpp.

◆ put()

void morph::ui::MemoryBundleStore::put ( std::string const & hash,
std::string bytes )
inlineoverridevirtual

Keeps a file.

Parameters
hashThe file's content hash.
bytesThe file.

Implements morph::ui::IBundleStore.

Definition at line 101 of file service_client.hpp.

◆ remove()

void morph::ui::MemoryBundleStore::remove ( std::string_view hash)
inlineoverridevirtual

Drops a file.

Parameters
hashThe file's content hash.

Implements morph::ui::IBundleStore.

Definition at line 108 of file service_client.hpp.

◆ lastDigest()

std::optional< std::string > morph::ui::MemoryBundleStore::lastDigest ( std::string_view application) const
inlinenodiscardoverridevirtual

The digest of an application's last verified bundle.

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

Implements morph::ui::IBundleStore.

Definition at line 118 of file service_client.hpp.

◆ setLastDigest()

void morph::ui::MemoryBundleStore::setLastDigest ( std::string const & application,
std::string digest )
inlineoverridevirtual

Records an application's last verified bundle.

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

Implements morph::ui::IBundleStore.

Definition at line 131 of file service_client.hpp.

◆ size()

std::size_t morph::ui::MemoryBundleStore::size ( ) const
inlinenodiscard

How many files the store holds.

Returns
The count.

Definition at line 138 of file service_client.hpp.


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