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

This represents a budget item's amount distributed in a survey. More...

#include <DistributedAmount.hpp>

Collaboration diagram for drn::surveying::DistributedAmount:

Public Member Functions

 DistributedAmount ()=default
 
 DistributedAmount (const DistributedAmount &other)
 Creates a new instance by copying the values from another instance.
 
 DistributedAmount (DistributedAmount &&other) noexcept
 Constructs an instance by transferring ownership from another instance.
 
 DistributedAmount (pecunia::Money distributed, ::QDate nextOccursOn, pecunia::Money maximum)
 Full initialisation constructor.
 
const pecunia::Money & distributed () const noexcept
 An accessor the current distributed amount for a budget item in a survey.
 
const pecunia::Money & maximum () const noexcept
 An accessor the maximum permissible value for the distributed amount.
 
const ::QDate & nextOccursOn () const noexcept
 An accessor the date when the distributed amount is next scheduled.
 
DistributedAmount operator+ (const pecunia::Money &amount) const
 Performs addition on the distributed amount.
 
DistributedAmountoperator+= (const pecunia::Money &amount)
 Performs addition on the distributed amount.
 
DistributedAmount operator- (const pecunia::Money &amount) const
 Performs subtraction on the distributed amount.
 
DistributedAmountoperator-= (const pecunia::Money &amount)
 Performs subtraction on the distributed amount.
 
std::strong_ordering operator<=> (const DistributedAmount &other) const noexcept=default
 
DistributedAmountoperator= (const DistributedAmount &other)
 Full object assignment.
 
DistributedAmountoperator= (const pecunia::Money &amount)
 Distributed amount assignment.
 
DistributedAmountoperator= (DistributedAmount &&other) noexcept
 Full object assignment ownership transfer.
 

Detailed Description

This represents a budget item's amount distributed in a survey.

Constructor & Destructor Documentation

◆ DistributedAmount() [1/4]

drn::surveying::DistributedAmount::DistributedAmount ( )
default
Here is the caller graph for this function:

◆ DistributedAmount() [2/4]

drn::surveying::DistributedAmount::DistributedAmount ( pecunia::Money distributed,
::QDate nextOccursOn,
pecunia::Money maximum )

Full initialisation constructor.

Exceptions
ErrorThrown when the distributed amount exceeds the maximum permissible value.
Precondition
The next occurrence date must be a valid date.
Parameters
distributedThe distributed amount to initialise with.
nextOccursOnThe date when the distributed amount is next scheduled.
maximumThe maximum permissible value for the distributed amount.
Here is the call graph for this function:

◆ DistributedAmount() [3/4]

drn::surveying::DistributedAmount::DistributedAmount ( const DistributedAmount & other)

Creates a new instance by copying the values from another instance.

Parameters
otherThe instance to copy from.
Postcondition
The newly created instance will have identical values for distributed amount, the next occurrence date, and the maximum permissible value as the provided instance.
Here is the call graph for this function:

◆ DistributedAmount() [4/4]

drn::surveying::DistributedAmount::DistributedAmount ( DistributedAmount && other)
noexcept

Constructs an instance by transferring ownership from another instance.

Parameters
otherThe instance to efficiently transfer resources and state from.
Postcondition
The new instance will take ownership of all resources that belonged to the other instance prior to the call. The other instance will remain valid but its state will be unspecified.
Here is the call graph for this function:

Member Function Documentation

◆ distributed()

const pecunia::Money & drn::surveying::DistributedAmount::distributed ( ) const
nodiscardnoexcept

An accessor the current distributed amount for a budget item in a survey.

Here is the caller graph for this function:

◆ maximum()

const pecunia::Money & drn::surveying::DistributedAmount::maximum ( ) const
nodiscardnoexcept

An accessor the maximum permissible value for the distributed amount.

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

◆ nextOccursOn()

const ::QDate & drn::surveying::DistributedAmount::nextOccursOn ( ) const
nodiscardnoexcept

An accessor the date when the distributed amount is next scheduled.

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

◆ operator+()

DistributedAmount drn::surveying::DistributedAmount::operator+ ( const pecunia::Money & amount) const
nodiscard

Performs addition on the distributed amount.

Exceptions
ErrorThrown when the new distributed amount exceeds the maximum permissible value.
Parameters
amountThe amount to increase the distributed amount by.
Returns
The result of the mathematical operation.
Here is the call graph for this function:

◆ operator+=()

DistributedAmount & drn::surveying::DistributedAmount::operator+= ( const pecunia::Money & amount)

Performs addition on the distributed amount.

Exceptions
ErrorThrown when the new distributed amount exceeds the maximum permissible value.
Parameters
amountThe amount to increase the distributed amount by.
Postcondition
The current instance will have the distributed amount increased by the requested amount. The next occurrence date, and the maximum permissible value remain unchanged.
Returns
The current instance after the mathematical operation.
Here is the call graph for this function:

◆ operator-()

DistributedAmount drn::surveying::DistributedAmount::operator- ( const pecunia::Money & amount) const
nodiscard

Performs subtraction on the distributed amount.

Exceptions
ErrorThrown when the new distributed amount exceeds the maximum permissible value.
Parameters
amountThe amount to decrease the distributed amount by.
Returns
The result of the mathematical operation.
Here is the call graph for this function:

◆ operator-=()

DistributedAmount & drn::surveying::DistributedAmount::operator-= ( const pecunia::Money & amount)

Performs subtraction on the distributed amount.

Exceptions
ErrorThrown when the new distributed amount exceeds the maximum permissible value.
Parameters
amountThe amount to increase the distributed amount by.
Postcondition
The current instance will have the distributed amount decreased by the requested amount. The next occurrence date, and the maximum permissible value remain unchanged.
Returns
The current instance after the mathematical operation.
Here is the call graph for this function:

◆ operator<=>()

std::strong_ordering drn::surveying::DistributedAmount::operator<=> ( const DistributedAmount & other) const
nodiscarddefaultnoexcept
Here is the call graph for this function:

◆ operator=() [1/3]

DistributedAmount & drn::surveying::DistributedAmount::operator= ( const DistributedAmount & other)

Full object assignment.

Parameters
otherThe other instance to assign from.
Postcondition
The current instance will have identical values for distributed amount, the next occurrence date, and the maximum permissible value as the provided instance.
Returns
The current instance post assignment.
Here is the call graph for this function:

◆ operator=() [2/3]

DistributedAmount & drn::surveying::DistributedAmount::operator= ( const pecunia::Money & amount)

Distributed amount assignment.

Exceptions
ErrorThrown when the distributed amount exceeds the maximum permissible value.
Parameters
amountThe amount to assign to the distributed amount.
Postcondition
The current instance will have identical values for the distributed amount. The next occurrence date, and the maximum permissible value remain unchanged.
Returns
The current instance post assignment.
Here is the call graph for this function:

◆ operator=() [3/3]

DistributedAmount & drn::surveying::DistributedAmount::operator= ( DistributedAmount && other)
noexcept

Full object assignment ownership transfer.

Parameters
otherThe instance to efficiently transfer resources and state from.
Postcondition
The new instance will take ownership of all resources that belonged to the other instance prior to the call. The other instance will remain valid but its state will be unspecified.
Returns
The current instance post assignment.
Here is the call graph for this function: