DuxReiNummariae 1.1.0-alpha.29
Simple and powerful budgeting application
Loading...
Searching...
No Matches
drn::accounting::AccountNumber Class Reference

Represents a ledger book’s account through-out the entire accounting system, and is its unique identifier. It encapsulates the functionality for storing and managing this identifier. More...

#include <AccountNumber.hpp>

Collaboration diagram for drn::accounting::AccountNumber:

Public Types

using IntegerType = quint32
 The type used to store an account’s number. The size is large enough to accommodate different accounting number styles, e.g. sequential, type-sequential, etc.

Public Member Functions

 AccountNumber ()
 Default initialises the account number to an invalid state.
 AccountNumber (const IntegerType value)
 Fully initialises the account number.
const IntegerType & integer () const noexcept
 The underlying value of the account number.
bool operator!= (const AccountNumber &) const noexcept=default
std::strong_ordering operator<=> (const AccountNumber &) const noexcept=default
bool operator== (const AccountNumber &) const noexcept=default
bool operator== (const IntegerType &other) const noexcept
 Determines if the account number is equal to another integer value.

Static Public Attributes

static const quint8 fieldWidth_
static const IntegerType invalid_
 The number that is an invalid for an account code.

Detailed Description

Represents a ledger book’s account through-out the entire accounting system, and is its unique identifier. It encapsulates the functionality for storing and managing this identifier.

Member Typedef Documentation

◆ IntegerType

The type used to store an account’s number. The size is large enough to accommodate different accounting number styles, e.g. sequential, type-sequential, etc.

Constructor & Destructor Documentation

◆ AccountNumber() [1/2]

drn::accounting::AccountNumber::AccountNumber ( )

Default initialises the account number to an invalid state.

Here is the caller graph for this function:

◆ AccountNumber() [2/2]

drn::accounting::AccountNumber::AccountNumber ( const IntegerType value)
explicit

Fully initialises the account number.

Exceptions
ErrorWhen the value is not set.
Parameters
valueThe value for the account.

Member Function Documentation

◆ integer()

const IntegerType & drn::accounting::AccountNumber::integer ( ) const
nodiscardnoexcept

The underlying value of the account number.

◆ operator!=()

bool drn::accounting::AccountNumber::operator!= ( const AccountNumber & ) const
nodiscarddefaultnoexcept
Here is the call graph for this function:

◆ operator<=>()

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

◆ operator==() [1/2]

bool drn::accounting::AccountNumber::operator== ( const AccountNumber & ) const
nodiscarddefaultnoexcept
Here is the call graph for this function:

◆ operator==() [2/2]

bool drn::accounting::AccountNumber::operator== ( const IntegerType & other) const
nodiscardnoexcept

Determines if the account number is equal to another integer value.

Parameters
otherThe integer value to compare against the current account number.
Returns
A boolean value. Returns true if the integer value is equal to the current account number; otherwise, returns false.

Member Data Documentation

◆ fieldWidth_

const quint8 drn::accounting::AccountNumber::fieldWidth_
static

The number of characters that the account code number should always be displayed as, currently four.

◆ invalid_

const IntegerType drn::accounting::AccountNumber::invalid_
static

The number that is an invalid for an account code.