Maps all the budgeted monies to their source. More...
#include <BudgetedMoneyMap.hpp>
Public Member Functions | |
BudgetedMoneyMap (std::map< BudgetSource, BudgetedMoneyType > monies={}) | |
void | add (BudgetedMoneyType added) |
Places the new budgeted money into the budgeted monies indexed by its source. | |
const_iterator | begin () const |
const_iterator | end () const |
bool | has (const BudgetSource &source) const |
Determines if a specific budgeted money exists within the budgeted monies. | |
std::strong_ordering | operator<=> (const BudgetedMoneyMap &other) const noexcept |
bool | operator== (const BudgetedMoneyMap &) const noexcept=default |
void | remove (const BudgetSource &source) |
Removes an budgeted money from the budgeted monies. | |
void | rename (const BudgetSource &original, BudgetSource changed) |
std::set< BudgetSource > | sources () const |
An accessor to all the known budgeted money sources. | |
pecunia::Money | total (const pecunia::Currency &code, const EventFrequency period) const |
Calculates the total amount of budgeted monies. | |
void | update (BudgetedMoneyType updated) |
Changes the budgeted money to the newly supplied one indexed by the source of the budgeted money. When the new budgeted money is not in the same currency as the existing entry, the new budgeted money will replace the existing entry, i.e. no currency conversions will take place. | |
Maps all the budgeted monies to their source.
BudgetedMoneyType | This is the type that is mapped to a budget item source. This type must derive from the BudgetedMoney class. |
|
explicit |
void drn::budgeting::BudgetedMoneyMap< BudgetedMoneyType >::add | ( | BudgetedMoneyType | added | ) |
Places the new budgeted money into the budgeted monies indexed by its source.
BudgetItemError | When the supplied budgeted money already exists in the budgeted monies. |
added | The new budgeted money that is placed into the budgeted monies. |
|
nodiscard |
|
nodiscard |
|
nodiscard |
Determines if a specific budgeted money exists within the budgeted monies.
source | The source of the budgeted money to check. |
|
nodiscardnoexcept |
|
nodiscarddefaultnoexcept |
void drn::budgeting::BudgetedMoneyMap< BudgetedMoneyType >::remove | ( | const BudgetSource & | source | ) |
Removes an budgeted money from the budgeted monies.
BudgetItemError | When the supplied source does not exist. |
source | The budgeted money source to remove. |
void drn::budgeting::BudgetedMoneyMap< BudgetedMoneyType >::rename | ( | const BudgetSource & | original, |
BudgetSource | changed ) |
Changes the source of an budgeted money, and updates it's mapping.
BudgetItemError | When the supplied current source does not exist. |
BudgetItemError | When the supplied changed source already exists. |
original | The current source of the budgeted money. |
changed | The new source of the budgeted money. |
|
nodiscard |
An accessor to all the known budgeted money sources.
|
nodiscard |
Calculates the total amount of budgeted monies.
code | The issued currency to calculate the monies in. |
period | The frequency period all monies should be tabulated in. |
void drn::budgeting::BudgetedMoneyMap< BudgetedMoneyType >::update | ( | BudgetedMoneyType | updated | ) |
Changes the budgeted money to the newly supplied one indexed by the source of the budgeted money. When the new budgeted money is not in the same currency as the existing entry, the new budgeted money will replace the existing entry, i.e. no currency conversions will take place.
BudgetItemError | When the supplied source source does not exist. |
updated | The new budgeted money to update the indexed entry to. |