[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master bb389e4 10/16: Alphabetize members of enumera
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master bb389e4 10/16: Alphabetize members of enumerative type |
Date: |
Sat, 11 Apr 2020 20:36:03 -0400 (EDT) |
branch: master
commit bb389e48266dfd4a660d558bc868fb24388df825
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Alphabetize members of enumerative type
---
ledger_invariant.cpp | 12 ++++++------
ledger_invariant.hpp | 4 ++--
ledger_invariant_init.cpp | 4 ++--
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/ledger_invariant.cpp b/ledger_invariant.cpp
index 963eed8..9a0d348 100644
--- a/ledger_invariant.cpp
+++ b/ledger_invariant.cpp
@@ -381,8 +381,8 @@ void LedgerInvariant::Alloc(int len)
Strings["SupplementalReportColumn10" ] = &SupplementalReportColumn10
;
Strings["SupplementalReportColumn11" ] = &SupplementalReportColumn11
;
- Strings["InitErMode" ] = &InitErMode
;
Strings["InitDBOpt" ] = &InitDBOpt
;
+ Strings["InitErMode" ] = &InitErMode
;
LedgerBase::Alloc();
@@ -390,9 +390,9 @@ void LedgerInvariant::Alloc(int len)
// be part of the maps populated above. We can reserve space for
// such vectors, though, if we know what their lengths will be.
+ DBOpt .reserve(Length);
EeMode .reserve(Length);
ErMode .reserve(Length);
- DBOpt .reserve(Length);
// Vectors of length other than 'Length' can't be part of the maps
// populated above, but we can reserve space for them here if we
@@ -419,9 +419,9 @@ void LedgerInvariant::Copy(LedgerInvariant const& obj)
LedgerBase::Copy(obj);
// Vectors of type not compatible with double.
+ DBOpt = obj.DBOpt ;
EeMode = obj.EeMode ;
ErMode = obj.ErMode ;
- DBOpt = obj.DBOpt ;
// Vectors of idiosyncratic length.
InforceLives = obj.InforceLives ;
@@ -456,9 +456,9 @@ void LedgerInvariant::Init()
// Zero-initialize elements of AllVectors and AllScalars.
LedgerBase::Initialize(GetLength());
+ DBOpt .assign(Length, mce_dbopt(mce_option1));
EeMode .assign(Length, mce_mode(mce_annual));
ErMode .assign(Length, mce_mode(mce_annual));
- DBOpt .assign(Length, mce_dbopt(mce_option1));
InforceYear = Length;
InforceMonth = 11;
@@ -746,9 +746,9 @@ void LedgerInvariant::UpdateCRC(CRC& a_crc) const
LedgerBase::UpdateCRC(a_crc);
a_crc += InforceLives;
+ a_crc += mc_e_vector_to_string_vector(DBOpt);
a_crc += mc_e_vector_to_string_vector(EeMode);
a_crc += mc_e_vector_to_string_vector(ErMode);
- a_crc += mc_e_vector_to_string_vector(DBOpt);
a_crc += FundNumbers;
a_crc += FundNames;
a_crc += FundAllocs;
@@ -761,9 +761,9 @@ void LedgerInvariant::Spew(std::ostream& os) const
LedgerBase::Spew(os);
SpewVector(os, std::string("InforceLives") ,InforceLives );
+ SpewVector(os, std::string("DBOpt") ,DBOpt );
SpewVector(os, std::string("EeMode") ,EeMode );
SpewVector(os, std::string("ErMode") ,ErMode );
- SpewVector(os, std::string("DBOpt") ,DBOpt );
SpewVector(os, std::string("FundNumbers") ,FundNumbers );
SpewVector(os, std::string("FundNames") ,FundNames );
SpewVector(os, std::string("FundAllocs") ,FundAllocs );
diff --git a/ledger_invariant.hpp b/ledger_invariant.hpp
index 7187276..6952414 100644
--- a/ledger_invariant.hpp
+++ b/ledger_invariant.hpp
@@ -110,9 +110,9 @@ class LMI_SO LedgerInvariant final
std::vector<double> ErPmt;
// Special-case vectors (not <double>, or different length than others).
+ std::vector<mce_dbopt>DBOpt;
std::vector<mce_mode> EeMode;
std::vector<mce_mode> ErMode;
- std::vector<mce_dbopt>DBOpt;
std::vector<double> FundNumbers;
std::vector<std::string> FundNames;
@@ -433,8 +433,8 @@ class LMI_SO LedgerInvariant final
// generating reports from this class's data, and mc_enum::str()
// is not visible across a shared-library boundary. For now, this
// kludge solves an immediate problem for premium quotes.
- std::string InitErMode;
std::string InitDBOpt;
+ std::string InitErMode;
// Special-case strings.
diff --git a/ledger_invariant_init.cpp b/ledger_invariant_init.cpp
index 1c66f2d..c1c88f7 100644
--- a/ledger_invariant_init.cpp
+++ b/ledger_invariant_init.cpp
@@ -107,9 +107,9 @@ void LedgerInvariant::Init(BasicValues const* b)
SpecAmt = b->DeathBfts_->specamt();
for(int j = 0; j < Length; ++j)
{
+ DBOpt [j] = b->DeathBfts_->dbopt()[j];
EeMode[j] = b->Outlay_->ee_premium_modes()[j];
ErMode[j] = b->Outlay_->er_premium_modes()[j];
- DBOpt [j] = b->DeathBfts_->dbopt()[j];
}
IndvTaxBracket = b->yare_input_.TaxBracket ;
@@ -527,7 +527,6 @@ void LedgerInvariant::Init(BasicValues const* b)
ListBillDateJdn = calendar_date(b->yare_input_.ListBillDate
).julian_day_number();
InforceAsOfDate = calendar_date(b->yare_input_.InforceAsOfDate
).str();
InforceAsOfDateJdn = calendar_date(b->yare_input_.InforceAsOfDate
).julian_day_number();
- InitErMode = mc_str(b->Outlay_->er_premium_modes()[0]);
mcenum_dbopt const init_dbo = b->DeathBfts_->dbopt()[0];
InitDBOpt =
@@ -537,6 +536,7 @@ void LedgerInvariant::Init(BasicValues const* b)
:(mce_mdb == init_dbo) ? dbo_name_mdb
:throw std::logic_error("Unrecognized initial death benefit option.")
;
+ InitErMode = mc_str(b->Outlay_->er_premium_modes()[0]);
DefnLifeIns = mc_str(b->yare_input_.DefinitionOfLifeInsurance);
DefnMaterialChange =
mc_str(b->yare_input_.DefinitionOfMaterialChange);
- [lmi-commits] [lmi] master cbc0ec5 03/16: Sort string members together in declaration order, (continued)
- [lmi-commits] [lmi] master cbc0ec5 03/16: Sort string members together in declaration order, Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master f7689a2 08/16: Regularize whitespace, Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master 95c2f88 02/16: Declutter, Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master ce9d6b8 04/16: Change compositing for some string members, Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master df9c566 07/16: Sort nonscalable scalar members together in declaration order, Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master a7a9404 05/16: Simplify [348], Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master 359c74c 09/16: Treat 'InitErMode' the same as any other ledger string, Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master 255b816 15/16: Mark ledger members dubiously ignored in compositing, Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master ed9a11d 16/16: Address ledger members formerly ignored in compositing, Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master 2e134db 11/16: Add 'InitEeMode' to ledger, Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master bb389e4 10/16: Alphabetize members of enumerative type,
Greg Chicares <=
- [lmi-commits] [lmi] master 5dfa890 13/16: Reorder and label for greater uniformity, Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master db81cdc 12/16: Correct a guaranteed-premium footnote, Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master 1f6064d 14/16: Fix index-origin errors in port from XSL-FO, Greg Chicares, 2020/04/11