lmi-commits
[Top][All Lists]
Advanced

[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);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]