[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 797a8b8 5/9: Rename a member function
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 797a8b8 5/9: Rename a member function |
Date: |
Thu, 4 Oct 2018 19:24:15 -0400 (EDT) |
branch: master
commit 797a8b86ea1a1ef1b874f331898510ad6b938547
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Rename a member function
See the immediately preceding commit message.
---
ledger.cpp | 7 +++----
ledger.hpp | 2 +-
ledger_evaluator.cpp | 4 ++--
ledger_invariant.cpp | 2 +-
ledger_pdf_generator_wx.cpp | 4 ++--
ledger_text_formats.cpp | 8 ++++----
ledger_xml_io.cpp | 2 +-
7 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/ledger.cpp b/ledger.cpp
index 7ef4d24..c937a45 100644
--- a/ledger.cpp
+++ b/ledger.cpp
@@ -279,11 +279,10 @@ void Ledger::SetOneLedgerVariant
}
}
-//============================================================================
-int Ledger::GetMaxLength() const
+/// Number of rows on an illustration: duration when last basis lapses.
+
+int Ledger::greatest_lapse_dur() const
{
- // For all ledgers in the map, find the longest duration that must
- // be printed (until the last one lapses).
ledger_map_t const& l_map_rep = ledger_map_->held();
double max_length = 0.0;
diff --git a/ledger.hpp b/ledger.hpp
index d5bee27..babe88e 100644
--- a/ledger.hpp
+++ b/ledger.hpp
@@ -92,7 +92,7 @@ class LMI_SO Ledger
LedgerVariant const& GetCurrHalf () const;
LedgerVariant const& GetGuarHalf () const;
- int GetMaxLength () const;
+ int greatest_lapse_dur () const;
std::vector<mcenum_run_basis> const& GetRunBases () const;
mcenum_ledger_type ledger_type () const;
diff --git a/ledger_evaluator.cpp b/ledger_evaluator.cpp
index 8db69b3..4e6eb83 100644
--- a/ledger_evaluator.cpp
+++ b/ledger_evaluator.cpp
@@ -694,7 +694,7 @@ ledger_evaluator Ledger::make_evaluator() const
vectors["IrrCsv_Current" ] = &ledger_invariant_->IrrCsvCurrInput;
vectors["IrrDb_Current" ] = &ledger_invariant_->IrrDbCurrInput ;
- double GreatestLapseDuration = GetMaxLength();
+ double GreatestLapseDuration = greatest_lapse_dur();
scalars["GreatestLapseDuration"] = &GreatestLapseDuration;
int max_duration = static_cast<int>(ledger_invariant_->EndtAge -
ledger_invariant_->Age);
@@ -1031,7 +1031,7 @@ void ledger_evaluator::write_tsv
}
ofs << '\n';
- for(int i = 0; i < ledger.GetMaxLength(); ++i)
+ for(int i = 0; i < ledger.greatest_lapse_dur(); ++i)
{
for(auto const& j : sorted_vectors)
{
diff --git a/ledger_invariant.cpp b/ledger_invariant.cpp
index 1ddd5ba..7afec4b 100644
--- a/ledger_invariant.cpp
+++ b/ledger_invariant.cpp
@@ -1315,7 +1315,7 @@ void LedgerInvariant::CalculateIrrs(Ledger const&
LedgerValues)
bool const zero_sepacct_interest_bases_undefined = !run_curr_sep_zero;
// Terse aliases for invariants.
- int const m = LedgerValues.GetMaxLength();
+ int const m = LedgerValues.greatest_lapse_dur();
int const n = irr_precision_;
LedgerVariant const& Curr_ = LedgerValues.GetCurrFull();
diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index 4c6131d..59570de 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -1618,7 +1618,7 @@ class numeric_summary_table_cell
auto const& invar = mixin_ledger_.GetLedgerInvariant();
- int const year_max = mixin_ledger_.GetMaxLength();
+ int const year_max = mixin_ledger_.greatest_lapse_dur();
int const summary_age = 70;
// Other rows are for given durations, but the
@@ -1902,7 +1902,7 @@ class page_with_tabular_report
// "-1 +": return the number of *extra* pages.
return -1 + paginator::init
- (ledger_.GetMaxLength() - offset_
+ (ledger_.greatest_lapse_dur() - offset_
,wx_table_generator::rows_per_group
,max_lines_per_page
);
diff --git a/ledger_text_formats.cpp b/ledger_text_formats.cpp
index 11fa2ee..3d67ef8 100644
--- a/ledger_text_formats.cpp
+++ b/ledger_text_formats.cpp
@@ -164,7 +164,7 @@ calculation_summary_formatter::calculation_summary_formatter
)
:ledger_ {ledger_values}
,invar_ {ledger_values.GetLedgerInvariant()}
- ,max_length_ {ledger_values.GetMaxLength()}
+ ,max_length_ {ledger_values.greatest_lapse_dur()}
{
columns_ = effective_calculation_summary_columns();
std::vector<std::string>::iterator p = std::find
@@ -456,7 +456,7 @@ void PrintCellTabDelimited
LedgerVariant const& Curr_ = ledger_values.GetCurrFull();
LedgerVariant const& Guar_ = ledger_values.GetGuarFull();
- int const max_length = ledger_values.GetMaxLength();
+ int const max_length = ledger_values.greatest_lapse_dur();
// TODO ?? This const_cast is safe, but it's still unclean.
LedgerInvariant& unclean = const_cast<LedgerInvariant&>(Invar);
@@ -1011,7 +1011,7 @@ void FlatTextLedgerPrinter::PrintKeyTerms() const
void FlatTextLedgerPrinter::PrintNumericalSummary() const
{
int const age = value_cast<int>(invar().Age);
- int const max_length = ledger_.GetMaxLength();
+ int const max_length = ledger_.greatest_lapse_dur();
os_ << center("Numerical summary") << endrow;
os_ << endrow;
@@ -1135,7 +1135,7 @@ void FlatTextLedgerPrinter::PrintTabularDetailHeader()
const
void FlatTextLedgerPrinter::PrintTabularDetail() const
{
int const age = value_cast<int>(invar().Age);
- int const max_length = ledger_.GetMaxLength();
+ int const max_length = ledger_.greatest_lapse_dur();
for(int j = 0; j < max_length; ++j)
{
os_.setf(std::ios_base::fixed, std::ios_base::floatfield);
diff --git a/ledger_xml_io.cpp b/ledger_xml_io.cpp
index b5b6f08..27246d9 100644
--- a/ledger_xml_io.cpp
+++ b/ledger_xml_io.cpp
@@ -892,7 +892,7 @@ void Ledger::write(xml::element& x) const
}
ofs << '\n';
- for(int i = 0; i < GetMaxLength(); ++i)
+ for(int i = 0; i < greatest_lapse_dur(); ++i)
{
for(auto const& j : stringvectors)
{
- [lmi-commits] [lmi] master updated (b3e084f -> b36660c), Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master af5a41d 2/9: Demonstrate the nugatoriness of composite_lapse_year_, Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master b957c49 1/9: Rewrite write_tsv(), Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master 1d9b6e9 4/9: Store a useful value; discard a useless one, Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master 579a4f4 3/9: Simplify [378], Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master fac6d21 8/9: Rename local variables in one function, Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master 4c6e6c3 6/9: Prefer bourn_cast to static_cast for arithmetic type conversions, Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master b36660c 9/9: Define short aliases early; use them wherever possible, Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master 18f1ca3 7/9: Refactor to remove duplication, Greg Chicares, 2018/10/04
- [lmi-commits] [lmi] master 797a8b8 5/9: Rename a member function,
Greg Chicares <=