QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
WrapNum Class Reference

The WrapNum class A counter that wraps back to 0 (borrowing from initialvalue on the way down) every modulus values, instead of counting up forever like UnitNum/TenNum/HundredNum. Its own next()/previous() only computes its own wrapped value; carrying into (or borrowing from) the preceding numeric part is handled by NumerotationContextCommands::next()/ previous(), since only the composition loop can see adjacent parts. More...

#include <numerotationcontextcommands.h>

Inheritance diagram for WrapNum:
Inheritance graph
Collaboration diagram for WrapNum:
Collaboration graph

Public Member Functions

 WrapNum (Diagram *)
QString toRepresentedString (const QString) const override
 WrapNum::toRepresentedString.
NumerotationContext next (const NumerotationContext &, const int) const override
 WrapNum::next Wraps this part's own value back to 0 every modulus values (carrying into the adjacent part is handled by NumerotationContextCommands::next(), which has visibility into the other parts).
NumerotationContext previous (const NumerotationContext &, const int) const override
 WrapNum::previous.
Public Member Functions inherited from NumStrategy
 NumStrategy (Diagram *=nullptr)
virtual ~NumStrategy ()

Additional Inherited Members

Protected Member Functions inherited from NumStrategy
NumerotationContext nextString (const NumerotationContext &, const int) const
 NumStrategy::nextString.
NumerotationContext nextNumber (const NumerotationContext &, const int) const
 NumStrategy::nextNumber.
NumerotationContext previousNumber (const NumerotationContext &, const int) const
 NumStrategy::previousNumber.
Protected Attributes inherited from NumStrategy
Diagramdiagram_

Detailed Description

The WrapNum class A counter that wraps back to 0 (borrowing from initialvalue on the way down) every modulus values, instead of counting up forever like UnitNum/TenNum/HundredNum. Its own next()/previous() only computes its own wrapped value; carrying into (or borrowing from) the preceding numeric part is handled by NumerotationContextCommands::next()/ previous(), since only the composition loop can see adjacent parts.

Constructor & Destructor Documentation

◆ WrapNum()

WrapNum::WrapNum ( Diagram * d)

Constructor

Here is the call graph for this function:

Member Function Documentation

◆ next()

NumerotationContext WrapNum::next ( const NumerotationContext & nc,
const int i ) const
overridevirtual

WrapNum::next Wraps this part's own value back to 0 every modulus values (carrying into the adjacent part is handled by NumerotationContextCommands::next(), which has visibility into the other parts).

Returns
the next NumerotationContext nc at position i

Implements NumStrategy.

Here is the call graph for this function:

◆ previous()

NumerotationContext WrapNum::previous ( const NumerotationContext & nc,
const int i ) const
overridevirtual

WrapNum::previous.

Returns
the previous NumerotationContext nc at posiiton i

Implements NumStrategy.

Here is the call graph for this function:

◆ toRepresentedString()

QString WrapNum::toRepresentedString ( const QString num) const
overridevirtual

WrapNum::toRepresentedString.

Returns
the represented string of num

Implements NumStrategy.


The documentation for this class was generated from the following files: