DuxReiNummariae 1.1.0-alpha.19
Simple and powerful budgeting application
Loading...
Searching...
No Matches
drn::storage::ExchangeRatesStorage Struct Referenceabstract

Manages the storage and retrieval of exchange rate data. More...

#include <ExchangeRatesStorage.hpp>

Inheritance diagram for drn::storage::ExchangeRatesStorage:
Collaboration diagram for drn::storage::ExchangeRatesStorage:

Public Member Functions

 ExchangeRatesStorage ()=default
 ExchangeRatesStorage (const ExchangeRatesStorage &)=delete
 ExchangeRatesStorage (ExchangeRatesStorage &&)=default
virtual ~ExchangeRatesStorage ()=default
virtual bool exists () const noexcept=0
 When implemented, determines if the exchange rates cache exists.
virtual conversion::ConversionMap load () const =0
 When implemented, loads the cached exchange rates.
ExchangeRatesStorageoperator= (const ExchangeRatesStorage &)=delete
ExchangeRatesStorageoperator= (ExchangeRatesStorage &&)=default
virtual void remove () const =0
 When implemented, removes the cached exchange rates.
virtual void store (const conversion::ConversionMap &cm) const =0
 When implemented, creates or overwrites the exchange rates cache.

Detailed Description

Manages the storage and retrieval of exchange rate data.

It is designed to facilitate the handling of exchange rate information. Usage of this class requires an appropriate storage back-end (e.g., database or in-memory storage).

Constructor & Destructor Documentation

◆ ExchangeRatesStorage() [1/3]

drn::storage::ExchangeRatesStorage::ExchangeRatesStorage ( )
default
Here is the caller graph for this function:

◆ ExchangeRatesStorage() [2/3]

drn::storage::ExchangeRatesStorage::ExchangeRatesStorage ( const ExchangeRatesStorage & )
delete
Here is the call graph for this function:

◆ ExchangeRatesStorage() [3/3]

drn::storage::ExchangeRatesStorage::ExchangeRatesStorage ( ExchangeRatesStorage && )
default
Here is the call graph for this function:

◆ ~ExchangeRatesStorage()

virtual drn::storage::ExchangeRatesStorage::~ExchangeRatesStorage ( )
virtualdefault

Member Function Documentation

◆ exists()

virtual bool drn::storage::ExchangeRatesStorage::exists ( ) const
nodiscardpure virtualnoexcept

When implemented, determines if the exchange rates cache exists.

Returns
True when the cache exists, false else-wise.

Implemented in drn::file_storage::ExchangeRatesFile.

◆ load()

virtual conversion::ConversionMap drn::storage::ExchangeRatesStorage::load ( ) const
nodiscardpure virtual

When implemented, loads the cached exchange rates.

Exceptions
StorageErrorWhen the exchange rates cache is not valid.
Returns
The loaded exchange rates.

Implemented in drn::file_storage::ExchangeRatesFile.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [1/2]

ExchangeRatesStorage & drn::storage::ExchangeRatesStorage::operator= ( const ExchangeRatesStorage & )
delete
Here is the call graph for this function:

◆ operator=() [2/2]

ExchangeRatesStorage & drn::storage::ExchangeRatesStorage::operator= ( ExchangeRatesStorage && )
default
Here is the call graph for this function:

◆ remove()

virtual void drn::storage::ExchangeRatesStorage::remove ( ) const
pure virtual

When implemented, removes the cached exchange rates.

Implemented in drn::file_storage::ExchangeRatesFile.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ store()

virtual void drn::storage::ExchangeRatesStorage::store ( const conversion::ConversionMap & cm) const
pure virtual

When implemented, creates or overwrites the exchange rates cache.

Exceptions
StorageErrorWhen the exchange rates cache cannot be saved.
Parameters
[in]cmThe exchange rates whose contents are to be cached.

Implemented in drn::file_storage::ExchangeRatesFile.

Here is the call graph for this function:
Here is the caller graph for this function: