Represents a budget item with monetary value that regularly occurs.
More...
#include <BudgetedMoney.hpp>
Represents a budget item with monetary value that regularly occurs.
◆ BudgetedMoney() [1/5]
| drn::budgeting::BudgetedMoney::BudgetedMoney |
( |
| ) |
|
Constructs all member variables to their empty state.
◆ BudgetedMoney() [2/5]
| drn::budgeting::BudgetedMoney::BudgetedMoney |
( |
BudgetSource | source | ) |
|
|
explicit |
Constructs all member variables to their empty state apart from the source.
- Exceptions
-
- Parameters
-
| source | The source of the money budget item. |
◆ BudgetedMoney() [3/5]
| drn::budgeting::BudgetedMoney::BudgetedMoney |
( |
BudgetSource | source, |
|
|
pecunia::Money | amount, |
|
|
const EventFrequency & | period, |
|
|
const ::QDate & | nextOccurOn ) |
Fully initialises all member variables to their supplied values.
- Exceptions
-
- Parameters
-
| source | The source of the money budget item. |
| amount | The amount the money is for every period. |
| period | The frequency period of the event for the money. |
| nextOccurOn | The date the money budget item last occurred on. |
◆ BudgetedMoney() [4/5]
| drn::budgeting::BudgetedMoney::BudgetedMoney |
( |
const BudgetedMoney & | | ) |
|
|
delete |
◆ BudgetedMoney() [5/5]
| drn::budgeting::BudgetedMoney::BudgetedMoney |
( |
BudgetedMoney && | | ) |
|
|
defaultnoexcept |
◆ ~BudgetedMoney()
| drn::budgeting::BudgetedMoney::~BudgetedMoney |
( |
| ) |
|
|
overridedefault |
◆ amount()
| const pecunia::Money & drn::budgeting::BudgetedMoney::amount |
( |
| ) |
const |
|
nodiscardnoexcept |
The amount expected per period for the money.
◆ assign()
| void drn::budgeting::BudgetedMoney::assign |
( |
const BudgetedMoney & | other | ) |
|
|
protected |
Assigns the values from another BudgetedMoney instance to the current instance.
Copies all member variables from the given BudgetedMoney object into the current object. It is used internally by copy-related operations to ensure consistent transfer of state between instances, but makes /no/ validation of the data.
- Parameters
-
| other | The instance whose values are to be assigned to the current instance. |
◆ nextOccurOn()
| const ::QDate & drn::budgeting::BudgetedMoney::nextOccurOn |
( |
| ) |
const |
|
nodiscardnoexcept |
The date the budgeted money item occurs on next.
◆ operator!=()
| bool drn::budgeting::BudgetedMoney::operator!= |
( |
const BudgetedMoney & | other | ) |
const |
Inequality operator compares all members.
- Parameters
-
| other | The other object whose members should all not be equal. |
- Returns
- When all member variables are not the same it'll give true, else false.
◆ operator<=>()
| std::strong_ordering drn::budgeting::BudgetedMoney::operator<=> |
( |
const BudgetedMoney & | other | ) |
const |
|
noexcept |
Compares the current instance with another instance.
Compares all member variables of the current instance against the provided instance.
- Parameters
-
| other | The other instance to compare against. |
- Returns
- Gives the comparison as performed in the following order of priority: source, period, nextOccurOn, and amount. The first non-equivalent member determines the ordering result. Gives the comparison result:
- std::strong_ordering::less if the current instance is less than the other.
- std::strong_ordering::equal if the two instances are equivalent.
- std::strong_ordering::greater if the current instance is greater than the other.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ operator==()
| bool drn::budgeting::BudgetedMoney::operator== |
( |
const BudgetedMoney & | other | ) |
const |
Equality operator compares all members.
- Parameters
-
| other | The other object whose members should all be equal. |
- Returns
- When all member variables are the same it'll give true, else false.
◆ period()
| const EventFrequency & drn::budgeting::BudgetedMoney::period |
( |
| ) |
const |
|
nodiscardnoexcept |
The frequency at which the money event occurs.
◆ rename()
| void drn::budgeting::BudgetedMoney::rename |
( |
BudgetSource | source | ) |
|
Changes the source of the money.
- Exceptions
-
- Parameters
-
| source | The new source for the money. |
◆ source()
| const BudgetSource & drn::budgeting::BudgetedMoney::source |
( |
| ) |
const |
|
nodiscardnoexcept |
The identifier of the source for the money.
◆ updateNextOccurOn()
| void drn::budgeting::BudgetedMoney::updateNextOccurOn |
( |
| ) |
|
Updates the next occur on date by the event frequency period.
- Exceptions
-