-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExchangeService.cpp
27 lines (21 loc) · 1.03 KB
/
ExchangeService.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "ExchangeService.h"
#include "SingleProcessStorage.h"
namespace umstel {
using namespace std;
void setExchangeRate(const string & first_currency, const string & second_currency, const double exchange_rate) {
SingleProcessStorage & instance = SingleProcessStorage::instance();
instance.set(first_currency, second_currency, exchange_rate);
}
const double getExchangeRate(const string & first_currency, const string & second_currency) {
SingleProcessStorage & instance = SingleProcessStorage::instance();
return instance.get(first_currency, second_currency).first;
}
pair<double, short> _getExchangeRate(const string & first_currency, const string & second_currency) {
SingleProcessStorage & instance = SingleProcessStorage::instance();
return instance.get(first_currency, second_currency);
}
const string getExchangePath(const string & first_currency, const string & second_currency) {
SingleProcessStorage & instance = SingleProcessStorage::instance();
return instance.path(first_currency, second_currency);
}
}