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

The NumerotationContextCommands class this class provide methods to handle content of NumerotationContext. More...

#include <numerotationcontextcommands.h>

Collaboration diagram for NumerotationContextCommands:
Collaboration graph

Public Member Functions

 NumerotationContextCommands (const NumerotationContext &, Diagram *=nullptr)
 Constructor.
 ~NumerotationContextCommands ()
 Destructor.
NumerotationContext next ()
 NumerotationContextCommands::next.
NumerotationContext previous ()
 NumerotationContextCommands::previous.
QString toRepresentedString ()
 NumerotationContextCommands::toFinalString.

Private Member Functions

void setNumStrategy (const QString &)
 NumerotationContextCommands::setNumStrategy apply the good strategy relative to str.

Static Private Member Functions

static void carry (NumerotationContext &contextnum, int from_index)
 NumerotationContextCommands::carry Add one unit to the nearest numeric part at or before from_index in contextnum, skipping non-numeric parts (e.g. a "." string separator) along the way. If that part is itself a wrap part and this pushes it to (or past) its own modulus, it wraps back to 0 and the carry cascades further back – so wrap parts can be chained (e.g. seconds wrapping into minutes wrapping into hours).
static void borrow (NumerotationContext &contextnum, int from_index)
 NumerotationContextCommands::borrow Inverse of carry(): subtract one unit from the nearest numeric part at or before from_index. If that part is itself a wrap part and this takes it below 0, it wraps to (modulus - 1) and the borrow cascades further back.

Private Attributes

Diagramdiagram_
NumerotationContext context_
NumStrategystrategy_

Detailed Description

The NumerotationContextCommands class this class provide methods to handle content of NumerotationContext.

Constructor & Destructor Documentation

◆ NumerotationContextCommands()

NumerotationContextCommands::NumerotationContextCommands ( const NumerotationContext & nc,
Diagram * d = nullptr )

Constructor.

◆ ~NumerotationContextCommands()

NumerotationContextCommands::~NumerotationContextCommands ( )

Destructor.

Member Function Documentation

◆ borrow()

void NumerotationContextCommands::borrow ( NumerotationContext & contextnum,
int from_index )
staticprivate

NumerotationContextCommands::borrow Inverse of carry(): subtract one unit from the nearest numeric part at or before from_index. If that part is itself a wrap part and this takes it below 0, it wraps to (modulus - 1) and the borrow cascades further back.

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

◆ carry()

void NumerotationContextCommands::carry ( NumerotationContext & contextnum,
int from_index )
staticprivate

NumerotationContextCommands::carry Add one unit to the nearest numeric part at or before from_index in contextnum, skipping non-numeric parts (e.g. a "." string separator) along the way. If that part is itself a wrap part and this pushes it to (or past) its own modulus, it wraps back to 0 and the carry cascades further back – so wrap parts can be chained (e.g. seconds wrapping into minutes wrapping into hours).

Parameters
contextnumthe context being built by next(); already contains entries for every index <= from_index
from_indexindex to start looking from, going backwards
Here is the call graph for this function:
Here is the caller graph for this function:

◆ next()

NumerotationContext NumerotationContextCommands::next ( )

NumerotationContextCommands::next.

Returns
the next numerotation context
Here is the call graph for this function:
Here is the caller graph for this function:

◆ previous()

NumerotationContext NumerotationContextCommands::previous ( )

NumerotationContextCommands::previous.

Returns
the previous numerotation context
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setNumStrategy()

void NumerotationContextCommands::setNumStrategy ( const QString & str)
private

NumerotationContextCommands::setNumStrategy apply the good strategy relative to str.

Here is the caller graph for this function:

◆ toRepresentedString()

QString NumerotationContextCommands::toRepresentedString ( )

NumerotationContextCommands::toFinalString.

Returns
the string represented by the numerotation context
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ context_

NumerotationContext NumerotationContextCommands::context_
private

◆ diagram_

Diagram* NumerotationContextCommands::diagram_
private

◆ strategy_

NumStrategy* NumerotationContextCommands::strategy_
private

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