DuxReiNummariae 1.0.0-alpha.23
Simple and powerful budgeting application
 
Loading...
Searching...
No Matches
drn::budgeting::Budget Class Reference

Represents a budget management system, allowing creation, modification, and analysis of budgets. More...

#include <Budget.h>

Collaboration diagram for drn::budgeting::Budget:

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Budget() [1/2]

drn::budgeting::Budget::Budget ( )
default
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Budget() [2/2]

drn::budgeting::Budget::Budget ( WageMap wages,
BillMap bills = {},
DebtMap debts = {},
GoalMap goals = {},
NontrackMap nontracks = {} )
explicit

Full initialisation constructor.

It is designed to create a consolidated representation of a budget by accepting various components that contribute to financial planning.

Parameters
wagesA collection representing the income sources for the budget.
billsA collection representing recurring expenses within the budget.
debtsA collection representing obligations to be repaid over time.
goalsA collection representing savings or investment targets within the budget.
nontracksA collection representing items that are not tracked, typically incidental or minor expenses.
Here is the call graph for this function:

Member Function Documentation

◆ begin()

Iterator drn::budgeting::Budget::begin ( ) const
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.

Returns
An iterator positioned at the beginning of the budget's underlying structure.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ end()

Iterator drn::budgeting::Budget::end ( ) const
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.

Returns
An iterator pointing to the end boundary of the budget structure.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isEmpty()

bool drn::budgeting::Budget::isEmpty ( ) const
nodiscardnoexcept

Determines if the budget is empty.

Returns
When the budget doesn't contain any wages, bills, debts, nor goals gives true, false else-wise

◆ operator<=>()

std::strong_ordering drn::budgeting::Budget::operator<=> ( const Budget & other) const
nodiscardnoexcept

Three-way comparison operator that performs the check in the order: wages, bills, debts, goals, and then nontracks.

Parameters
otherThe other object to compare against.
Returns
The ordering relationship between them.
Here is the call graph for this function:

◆ operator==()

bool drn::budgeting::Budget::operator== ( const Budget & ) const
nodiscarddefaultnoexcept
Here is the call graph for this function:

◆ size()

std::size_t drn::budgeting::Budget::size ( ) const
nodiscardnoexcept

Calculates the size of all the budget items in the current budget.

Returns
The number of items in the budget.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sources()

std::map< std::type_index, std::set< BudgetSource > > drn::budgeting::Budget::sources ( ) const
nodiscardnoexcept

Provides all the sources in the budget.

Returns
The container mapping the type to a container of budget sources in the budget.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ bills_

BillMap drn::budgeting::Budget::bills_

The container of all the living bills leaving the budget.

◆ debts_

DebtMap drn::budgeting::Budget::debts_

The container of all the borrowed money leaving the budget.

◆ goals_

GoalMap drn::budgeting::Budget::goals_

The container of all the money being saved in the budget.

◆ nontracks_

NontrackMap drn::budgeting::Budget::nontracks_

The container of all the money that is not tracked in the budget.

◆ wages_

WageMap drn::budgeting::Budget::wages_

The container of all the wage coming into the budget.