This represents a budget item's amount distributed in a survey.
More...
#include <DistributedAmount.hpp>
This represents a budget item's amount distributed in a survey.
◆ DistributedAmount() [1/4]
drn::surveying::DistributedAmount::DistributedAmount |
( |
| ) |
|
|
default |
◆ DistributedAmount() [2/4]
drn::surveying::DistributedAmount::DistributedAmount |
( |
pecunia::Money | distributed, |
|
|
::QDate | nextOccursOn, |
|
|
pecunia::Money | maximum ) |
Full initialisation constructor.
- Exceptions
-
Error | Thrown when the distributed amount exceeds the maximum permissible value. |
- Precondition
- The next occurrence date must be a valid date.
- Parameters
-
distributed | The distributed amount to initialise with. |
nextOccursOn | The date when the distributed amount is next scheduled. |
maximum | The maximum permissible value for the distributed amount. |
◆ DistributedAmount() [3/4]
drn::surveying::DistributedAmount::DistributedAmount |
( |
const DistributedAmount & | other | ) |
|
Creates a new instance by copying the values from another instance.
- Parameters
-
other | The 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.
◆ DistributedAmount() [4/4]
Constructs an instance by transferring ownership from another instance.
- Parameters
-
other | The 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.
◆ distributed()
const pecunia::Money & drn::surveying::DistributedAmount::distributed |
( |
| ) |
const |
|
nodiscardnoexcept |
An accessor the current distributed amount for a budget item in a survey.
◆ maximum()
const pecunia::Money & drn::surveying::DistributedAmount::maximum |
( |
| ) |
const |
|
nodiscardnoexcept |
An accessor the maximum permissible value for the distributed amount.
◆ nextOccursOn()
const ::QDate & drn::surveying::DistributedAmount::nextOccursOn |
( |
| ) |
const |
|
nodiscardnoexcept |
An accessor the date when the distributed amount is next scheduled.
◆ operator+()
DistributedAmount drn::surveying::DistributedAmount::operator+ |
( |
const pecunia::Money & | amount | ) |
const |
|
nodiscard |
Performs addition on the distributed amount.
- Exceptions
-
Error | Thrown when the new distributed amount exceeds the maximum permissible value. |
- Parameters
-
amount | The amount to increase the distributed amount by. |
- Returns
- The result of the mathematical operation.
◆ operator+=()
DistributedAmount & drn::surveying::DistributedAmount::operator+= |
( |
const pecunia::Money & | amount | ) |
|
Performs addition on the distributed amount.
- Exceptions
-
Error | Thrown when the new distributed amount exceeds the maximum permissible value. |
- Parameters
-
amount | The 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.
◆ operator-()
DistributedAmount drn::surveying::DistributedAmount::operator- |
( |
const pecunia::Money & | amount | ) |
const |
|
nodiscard |
Performs subtraction on the distributed amount.
- Exceptions
-
Error | Thrown when the new distributed amount exceeds the maximum permissible value. |
- Parameters
-
amount | The amount to decrease the distributed amount by. |
- Returns
- The result of the mathematical operation.
◆ operator-=()
DistributedAmount & drn::surveying::DistributedAmount::operator-= |
( |
const pecunia::Money & | amount | ) |
|
Performs subtraction on the distributed amount.
- Exceptions
-
Error | Thrown when the new distributed amount exceeds the maximum permissible value. |
- Parameters
-
amount | The 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.
◆ operator<=>()
std::strong_ordering drn::surveying::DistributedAmount::operator<=> |
( |
const DistributedAmount & | other | ) |
const |
|
nodiscarddefaultnoexcept |
◆ operator=() [1/3]
Full object assignment.
- Parameters
-
other | The 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.
◆ operator=() [2/3]
DistributedAmount & drn::surveying::DistributedAmount::operator= |
( |
const pecunia::Money & | amount | ) |
|
Distributed amount assignment.
- Exceptions
-
Error | Thrown when the distributed amount exceeds the maximum permissible value. |
- Parameters
-
amount | The 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.
◆ operator=() [3/3]
Full object assignment ownership transfer.
- Parameters
-
other | The 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.