DuxReiNummariae 1.1.0-alpha.19
Simple and powerful budgeting application
Loading...
Searching...
No Matches
drn::budgeting::Goal Class Referencefinal

The representation of an amount of money that set aside each period for a particular usage. More...

#include <Goal.hpp>

Inheritance diagram for drn::budgeting::Goal:
Collaboration diagram for drn::budgeting::Goal:

Public Member Functions

 Goal ()=default
 Goal (const BudgetSource &source)
 Minimum initialisation constructor.
 Goal (const BudgetSource &source, const pecunia::Money &amount, const EventFrequency &period, const ::QDate &nextOccurOn, const pecunia::Money &final)
 Fully initialises all member variables to their supplied values.
 Goal (const Goal &other)
 Complete copy constructor.
std::unique_ptr< BudgetedMoneyclone () const override
 Creates a unique copy of the current instance.
const pecunia::Money & final () const
 The final amount of money the goal is completed at.
std::strong_ordering operator<=> (const Goal &other) const noexcept
 Performs a three-way comparison of the current instance with another instance.
Goaloperator= (const Goal &other)
 Complete copy assignment operator.
bool operator== (const Goal &other) const noexcept
 Full equality operator.
Public Member Functions inherited from drn::budgeting::BudgetedMoney
 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 &)=delete
 ~BudgetedMoney () override=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 &other) const noexcept
 Compares the current instance with another instance.
BudgetedMoneyoperator= (BudgetedMoney &&) noexcept=default
BudgetedMoneyoperator= (const BudgetedMoney &)=delete
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.
Public Member Functions inherited from drn::foundation::RequireClonable< BudgetedMoney >
virtual ~RequireClonable ()=default

Additional Inherited Members

Protected Member Functions inherited from drn::budgeting::BudgetedMoney
void assign (const BudgetedMoney &other)
 Assigns the values from another BudgetedMoney instance to the current instance.

Detailed Description

The representation of an amount of money that set aside each period for a particular usage.

Constructor & Destructor Documentation

◆ Goal() [1/4]

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

◆ Goal() [2/4]

drn::budgeting::Goal::Goal ( const BudgetSource & source)
explicit

Minimum initialisation constructor.

It initializes the internal data to represent a specific goal that aligns with the properties of the provided budget source. This should be used to create an instance representing a focused financial target derived from a specific source. The associated source allows for tracking and manipulation based on the user's budgeting decisions.

Parameters
sourceThe budget source from which the goal is derived.
Here is the call graph for this function:

◆ Goal() [3/4]

drn::budgeting::Goal::Goal ( const BudgetSource & source,
const pecunia::Money & amount,
const EventFrequency & period,
const ::QDate & nextOccurOn,
const pecunia::Money & final )

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.
finalThe final amount of money the goal is completed at.
Here is the call graph for this function:

◆ Goal() [4/4]

drn::budgeting::Goal::Goal ( const Goal & other)

Complete copy constructor.

Parameters
otherThe instance to copy.
Postcondition
The current instance is a deep copy of the other instance.
Here is the call graph for this function:

Member Function Documentation

◆ clone()

std::unique_ptr< BudgetedMoney > drn::budgeting::Goal::clone ( ) const
nodiscardoverridevirtual

Creates a unique copy of the current instance.

Returns
The cloned instance of the object.

Implements drn::foundation::RequireClonable< BudgetedMoney >.

◆ final()

const pecunia::Money & drn::budgeting::Goal::final ( ) const
nodiscard

The final amount of money the goal is completed at.

◆ operator<=>()

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

Performs a three-way comparison of the current instance with another instance.

Parameters
otherThe other Goal instance to compare with.
Returns
Gives the same comparison based upon the comparison logic implemented in BudgetedMoney, then if the result indicates equivalence, it then performs a comparison based on the final_ property.
Here is the call graph for this function:

◆ operator=()

Goal & drn::budgeting::Goal::operator= ( const Goal & other)

Complete copy assignment operator.

Parameters
otherThe instance to copy
Postcondition
The current instance is a deep copy of the other instance.
Returns
The modified instance.
Here is the call graph for this function:

◆ operator==()

bool drn::budgeting::Goal::operator== ( const Goal & other) const
nodiscardnoexcept

Full equality operator.

Parameters
otherThe other instance to compare for equality.
Returns
Gives true if all member variables are equivalent.
Here is the call graph for this function: