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

Represents a budget item with monetary value that regularly occurs. More...

#include <BudgetedMoney.h>

Inheritance diagram for drn::budgeting::BudgetedMoney:
Collaboration diagram for drn::budgeting::BudgetedMoney:

Public Member Functions

 BudgetedMoney ()
 Constructs all member variables to their empty state.
 
 BudgetedMoney (BudgetedMoney &&) noexcept=default
 
 BudgetedMoney (BudgetSource source)
 Constructs all member variables to their empty state apart from the source.
 
 BudgetedMoney (BudgetSource source, pecunia::Money amount, const EventFrequency &period, const ::QDate &nextOccurOn)
 Fully initialises all member variables to their supplied values.
 
 BudgetedMoney (const BudgetedMoney &)=default
 
virtual ~BudgetedMoney ()=default
 
const pecunia::Money & amount () const noexcept
 The amount expected per period for the money.
 
const ::QDate & nextOccurOn () const noexcept
 The date the budgeted money item occurs on next.
 
bool operator!= (const BudgetedMoney &other) const
 Inequality operator compares all members.
 
std::strong_ordering operator<=> (const BudgetedMoney &) const noexcept=default
 
BudgetedMoneyoperator= (BudgetedMoney &&) noexcept=default
 
BudgetedMoneyoperator= (const BudgetedMoney &)=default
 
bool operator== (const BudgetedMoney &other) const
 Equality operator compares all members.
 
const EventFrequencyperiod () const noexcept
 The frequency at which the money event occurs.
 
void rename (BudgetSource source)
 Changes the source of the money.
 
const BudgetSourcesource () const noexcept
 The identifier of the source for the money.
 
void updateNextOccurOn ()
 Updates the next occur on date by the event frequency period.
 

Detailed Description

Represents a budget item with monetary value that regularly occurs.

Constructor & Destructor Documentation

◆ BudgetedMoney() [1/5]

drn::budgeting::BudgetedMoney::BudgetedMoney ( )

Constructs all member variables to their empty state.

Here is the caller graph for this function:

◆ BudgetedMoney() [2/5]

drn::budgeting::BudgetedMoney::BudgetedMoney ( BudgetSource source)
explicit

Constructs all member variables to their empty state apart from the source.

Exceptions
BudgetItemErrorWhen the source is empty.
Parameters
sourceThe source of the money budget item.
Here is the call graph for this function:

◆ 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
BudgetItemErrorWhen the source is empty.
BudgetItemErrorWhen the amount is less then zero.
BudgetItemErrorWhen the amount is not issued in a known currency.
BudgetItemErrorWhen the period is not known.
BudgetItemErrorWhen the next occur date is invalid.
Parameters
sourceThe source of the money budget item.
amountThe amount the money is for every period.
periodThe frequency period of the event for the money.
nextOccurOnThe date the money budget item last occurred on.
Here is the call graph for this function:

◆ BudgetedMoney() [4/5]

drn::budgeting::BudgetedMoney::BudgetedMoney ( const BudgetedMoney & )
default
Here is the call graph for this function:

◆ BudgetedMoney() [5/5]

drn::budgeting::BudgetedMoney::BudgetedMoney ( BudgetedMoney && )
defaultnoexcept
Here is the call graph for this function:

◆ ~BudgetedMoney()

virtual drn::budgeting::BudgetedMoney::~BudgetedMoney ( )
virtualdefault
Here is the call graph for this function:

Member Function Documentation

◆ amount()

const pecunia::Money & drn::budgeting::BudgetedMoney::amount ( ) const
nodiscardnoexcept

The amount expected per period for the money.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nextOccurOn()

const ::QDate & drn::budgeting::BudgetedMoney::nextOccurOn ( ) const
nodiscardnoexcept

The date the budgeted money item occurs on next.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator!=()

bool drn::budgeting::BudgetedMoney::operator!= ( const BudgetedMoney & other) const

Inequality operator compares all members.

Parameters
otherThe other object whose members should all not be equal.
Returns
When all member variables are not the same it'll give true, else false.
Here is the call graph for this function:

◆ operator<=>()

std::strong_ordering drn::budgeting::BudgetedMoney::operator<=> ( const BudgetedMoney & ) const
defaultnoexcept
Here is the call graph for this function:

◆ operator=() [1/2]

BudgetedMoney & drn::budgeting::BudgetedMoney::operator= ( BudgetedMoney && )
defaultnoexcept
Here is the call graph for this function:

◆ operator=() [2/2]

BudgetedMoney & drn::budgeting::BudgetedMoney::operator= ( const BudgetedMoney & )
default
Here is the call graph for this function:

◆ operator==()

bool drn::budgeting::BudgetedMoney::operator== ( const BudgetedMoney & other) const

Equality operator compares all members.

Parameters
otherThe other object whose members should all be equal.
Returns
When all member variables are the same it'll give true, else false.
Here is the call graph for this function:

◆ period()

const EventFrequency & drn::budgeting::BudgetedMoney::period ( ) const
nodiscardnoexcept

The frequency at which the money event occurs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rename()

void drn::budgeting::BudgetedMoney::rename ( BudgetSource source)

Changes the source of the money.

Exceptions
BudgetItemErrorWhen the new source is empty.
Parameters
sourceThe new source for the money.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ source()

const BudgetSource & drn::budgeting::BudgetedMoney::source ( ) const
nodiscardnoexcept

The identifier of the source for the money.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateNextOccurOn()

void drn::budgeting::BudgetedMoney::updateNextOccurOn ( )

Updates the next occur on date by the event frequency period.

Exceptions
BudgetItemErrorWhen event frequency period is not known.
BudgetItemErrorWhen the next occur date is not valid.
Here is the call graph for this function:
Here is the caller graph for this function: