lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master f042aba 1/8: Add enumerations for certain 770


From: Greg Chicares
Subject: [lmi-commits] [lmi] master f042aba 1/8: Add enumerations for certain 7702 and 7702A parameters
Date: Wed, 13 Mar 2019 20:23:30 -0400 (EDT)

branch: master
commit f042aba58e515734ffb828e63e7103ae65cae415
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Add enumerations for certain 7702 and 7702A parameters
    
    DB_SevenPayWhence presently contemplates only two possible values:
      0=first principles, 1=table
    but that doesn't make it inherently boolean, because other values could
    be useful someday--e.g.,
      first principles, UL commutation functions
      first principles, OL commutation functions, semicontinuous
    
    The same can be said of DB_CorridorWhence and DB_Irc7702NspWhence, and
    the latter already has a third enumerator, so it seems best to create a
    distinct enumeration for each of these three parameters.
---
 dbdict.cpp                 |  8 ++++----
 ihs_basicval.cpp           |  7 ++-----
 ihs_mortal.cpp             |  7 ++++---
 oecumenic_enumerations.hpp | 16 ++++++++++++++++
 4 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/dbdict.cpp b/dbdict.cpp
index 70f1e28..722747f 100644
--- a/dbdict.cpp
+++ b/dbdict.cpp
@@ -660,14 +660,14 @@ sample::sample()
     Add({DB_AllowCvat           , true});
     Add({DB_AllowGpt            , true});
     Add({DB_AllowNo7702         , false});
-    Add({DB_CorridorWhence      , 1});
-    Add({DB_Irc7702NspWhence    , 2});
-    Add({DB_SevenPayWhence      , 1});
+    Add({DB_CorridorWhence      , oe_7702_corr_from_table});
+    Add({DB_Irc7702NspWhence    , oe_7702_nsp_reciprocal_cvat_corridor});
+    Add({DB_SevenPayWhence      , oe_7702_7pp_from_table});
 
     // This is just a sample product, so make do with plausible
     // all-male seven-pay premiums, and use GPT corridor factors for
     // CVAT. 'Irc7702NspWhence' specifies that NSP is calculated as
-    // the reciprocal of corridor, so no NSP table is needed.
+    // the reciprocal of CVAT corridor, so no NSP table is needed.
     Add({DB_CorridorTable       , 7});
     Add({DB_Irc7702NspTable     , 0});
     Add({DB_SevenPayTable       , 10});
diff --git a/ihs_basicval.cpp b/ihs_basicval.cpp
index 0db9d67..c3653b0 100644
--- a/ihs_basicval.cpp
+++ b/ihs_basicval.cpp
@@ -44,6 +44,7 @@
 #include "math_functions.hpp"
 #include "mc_enum_types_aux.hpp"        // mc_str()
 #include "mortality_rates.hpp"
+#include "oecumenic_enumerations.hpp"
 #include "outlay.hpp"
 #include "premium_tax.hpp"
 #include "rounding_rules.hpp"
@@ -2022,11 +2023,7 @@ std::vector<double> BasicValues::GetSevenPayRates() const
         (product().datum("SevenPayFilename")
         ,DB_SevenPayTable
     // TAXATION !! No table available if 7PP calculated from first principles.
-//        ,1 == database().query<bool>(DB_SevenPayWhence)
-// TAXATION !! DATABASE !! Rename 'SevenPayWhence' to 'SevenPayIsTabular',
-// e.g.: the only possibilities are
-//   0=first principles, 1=table
-// so it's naturally boolean.
+//        ,oe_7702_prem_from_table == database().query<bool>(DB_SevenPayWhence)
         );
 }
 
diff --git a/ihs_mortal.cpp b/ihs_mortal.cpp
index 7a93d18..e608ce3 100644
--- a/ihs_mortal.cpp
+++ b/ihs_mortal.cpp
@@ -28,6 +28,7 @@
 #include "basic_values.hpp"
 #include "et_vector.hpp"
 #include "math_functions.hpp"           // assign_midpoint()
+#include "oecumenic_enumerations.hpp"
 
 #include <algorithm>                    // min()
 
@@ -211,9 +212,9 @@ void MortalityRates::SetOtherRates()
 
     // Use reciprocal of CVAT corridor factor as NSP, for both GPT and
     // CVAT.
-    // TODO ?? TAXATION !! Do this only if DB_Irc7702NspWhence is 2
-    // (which should be an enum). This probably should have its own
-    // rounding rule.
+    // TODO ?? TAXATION !! Do this only if DB_Irc7702NspWhence equals
+    // oe_7702_nsp_reciprocal_cvat_corridor. DATABASE !! This probably
+    // should have its own rounding rule.
     LMI_ASSERT(CvatNspRates_.empty());
     for(int j = 0; j < Length_; ++j)
         {
diff --git a/oecumenic_enumerations.hpp b/oecumenic_enumerations.hpp
index 903a7bf..0ff584d 100644
--- a/oecumenic_enumerations.hpp
+++ b/oecumenic_enumerations.hpp
@@ -126,6 +126,22 @@ enum oenum_smoking_or_tobacco
     ,oe_tobacco_nontobacco
     };
 
+enum oenum_7702_corr_whence
+    {oe_7702_corr_first_principles
+    ,oe_7702_corr_from_table
+    };
+
+enum oenum_7702_nsp_whence
+    {oe_7702_nsp_first_principles
+    ,oe_7702_nsp_from_table
+    ,oe_7702_nsp_reciprocal_cvat_corridor
+    };
+
+enum oenum_7702_7pp_whence
+    {oe_7702_7pp_first_principles
+    ,oe_7702_7pp_from_table
+    };
+
 enum oenum_7702_term
     {oe_7702_term_is_ignored
     ,oe_7702_term_is_db



reply via email to

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