DuxReiNummariae 1.0.0-alpha.23
Simple and powerful budgeting application
 
Loading...
Searching...
No Matches
drn::accounting::SequentialAccountNumberGenerator Class Referencefinal

An account code number generator that creates values sequentially. More...

#include <AccountNumberGenerator.h>

Inheritance diagram for drn::accounting::SequentialAccountNumberGenerator:
Collaboration diagram for drn::accounting::SequentialAccountNumberGenerator:

Public Member Functions

 AccountNumberGenerator (AccountNumber number={})
 Constructor for fully initialising the generator.
 
 AccountNumberGenerator (AccountNumberGenerator &&) noexcept=default
 
 AccountNumberGenerator (const AccountNumberGenerator &)=default
 
std::unique_ptr< AccountNumberGeneratorclone () const override
 When implemented, will clone all data members of the object.
 
AccountNumber current (const std::set< Account > &accounts) const override
 Finds the current largest account code number.
 
AccountNumberGeneratoroperator= (AccountNumberGenerator &&) noexcept=default
 
AccountNumberGeneratoroperator= (const AccountNumber &number)
 Assignment operator for setting the current generated account code number.
 
AccountNumberGeneratoroperator= (const AccountNumberGenerator &)=default
 
- Public Member Functions inherited from drn::accounting::AccountNumberGenerator
 AccountNumberGenerator (AccountNumber number={})
 Constructor for fully initialising the generator.
 
 AccountNumberGenerator (AccountNumberGenerator &&) noexcept=default
 
 AccountNumberGenerator (const AccountNumberGenerator &)=default
 
virtual ~AccountNumberGenerator ()=default
 
const AccountNumberoperator* () const
 Dereference operator to the current generated account code number.
 
const AccountNumberoperator++ ()
 Prefix incremental operator to advance to the next account code number.
 
AccountNumber operator++ (int)
 Postfix incremental operator to advance to the next account code number.
 
const AccountNumberoperator-- ()
 Prefix decremental operator to go back to the previous account code number.
 
AccountNumber operator-- (int)
 Postfix decremental operator to go back to the previous account code number.
 
AccountNumberGeneratoroperator= (AccountNumberGenerator &&) noexcept=default
 
AccountNumberGeneratoroperator= (const AccountNumber &number)
 Assignment operator for setting the current generated account code number.
 
AccountNumberGeneratoroperator= (const AccountNumberGenerator &)=default
 
void update (AccountNumber an)
 Updates the current account number to the supplied number when it is larger.
 

Additional Inherited Members

- Protected Member Functions inherited from drn::accounting::AccountNumberGenerator
const AccountNumbernumber () const noexcept
 An accessor to the current account code number.
 

Detailed Description

An account code number generator that creates values sequentially.

Member Function Documentation

◆ AccountNumberGenerator() [1/3]

drn::accounting::AccountNumberGenerator::AccountNumberGenerator ( AccountNumber number = {})
explicit

Constructor for fully initialising the generator.

Parameters
numberThe current account code number that is used.

◆ AccountNumberGenerator() [2/3]

drn::accounting::AccountNumberGenerator::AccountNumberGenerator ( AccountNumberGenerator && )
defaultnoexcept

◆ AccountNumberGenerator() [3/3]

drn::accounting::AccountNumberGenerator::AccountNumberGenerator ( const AccountNumberGenerator & )
default

◆ clone()

std::unique_ptr< AccountNumberGenerator > drn::accounting::SequentialAccountNumberGenerator::clone ( ) const
nodiscardoverridevirtual

When implemented, will clone all data members of the object.

Returns
The cloned object.

Implements drn::accounting::AccountNumberGenerator.

◆ current()

AccountNumber drn::accounting::SequentialAccountNumberGenerator::current ( const std::set< Account > & accounts) const
nodiscardoverridevirtual

Finds the current largest account code number.

Parameters
accountsThe current listing of all the accounts in the account ledger.
Returns
The current highest account code number found, or AccountNumber::invalid_ if not any.

Implements drn::accounting::AccountNumberGenerator.

◆ operator=() [1/3]

AccountNumberGenerator & drn::accounting::AccountNumberGenerator::operator= ( AccountNumberGenerator && )
defaultnoexcept

◆ operator=() [2/3]

AccountNumberGenerator & drn::accounting::AccountNumberGenerator::operator= ( const AccountNumber & number)

Assignment operator for setting the current generated account code number.

Parameters
numberThe number to set the account code number generated to.
Returns
The current instance.

◆ operator=() [3/3]

AccountNumberGenerator & drn::accounting::AccountNumberGenerator::operator= ( const AccountNumberGenerator & )
default