[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 29280fb 1/4: Move 'InitAnnLoanDueRate' declar
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 29280fb 1/4: Move 'InitAnnLoanDueRate' declaration |
Date: |
Mon, 4 Feb 2019 20:12:05 -0500 (EST) |
branch: master
commit 29280fb2e741d4d8fbfd9b14fdec70929abd10ee
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Move 'InitAnnLoanDueRate' declaration
Ideally, all data members would be private. However, making them so
would be difficult. Experimentally adding 'private:' before their
declarations shows that 122 data members are currently used in a way
that requires public access. Options:
- add 122 const accessors--but that's daunting and verbose
- use MemberSymbolTable--but that's still a big change, and perhaps
C++20 reflection will provide a better way
Those options being unattractive, at least consistency can be achieved.
It is better to make 'InitAnnLoanDueRate' public, and group it with its
natural congeners, than to declare it in a remote private area.
---
ledger_invariant.cpp | 3 ++-
ledger_invariant.hpp | 4 +---
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/ledger_invariant.cpp b/ledger_invariant.cpp
index d223b73..a6fecde 100644
--- a/ledger_invariant.cpp
+++ b/ledger_invariant.cpp
@@ -656,7 +656,6 @@ LedgerInvariant& LedgerInvariant::PlusEq(LedgerInvariant
const& a_Addend)
StatePostalAbbrev = a_Addend.StatePostalAbbrev;
PremiumTaxState = a_Addend.PremiumTaxState;
- InitAnnLoanDueRate = a_Addend.InitAnnLoanDueRate;
GroupIndivSelection = GroupIndivSelection ||
a_Addend.GroupIndivSelection;
UseExperienceRating = a_Addend.UseExperienceRating;
UsePartialMort = a_Addend.UsePartialMort;
@@ -731,6 +730,8 @@ LedgerInvariant& LedgerInvariant::PlusEq(LedgerInvariant
const& a_Addend)
ErNotionallyPaysTerm = ErNotionallyPaysTerm ||
a_Addend.ErNotionallyPaysTerm;
+ InitAnnLoanDueRate = a_Addend.InitAnnLoanDueRate;
+
NoLapseMinDur = std::min(a_Addend.NoLapseMinDur, NoLapseMinDur);
NoLapseMinAge = std::min(a_Addend.NoLapseMinAge, NoLapseMinAge);
NoLapseAlwaysActive= a_Addend.NoLapseAlwaysActive|| NoLapseAlwaysActive;
diff --git a/ledger_invariant.hpp b/ledger_invariant.hpp
index d3cfaa3..c0d9dfa 100644
--- a/ledger_invariant.hpp
+++ b/ledger_invariant.hpp
@@ -188,6 +188,7 @@ class LMI_SO LedgerInvariant
double PostHoneymoonSpread;
double SplitMinPrem;
double ErNotionallyPaysTerm;
+ double InitAnnLoanDueRate;
double IsInforce;
double CurrentCoiMultiplier;
double NoLapseAlwaysActive;
@@ -404,9 +405,6 @@ class LMI_SO LedgerInvariant
std::string StatePostalAbbrev; // SOMEDAY !! Rename to
'StateOfJurisdiction'.
std::string PremiumTaxState;
- // Nonscalable scalars.
- double InitAnnLoanDueRate;
-
// Special cases.
int Length;
int irr_precision_;