Files
UoL/CM2005 Object Oriented Programming/Topic 5/5.3.3/Wallet.h
2021-06-13 12:25:52 -05:00

28 lines
701 B
C++

#pragma once
#include <string>
#include <map>
#include "OrderBookEntry.h"
class Wallet
{
public:
Wallet();
/** insert currency to the wallet */
void insertCurrency(std::string type, double amount);
/** remove currency from the wallet */
bool removeCurrency(std::string type, double amount);
/** check if the wallet contains at least this much currency */
bool containsCurrency(std::string type, double amount);
/** check if the wallet can cope with the ask or bid */
bool canFulfillOrder(OrderBookEntry order);
/** generate a string representation of the wallet */
std::string toString();
private:
std::map<std::string, double> currencies;
};