Represents a budget management system, allowing creation, modification, and analysis of budgets. More...
#include <Budget.h>
Classes | |
class | Iterator |
Provides functionality to traverse through a collection of elements sequentially, allowing controlled access to each element in the collection. More... | |
Public Member Functions | |
Budget ()=default | |
Budget (WageMap wages, BillMap bills={}, DebtMap debts={}, GoalMap goals={}, NontrackMap nontracks={}) | |
Full initialisation constructor. | |
Iterator | begin () const noexcept |
Returns an iterator pointing to the beginning of the budget's underlying structure. | |
Iterator | end () const noexcept |
Returns an iterator pointing to the end of the budget structure. | |
bool | isEmpty () const noexcept |
Determines if the budget is empty. | |
std::strong_ordering | operator<=> (const Budget &other) const noexcept |
Three-way comparison operator that performs the check in the order: wages, bills, debts, goals, and then nontracks. | |
bool | operator== (const Budget &) const noexcept=default |
std::size_t | size () const noexcept |
Calculates the size of all the budget items in the current budget. | |
std::map< std::type_index, std::set< BudgetSource > > | sources () const noexcept |
Provides all the sources in the budget. | |
Public Attributes | |
BillMap | bills_ |
The container of all the living bills leaving the budget. | |
DebtMap | debts_ |
The container of all the borrowed money leaving the budget. | |
GoalMap | goals_ |
The container of all the money being saved in the budget. | |
NontrackMap | nontracks_ |
The container of all the money that is not tracked in the budget. | |
WageMap | wages_ |
The container of all the wage coming into the budget. | |
Represents a budget management system, allowing creation, modification, and analysis of budgets.
All methods respect the structure of the budget, maintaining the integrity of categories, expenses, and incomes.
|
default |
|
explicit |
Full initialisation constructor.
It is designed to create a consolidated representation of a budget by accepting various components that contribute to financial planning.
wages | A collection representing the income sources for the budget. |
bills | A collection representing recurring expenses within the budget. |
debts | A collection representing obligations to be repaid over time. |
goals | A collection representing savings or investment targets within the budget. |
nontracks | A collection representing items that are not tracked, typically incidental or minor expenses. |
|
nodiscardnoexcept |
Returns an iterator pointing to the beginning of the budget's underlying structure.
This method enables iteration through the budget data. It can be used to traverse and access elements starting from the first position in a sequential manner.
|
nodiscardnoexcept |
Returns an iterator pointing to the end of the budget structure.
This method provides a means to signify the end boundary of the budget structure when performing iteration. It is commonly used in conjunction with other methods or algorithms that traverse or manipulate budget data.
|
nodiscardnoexcept |
Determines if the budget is empty.
|
nodiscardnoexcept |
Three-way comparison operator that performs the check in the order: wages, bills, debts, goals, and then nontracks.
other | The other object to compare against. |
|
nodiscarddefaultnoexcept |
|
nodiscardnoexcept |
Calculates the size of all the budget items in the current budget.
|
nodiscardnoexcept |
Provides all the sources in the budget.
BillMap drn::budgeting::Budget::bills_ |
The container of all the living bills leaving the budget.
DebtMap drn::budgeting::Budget::debts_ |
The container of all the borrowed money leaving the budget.
GoalMap drn::budgeting::Budget::goals_ |
The container of all the money being saved in the budget.
NontrackMap drn::budgeting::Budget::nontracks_ |
The container of all the money that is not tracked in the budget.
WageMap drn::budgeting::Budget::wages_ |
The container of all the wage coming into the budget.