lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master ea6d4c4 1/3: Improve const correctness by usi


From: Greg Chicares
Subject: [lmi-commits] [lmi] master ea6d4c4 1/3: Improve const correctness by using a const accessor
Date: Sun, 4 Nov 2018 21:27:45 -0500 (EST)

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

    Improve const correctness by using a const accessor
---
 basic_values.hpp          |   3 +-
 basicvalues.cpp           |  20 ++---
 ihs_acctval.cpp           |  42 +++++-----
 ihs_avmly.cpp             |   8 +-
 ihs_basicval.cpp          | 206 +++++++++++++++++++++++-----------------------
 interest_rates.cpp        |  38 ++++-----
 ledger_invariant_init.cpp |  22 ++---
 loads.cpp                 |  10 +--
 mortality_rates.cpp       |  10 +--
 mortality_rates_fetch.cpp |  28 +++----
 10 files changed, 194 insertions(+), 193 deletions(-)

diff --git a/basic_values.hpp b/basic_values.hpp
index 5b3f2c3..7973e90 100644
--- a/basic_values.hpp
+++ b/basic_values.hpp
@@ -126,7 +126,8 @@ class LMI_SO BasicValues
     std::shared_ptr<Irc7702>            Irc7702_;
     std::shared_ptr<Irc7702A>           Irc7702A_;
 
-    product_data     const& product() const {return product_;}
+    product_data     const& product () const {return product_;}
+    product_database const& database() const {return *Database_;}
 
     double GetAnnualTgtPrem(int a_year, double a_specamt) const;
 
diff --git a/basicvalues.cpp b/basicvalues.cpp
index f7561bf..17dd165 100644
--- a/basicvalues.cpp
+++ b/basicvalues.cpp
@@ -101,12 +101,12 @@ void BasicValues::Init()
         );
 
     // The database class constrains maturity age to be scalar.
-    EndtAge = static_cast<int>(Database_->Query(DB_MaturityAge));
+    EndtAge = static_cast<int>(database().Query(DB_MaturityAge));
     Length = EndtAge - IssueAge;
 
-    ledger_type_ = 
static_cast<mcenum_ledger_type>(Database_->Query(DB_LedgerType));
-    nonillustrated_       = 
static_cast<bool>(Database_->Query(DB_Nonillustrated));
-    bool no_longer_issued = 
static_cast<bool>(Database_->Query(DB_NoLongerIssued));
+    ledger_type_ = 
static_cast<mcenum_ledger_type>(database().Query(DB_LedgerType));
+    nonillustrated_       = 
static_cast<bool>(database().Query(DB_Nonillustrated));
+    bool no_longer_issued = 
static_cast<bool>(database().Query(DB_NoLongerIssued));
     bool is_new_business  = yare_input_.EffectiveDate == 
yare_input_.InforceAsOfDate;
     no_can_issue_         = no_longer_issued && is_new_business;
     IsSubjectToIllustrationReg_ = is_subject_to_ill_reg(ledger_type());
@@ -119,13 +119,13 @@ void BasicValues::Init()
     InterestRates_ .reset(new InterestRates  (*this));
     DeathBfts_     .reset(new death_benefits (GetLength(), yare_input_));
     Outlay_        .reset(new modal_outlay   (yare_input_));
-    PremiumTax_    .reset(new premium_tax    (PremiumTaxState_, *Database_));
-    Loads_         .reset(new Loads(*Database_, IsSubjectToIllustrationReg()));
+    PremiumTax_    .reset(new premium_tax    (PremiumTaxState_, database()));
+    Loads_         .reset(new Loads(database(), IsSubjectToIllustrationReg()));
 
-    MinSpecAmt = Database_->Query(DB_MinSpecAmt);
-    MinWD      = Database_->Query(DB_MinWd     );
-    WDFee      = Database_->Query(DB_WdFee     );
-    WDFeeRate  = Database_->Query(DB_WdFeeRate );
+    MinSpecAmt = database().Query(DB_MinSpecAmt);
+    MinWD      = database().Query(DB_MinWd     );
+    WDFee      = database().Query(DB_WdFee     );
+    WDFeeRate  = database().Query(DB_WdFeeRate );
 
 // The antediluvian branch leaves FundData_, StratifiedCharges_, and
 // ProductData initialized to null pointers.
diff --git a/ihs_acctval.cpp b/ihs_acctval.cpp
index eeeaec6..68bb663 100644
--- a/ihs_acctval.cpp
+++ b/ihs_acctval.cpp
@@ -588,7 +588,7 @@ void AccountValue::SetInitialValues()
     SepAcctPaymentAllocation = premium_allocation_to_sepacct(yare_input_);
     GenAcctPaymentAllocation = 1.0 - SepAcctPaymentAllocation;
 
-    if(!Database_->Query(DB_AllowGenAcct) && 0.0 != GenAcctPaymentAllocation)
+    if(!database().Query(DB_AllowGenAcct) && 0.0 != GenAcctPaymentAllocation)
         {
         alarum()
             << "No general account is allowed for this product, but "
@@ -598,7 +598,7 @@ void AccountValue::SetInitialValues()
             ;
         }
 
-    if(!Database_->Query(DB_AllowSepAcct) && 0.0 != SepAcctPaymentAllocation)
+    if(!database().Query(DB_AllowSepAcct) && 0.0 != SepAcctPaymentAllocation)
         {
         alarum()
             << "No separate account is allowed for this product, but "
@@ -641,10 +641,10 @@ void AccountValue::SetInitialValues()
         NoLapseActive           = false;
         }
 
-    SplitMinPrem                = Database_->Query(DB_SplitMinPrem);
-    UnsplitSplitMinPrem         = Database_->Query(DB_UnsplitSplitMinPrem);
+    SplitMinPrem                = database().Query(DB_SplitMinPrem);
+    UnsplitSplitMinPrem         = database().Query(DB_UnsplitSplitMinPrem);
 
-    TermCanLapse                = Database_->Query(DB_TermCanLapse);
+    TermCanLapse                = database().Query(DB_TermCanLapse);
     TermRiderActive             = true;
     TermDB                      = 0.0;
 
@@ -690,37 +690,37 @@ void AccountValue::SetInitialValues()
     MlyDed                      = 0.0;
     CumulativeSalesLoad         = yare_input_.InforceCumulativeSalesLoad;
 
-    CoiRetentionRate                  = 
Database_->Query(DB_ExpRatCoiRetention);
-    ExperienceRatingAmortizationYears = Database_->Query(DB_ExpRatAmortPeriod);
-    IbnrAsMonthsOfMortalityCharges    = Database_->Query(DB_ExpRatIbnrMult);
+    CoiRetentionRate                  = 
database().Query(DB_ExpRatCoiRetention);
+    ExperienceRatingAmortizationYears = database().Query(DB_ExpRatAmortPeriod);
+    IbnrAsMonthsOfMortalityCharges    = database().Query(DB_ExpRatIbnrMult);
 
     Dumpin             = Outlay_->dumpin();
     External1035Amount = Outlay_->external_1035_amount();
     Internal1035Amount = Outlay_->internal_1035_amount();
 
     ee_premium_allocation_method   = static_cast<oenum_allocation_method>
-        (Database_->Query(DB_EePremMethod)
+        (database().Query(DB_EePremMethod)
         );
     ee_premium_preferred_account   = 
static_cast<oenum_increment_account_preference>
-        (Database_->Query(DB_EePremAcct)
+        (database().Query(DB_EePremAcct)
         );
     er_premium_allocation_method   = static_cast<oenum_allocation_method>
-        (Database_->Query(DB_ErPremMethod)
+        (database().Query(DB_ErPremMethod)
         );
     er_premium_preferred_account   = 
static_cast<oenum_increment_account_preference>
-        (Database_->Query(DB_ErPremAcct)
+        (database().Query(DB_ErPremAcct)
         );
     deduction_method               = static_cast<oenum_increment_method>
-        (Database_->Query(DB_DeductionMethod)
+        (database().Query(DB_DeductionMethod)
         );
     deduction_preferred_account    = 
static_cast<oenum_increment_account_preference>
-        (Database_->Query(DB_DeductionAcct)
+        (database().Query(DB_DeductionAcct)
         );
     distribution_method            = static_cast<oenum_increment_method>
-        (Database_->Query(DB_DistributionMethod)
+        (database().Query(DB_DistributionMethod)
         );
     distribution_preferred_account = 
static_cast<oenum_increment_account_preference>
-        (Database_->Query(DB_DistributionAcct)
+        (database().Query(DB_DistributionAcct)
         );
 
     // If any account preference is the separate account, then a
@@ -732,7 +732,7 @@ void AccountValue::SetInitialValues()
         ||   oe_prefer_separate_account == distribution_preferred_account
         )
         {
-        LMI_ASSERT(Database_->Query(DB_AllowSepAcct));
+        LMI_ASSERT(database().Query(DB_AllowSepAcct));
         }
     // If any account preference for premium is the general account,
     // then payment into the separate account must be permitted; but
@@ -743,7 +743,7 @@ void AccountValue::SetInitialValues()
         ||   oe_prefer_separate_account == er_premium_preferred_account
         )
         {
-        LMI_ASSERT(Database_->Query(DB_AllowSepAcct));
+        LMI_ASSERT(database().Query(DB_AllowSepAcct));
         }
 }
 
@@ -1028,7 +1028,7 @@ double AccountValue::MinInitDumpin() const
 {
     if
         (  0 == Year
-        && 1 == Database_->Query(DB_MinInitPremType)
+        && 1 == database().Query(DB_MinInitPremType)
         && yare_input_.EffectiveDate == yare_input_.InforceAsOfDate
         )
         {
@@ -1045,7 +1045,7 @@ double AccountValue::MinInitPrem() const
 {
     if
         (  0 == Year
-        && 1 == Database_->Query(DB_MinInitPremType)
+        && 1 == database().Query(DB_MinInitPremType)
         && yare_input_.EffectiveDate == yare_input_.InforceAsOfDate
         )
         {
@@ -1090,7 +1090,7 @@ double AccountValue::ModalMinInitPremShortfall() const
 {
     if
         (  0 == Year
-        && 1 == Database_->Query(DB_MinInitPremType)
+        && 1 == database().Query(DB_MinInitPremType)
         && yare_input_.EffectiveDate == yare_input_.InforceAsOfDate
         )
         {
diff --git a/ihs_avmly.cpp b/ihs_avmly.cpp
index 651d20c..3781049 100644
--- a/ihs_avmly.cpp
+++ b/ihs_avmly.cpp
@@ -1210,7 +1210,7 @@ void AccountValue::TxAscertainDesiredPayment()
             ;
         }
 
-    if(0 == Year && ee_pay_this_month && 1 == 
Database_->Query(DB_MinInitPremType))
+    if(0 == Year && ee_pay_this_month && 1 == 
database().Query(DB_MinInitPremType))
         {
         double z = ModalMinInitPremShortfall();
         // Illustration-reg guaranteed premium ignores GPT limit.
@@ -1975,11 +1975,11 @@ void AccountValue::TxTakeSepAcctLoad()
             (GenBasis_
             ,AssetsPostBom
             ,CumPmtsPostBom
-            ,Database_->Query(DB_DynSepAcctLoadLimit)
+            ,database().Query(DB_DynSepAcctLoadLimit)
             );
 
         double tiered_comp = 0.0;
-        if(oe_asset_charge_load == Database_->Query(DB_AssetChargeType))
+        if(oe_asset_charge_load == database().Query(DB_AssetChargeType))
             {
             tiered_comp = 
StratifiedCharges_->tiered_asset_based_compensation(AssetsPostBom);
             }
@@ -2059,7 +2059,7 @@ void AccountValue::ApplyDynamicMandE(double assets)
             ;
         }
     double asset_comp_rate =
-        (oe_asset_charge_spread == Database_->Query(DB_AssetChargeType))
+        (oe_asset_charge_spread == database().Query(DB_AssetChargeType))
             ? StratifiedCharges_->tiered_asset_based_compensation(assets)
             : 0.0
             ;
diff --git a/ihs_basicval.cpp b/ihs_basicval.cpp
index 48649c9..6475d58 100644
--- a/ihs_basicval.cpp
+++ b/ihs_basicval.cpp
@@ -145,7 +145,7 @@ void BasicValues::Init()
     PremiumTaxState_     = yare_input_.PremiumTaxState    ;
 
     if
-        (   !Database_->Query(DB_StateApproved)
+        (   !database().Query(DB_StateApproved)
         &&  !global_settings::instance().ash_nazg()
         &&  !global_settings::instance().regression_testing()
         )
@@ -166,34 +166,34 @@ void BasicValues::Init()
     LMI_ASSERT(RetAge <= 100);
     LMI_ASSERT(yare_input_.RetireesCanEnroll || IssueAge <= RetAge);
 
-    EndtAge = static_cast<int>(Database_->Query(DB_MaturityAge));
+    EndtAge = static_cast<int>(database().Query(DB_MaturityAge));
     Length = EndtAge - IssueAge;
 
-    ledger_type_ = 
static_cast<mcenum_ledger_type>(Database_->Query(DB_LedgerType));
-    nonillustrated_       = 
static_cast<bool>(Database_->Query(DB_Nonillustrated));
-    bool no_longer_issued = 
static_cast<bool>(Database_->Query(DB_NoLongerIssued));
+    ledger_type_ = 
static_cast<mcenum_ledger_type>(database().Query(DB_LedgerType));
+    nonillustrated_       = 
static_cast<bool>(database().Query(DB_Nonillustrated));
+    bool no_longer_issued = 
static_cast<bool>(database().Query(DB_NoLongerIssued));
     bool is_new_business  = yare_input_.EffectiveDate == 
yare_input_.InforceAsOfDate;
     no_can_issue_         = no_longer_issued && is_new_business;
     IsSubjectToIllustrationReg_ = is_subject_to_ill_reg(ledger_type());
 
-    if(IssueAge < Database_->Query(DB_MinIssAge))
+    if(IssueAge < database().Query(DB_MinIssAge))
         {
         alarum()
             << "Issue age "
             << IssueAge
             << " less than minimum "
-            << Database_->Query(DB_MinIssAge)
+            << database().Query(DB_MinIssAge)
             << '.'
             << LMI_FLUSH
             ;
         }
-    if(Database_->Query(DB_MaxIssAge) < IssueAge)
+    if(database().Query(DB_MaxIssAge) < IssueAge)
         {
         alarum()
             << "Issue age "
             << IssueAge
             << " greater than maximum "
-            << Database_->Query(DB_MaxIssAge)
+            << database().Query(DB_MaxIssAge)
             << '.'
             << LMI_FLUSH
             ;
@@ -220,7 +220,7 @@ void BasicValues::Init()
     DeathBfts_     .reset(new death_benefits (GetLength(), yare_input_));
     // Outlay requires only input; it might someday use interest rates.
     Outlay_        .reset(new modal_outlay   (yare_input_));
-    PremiumTax_    .reset(new premium_tax    (PremiumTaxState_, 
StateOfDomicile_, yare_input_.AmortizePremiumLoad, *Database_, 
*StratifiedCharges_));
+    PremiumTax_    .reset(new premium_tax    (PremiumTaxState_, 
StateOfDomicile_, yare_input_.AmortizePremiumLoad, database(), 
*StratifiedCharges_));
     Loads_         .reset(new Loads          (*this));
 
     // The target premium can't be ascertained yet if specamt is
@@ -256,7 +256,7 @@ void BasicValues::GPTServerInit()
     StateOfJurisdiction_ = yare_input_.StateOfJurisdiction;
     PremiumTaxState_     = yare_input_.PremiumTaxState    ;
 
-    EndtAge = static_cast<int>(Database_->Query(DB_MaturityAge));
+    EndtAge = static_cast<int>(database().Query(DB_MaturityAge));
     Length = EndtAge - IssueAge;
 
     yare_input_.ExtraMonthlyCustodialFee  .resize(Length);
@@ -267,21 +267,21 @@ void BasicValues::GPTServerInit()
     yare_input_.DeathBenefitOption        .assign(Length, 
yare_input_.DeathBenefitOption[0]);
     yare_input_.FlatExtra                 .resize(Length);
 
-    ledger_type_ = 
static_cast<mcenum_ledger_type>(Database_->Query(DB_LedgerType));
-    nonillustrated_       = 
static_cast<bool>(Database_->Query(DB_Nonillustrated));
-    bool no_longer_issued = 
static_cast<bool>(Database_->Query(DB_NoLongerIssued));
+    ledger_type_ = 
static_cast<mcenum_ledger_type>(database().Query(DB_LedgerType));
+    nonillustrated_       = 
static_cast<bool>(database().Query(DB_Nonillustrated));
+    bool no_longer_issued = 
static_cast<bool>(database().Query(DB_NoLongerIssued));
     bool is_new_business  = yare_input_.EffectiveDate == 
yare_input_.InforceAsOfDate;
     no_can_issue_         = no_longer_issued && is_new_business;
     IsSubjectToIllustrationReg_ = is_subject_to_ill_reg(ledger_type());
 
-    if(IssueAge < Database_->Query(DB_MinIssAge))
+    if(IssueAge < database().Query(DB_MinIssAge))
         {
         throw x_product_rule_violated
             (
             std::string("Issue age less than minimum")
             );
         }
-    if(Database_->Query(DB_MaxIssAge) < IssueAge)
+    if(database().Query(DB_MaxIssAge) < IssueAge)
         {
         throw x_product_rule_violated
             (
@@ -309,7 +309,7 @@ void BasicValues::GPTServerInit()
 //  DeathBfts_     .reset(new death_benefits (GetLength(), yare_input_));
     // Outlay requires only input; it might someday use interest rates.
 //  Outlay_        .reset(new modal_outlay   (yare_input_));
-    PremiumTax_    .reset(new premium_tax    (PremiumTaxState_, 
StateOfDomicile_, yare_input_.AmortizePremiumLoad, *Database_, 
*StratifiedCharges_));
+    PremiumTax_    .reset(new premium_tax    (PremiumTaxState_, 
StateOfDomicile_, yare_input_.AmortizePremiumLoad, database(), 
*StratifiedCharges_));
     Loads_         .reset(new Loads          (*this));
 
     SetMaxSurvivalDur();
@@ -322,7 +322,7 @@ void BasicValues::GPTServerInit()
 // with code in AccountValue::SetInitialValues().
 double BasicValues::InvestmentManagementFee() const
 {
-    if(!Database_->Query(DB_AllowSepAcct))
+    if(!database().Query(DB_AllowSepAcct))
         {
         return 0.0;
         }
@@ -428,7 +428,7 @@ double BasicValues::InvestmentManagementFee() const
 void BasicValues::Init7702()
 {
     Mly7702qc = GetIrc7702QRates();
-    double max_coi_rate = Database_->Query(DB_MaxMonthlyCoiRate);
+    double max_coi_rate = database().Query(DB_MaxMonthlyCoiRate);
     LMI_ASSERT(0.0 != max_coi_rate);
     max_coi_rate = 1.0 / max_coi_rate;
     assign(Mly7702qc, apply_binary(coi_rate_from_q<double>(), Mly7702qc, 
max_coi_rate));
@@ -451,7 +451,7 @@ void BasicValues::Init7702()
     // GPT calculations in the 7702 class.
 
     std::vector<double> guar_int;
-    Database_->Query(guar_int, DB_GuarInt);
+    database().Query(guar_int, DB_GuarInt);
 // TAXATION !! Rework this. The intention is to make the 7702 interest
 // rate no less, at any duration, than the guaranteed loan rate--here,
 // the fixed rate charged on loans, minus the guaranteed loan spread
@@ -462,9 +462,9 @@ void BasicValues::Init7702()
         case mce_fixed_loan_rate:
             {
             std::vector<double> gross_loan_rate;
-            Database_->Query(gross_loan_rate, DB_FixedLoanRate);
+            database().Query(gross_loan_rate, DB_FixedLoanRate);
             std::vector<double> guar_loan_spread;
-            Database_->Query(guar_loan_spread, DB_GuarRegLoanSpread);
+            database().Query(guar_loan_spread, DB_GuarRegLoanSpread);
             // ET !! std::vector<double> guar_loan_rate = gross_loan_rate - 
guar_loan_spread;
             std::vector<double> guar_loan_rate(Length);
             std::transform
@@ -514,7 +514,7 @@ void BasicValues::Init7702()
             )
         );
 
-    Database_->Query(Mly7702ig, DB_NaarDiscount);
+    database().Query(Mly7702ig, DB_NaarDiscount);
 
     // TODO ?? We should avoid reading the rate file again; but
     // the GPT server doesn't initialize a MortalityRates object
@@ -525,7 +525,7 @@ void BasicValues::Init7702()
         local_mly_charge_add = GetAdbRates();
         }
 
-    double local_adb_limit = Database_->Query(DB_AdbIsQAB) ? AdbLimit : 0.0;
+    double local_adb_limit = database().Query(DB_AdbIsQAB) ? AdbLimit : 0.0;
 
     Irc7702_.reset
         (new Irc7702
@@ -601,66 +601,66 @@ double BasicValues::GetAnnualTgtPrem(int a_year, double 
a_specamt) const
 
 void BasicValues::SetPermanentInvariants()
 {
-    MinIssSpecAmt       = Database_->Query(DB_MinIssSpecAmt        );
-    MinIssBaseSpecAmt   = Database_->Query(DB_MinIssBaseSpecAmt    );
-    MinRenlSpecAmt      = Database_->Query(DB_MinRenlSpecAmt       );
-    MinRenlBaseSpecAmt  = Database_->Query(DB_MinRenlBaseSpecAmt   );
-    NoLapseOpt1Only     = Database_->Query(DB_NoLapseDbo1Only      );
-    NoLapseUnratedOnly  = Database_->Query(DB_NoLapseUnratedOnly   );
-    OptChgCanIncrSA     = Database_->Query(DB_DboChgCanIncrSpecAmt );
-    OptChgCanDecrSA     = Database_->Query(DB_DboChgCanDecrSpecAmt );
-    WDCanDecrSADBO1     = Database_->Query(DB_WdCanDecrSpecAmtDbo1 );
-    WDCanDecrSADBO2     = Database_->Query(DB_WdCanDecrSpecAmtDbo2 );
-    WDCanDecrSADBO3     = Database_->Query(DB_WdCanDecrSpecAmtDbo3 );
-    MaxIncrAge          = static_cast<int>(Database_->Query(DB_MaxIncrAge));
-    WaivePmTxInt1035    = Database_->Query(DB_WaivePremTaxInt1035  );
-    TermIsNotRider      = Database_->Query(DB_TermIsNotRider       );
-    TermForcedConvAge   = 
static_cast<int>(Database_->Query(DB_TermForcedConvAge));
-    TermForcedConvDur   = 
static_cast<int>(Database_->Query(DB_TermForcedConvDur));
-    ExpPerKLimit        = Database_->Query(DB_ExpSpecAmtLimit      );
-    MinPremType         = 
static_cast<oenum_modal_prem_type>(Database_->Query(DB_MinPremType));
-    TgtPremType         = 
static_cast<oenum_modal_prem_type>(Database_->Query(DB_TgtPremType));
-    TgtPremFixedAtIssue = Database_->Query(DB_TgtPremFixedAtIssue  );
-    TgtPremMonthlyPolFee= Database_->Query(DB_TgtPremMonthlyPolFee );
+    MinIssSpecAmt       = database().Query(DB_MinIssSpecAmt        );
+    MinIssBaseSpecAmt   = database().Query(DB_MinIssBaseSpecAmt    );
+    MinRenlSpecAmt      = database().Query(DB_MinRenlSpecAmt       );
+    MinRenlBaseSpecAmt  = database().Query(DB_MinRenlBaseSpecAmt   );
+    NoLapseOpt1Only     = database().Query(DB_NoLapseDbo1Only      );
+    NoLapseUnratedOnly  = database().Query(DB_NoLapseUnratedOnly   );
+    OptChgCanIncrSA     = database().Query(DB_DboChgCanIncrSpecAmt );
+    OptChgCanDecrSA     = database().Query(DB_DboChgCanDecrSpecAmt );
+    WDCanDecrSADBO1     = database().Query(DB_WdCanDecrSpecAmtDbo1 );
+    WDCanDecrSADBO2     = database().Query(DB_WdCanDecrSpecAmtDbo2 );
+    WDCanDecrSADBO3     = database().Query(DB_WdCanDecrSpecAmtDbo3 );
+    MaxIncrAge          = static_cast<int>(database().Query(DB_MaxIncrAge));
+    WaivePmTxInt1035    = database().Query(DB_WaivePremTaxInt1035  );
+    TermIsNotRider      = database().Query(DB_TermIsNotRider       );
+    TermForcedConvAge   = 
static_cast<int>(database().Query(DB_TermForcedConvAge));
+    TermForcedConvDur   = 
static_cast<int>(database().Query(DB_TermForcedConvDur));
+    ExpPerKLimit        = database().Query(DB_ExpSpecAmtLimit      );
+    MinPremType         = 
static_cast<oenum_modal_prem_type>(database().Query(DB_MinPremType));
+    TgtPremType         = 
static_cast<oenum_modal_prem_type>(database().Query(DB_TgtPremType));
+    TgtPremFixedAtIssue = database().Query(DB_TgtPremFixedAtIssue  );
+    TgtPremMonthlyPolFee= database().Query(DB_TgtPremMonthlyPolFee );
     // Assertion: see comments on GetModalPremTgtFromTable().
     LMI_ASSERT
         (  0.0 == TgtPremMonthlyPolFee
         || (oe_modal_table == TgtPremType && oe_modal_table != MinPremType)
         );
-    CurrCoiTable0Limit  = Database_->Query(DB_CurrCoiTable0Limit   );
-    CurrCoiTable1Limit  = Database_->Query(DB_CurrCoiTable1Limit   );
+    CurrCoiTable0Limit  = database().Query(DB_CurrCoiTable0Limit   );
+    CurrCoiTable1Limit  = database().Query(DB_CurrCoiTable1Limit   );
     LMI_ASSERT(0.0                <= CurrCoiTable0Limit);
     LMI_ASSERT(CurrCoiTable0Limit <= CurrCoiTable1Limit);
-    CoiInforceReentry   = 
static_cast<e_actuarial_table_method>(Database_->Query(DB_CoiInforceReentry));
-    MaxWDDed_           = 
static_cast<mcenum_anticipated_deduction>(Database_->Query(DB_MaxWdDed));
-    MaxWdGenAcctValMult = Database_->Query(DB_MaxWdGenAcctValMult  );
-    MaxWdSepAcctValMult = Database_->Query(DB_MaxWdSepAcctValMult  );
-    AllowPrefLoan       = 
static_cast<bool>(Database_->Query(DB_AllowPrefLoan));
-    MaxLoanDed_         = 
static_cast<mcenum_anticipated_deduction>(Database_->Query(DB_MaxLoanDed));
-    MaxLoanAVMult       = Database_->Query(DB_MaxLoanAcctValMult   );
-    FirstPrefLoanYear   = 
static_cast<int>(Database_->Query(DB_FirstPrefLoanYear));
-    NoLapseMinDur       = static_cast<int>(Database_->Query(DB_NoLapseMinDur));
-    NoLapseMinAge       = static_cast<int>(Database_->Query(DB_NoLapseMinAge));
-    AdbLimit            = Database_->Query(DB_AdbLimit             );
-    WpLimit             = Database_->Query(DB_WpLimit              );
-    SpecAmtLoadLimit    = Database_->Query(DB_SpecAmtLoadLimit     );
-    MinWD               = Database_->Query(DB_MinWd                );
-    WDFee               = Database_->Query(DB_WdFee                );
-    WDFeeRate           = Database_->Query(DB_WdFeeRate            );
-    AllowChangeToDBO2   = Database_->Query(DB_AllowChangeToDbo2    );
-    AllowSAIncr         = Database_->Query(DB_AllowSpecAmtIncr     );
-    NoLapseAlwaysActive = Database_->Query(DB_NoLapseAlwaysActive  );
-    WaiverChargeMethod  = 
static_cast<oenum_waiver_charge_method>(Database_->Query(DB_WpChargeMethod));
-    Database_->Query(CashValueEnhMult, DB_CashValueEnhMult);
-    LapseIgnoresSurrChg = Database_->Query(DB_LapseIgnoresSurrChg  );
-    SurrChgOnIncr       = Database_->Query(DB_SurrChgOnIncr        );
-    SurrChgOnDecr       = Database_->Query(DB_SurrChgOnDecr        );
+    CoiInforceReentry   = 
static_cast<e_actuarial_table_method>(database().Query(DB_CoiInforceReentry));
+    MaxWDDed_           = 
static_cast<mcenum_anticipated_deduction>(database().Query(DB_MaxWdDed));
+    MaxWdGenAcctValMult = database().Query(DB_MaxWdGenAcctValMult  );
+    MaxWdSepAcctValMult = database().Query(DB_MaxWdSepAcctValMult  );
+    AllowPrefLoan       = 
static_cast<bool>(database().Query(DB_AllowPrefLoan));
+    MaxLoanDed_         = 
static_cast<mcenum_anticipated_deduction>(database().Query(DB_MaxLoanDed));
+    MaxLoanAVMult       = database().Query(DB_MaxLoanAcctValMult   );
+    FirstPrefLoanYear   = 
static_cast<int>(database().Query(DB_FirstPrefLoanYear));
+    NoLapseMinDur       = static_cast<int>(database().Query(DB_NoLapseMinDur));
+    NoLapseMinAge       = static_cast<int>(database().Query(DB_NoLapseMinAge));
+    AdbLimit            = database().Query(DB_AdbLimit             );
+    WpLimit             = database().Query(DB_WpLimit              );
+    SpecAmtLoadLimit    = database().Query(DB_SpecAmtLoadLimit     );
+    MinWD               = database().Query(DB_MinWd                );
+    WDFee               = database().Query(DB_WdFee                );
+    WDFeeRate           = database().Query(DB_WdFeeRate            );
+    AllowChangeToDBO2   = database().Query(DB_AllowChangeToDbo2    );
+    AllowSAIncr         = database().Query(DB_AllowSpecAmtIncr     );
+    NoLapseAlwaysActive = database().Query(DB_NoLapseAlwaysActive  );
+    WaiverChargeMethod  = 
static_cast<oenum_waiver_charge_method>(database().Query(DB_WpChargeMethod));
+    database().Query(CashValueEnhMult, DB_CashValueEnhMult);
+    LapseIgnoresSurrChg = database().Query(DB_LapseIgnoresSurrChg  );
+    SurrChgOnIncr       = database().Query(DB_SurrChgOnIncr        );
+    SurrChgOnDecr       = database().Query(DB_SurrChgOnDecr        );
     LMI_ASSERT(!SurrChgOnIncr); // Surrchg change on increase not supported.
     LMI_ASSERT(!SurrChgOnDecr); // Surrchg change on decrease not supported.
 
-    Database_->Query(FreeWDProportion, DB_FreeWdProportion);
+    database().Query(FreeWDProportion, DB_FreeWdProportion);
 
-    Database_->Query(DBDiscountRate, DB_NaarDiscount);
+    database().Query(DBDiscountRate, DB_NaarDiscount);
     LMI_ASSERT(!contains(DBDiscountRate, -1.0));
 // This would be more natural:
 //    assign(DBDiscountRate, 1.0 / (1.0 + DBDiscountRate));
@@ -668,22 +668,22 @@ void BasicValues::SetPermanentInvariants()
     assign(DBDiscountRate, 1.0 + DBDiscountRate);
     assign(DBDiscountRate, 1.0 / DBDiscountRate);
 
-    CalculateComp       = Database_->Query(DB_CalculateComp        );
-    Database_->Query(AssetComp , DB_AssetComp);
-    Database_->Query(CompTarget, DB_CompTarget);
-    Database_->Query(CompExcess, DB_CompExcess);
+    CalculateComp       = database().Query(DB_CalculateComp        );
+    database().Query(AssetComp , DB_AssetComp);
+    database().Query(CompTarget, DB_CompTarget);
+    database().Query(CompExcess, DB_CompExcess);
 
-    MandEIsDynamic      = Database_->Query(DB_DynamicMandE         );
-    SepAcctLoadIsDynamic= Database_->Query(DB_DynamicSepAcctLoad   );
+    MandEIsDynamic      = database().Query(DB_DynamicMandE         );
+    SepAcctLoadIsDynamic= database().Query(DB_DynamicSepAcctLoad   );
 
-    UseUnusualCOIBanding= Database_->Query(DB_UnusualCoiBanding    );
+    UseUnusualCOIBanding= database().Query(DB_UnusualCoiBanding    );
 
     // 'Unusual' COI banding accommodates a particular idiosyncratic
     // product which has no term rider and doesn't permit experience
     // rating, so we assert those preconditions and write simple code
     // for 'unusual' COI banding that ignores those features.
     LMI_ASSERT(!(UseUnusualCOIBanding && yare_input_.UseExperienceRating));
-    LMI_ASSERT(!(UseUnusualCOIBanding && Database_->Query(DB_AllowTerm)));
+    LMI_ASSERT(!(UseUnusualCOIBanding && database().Query(DB_AllowTerm)));
 
     // Flat extras can be used even with guaranteed issue, e.g., for
     // aviation, occupation, avocation, or foreign travel. Admin
@@ -717,7 +717,7 @@ void BasicValues::SetPermanentInvariants()
     // feature, but either way no end user has ever objected to it.
     if
         (   mce_table_none != yare_input_.SubstandardTable
-        &&  !(Database_->Query(DB_AllowSubstdTable) && mce_rated == 
yare_input_.UnderwritingClass)
+        &&  !(database().Query(DB_AllowSubstdTable) && mce_rated == 
yare_input_.UnderwritingClass)
         )
         {
         alarum() << "Substandard table ratings not permitted." << LMI_FLUSH;
@@ -752,15 +752,15 @@ void BasicValues::SetPermanentInvariants()
     // definitions, and 'DefinitionOfMaterialChange' will be removed.
     if(!global_settings::instance().ash_nazg())
         {
-        mcenum_defn_material_change const z = 
static_cast<mcenum_defn_material_change>(Database_->Query(DB_CvatMatChangeDefn));
+        mcenum_defn_material_change const z = 
static_cast<mcenum_defn_material_change>(database().Query(DB_CvatMatChangeDefn));
         DefnMaterialChange_ = (mce_gpt == DefnLifeIns_) ? mce_adjustment_event 
: z;
         }
-    Equiv7702DBO3       = 
static_cast<mcenum_dbopt_7702>(Database_->Query(DB_Equiv7702Dbo3));
-    TermIsDbFor7702     = 1.0 == Database_->Query(DB_TermIsQABOrDb7702 );
-    TermIsDbFor7702A    = 1.0 == Database_->Query(DB_TermIsQABOrDb7702A);
+    Equiv7702DBO3       = 
static_cast<mcenum_dbopt_7702>(database().Query(DB_Equiv7702Dbo3));
+    TermIsDbFor7702     = 1.0 == database().Query(DB_TermIsQABOrDb7702 );
+    TermIsDbFor7702A    = 1.0 == database().Query(DB_TermIsQABOrDb7702A);
     MaxNAAR             = yare_input_.MaximumNaar;
 
-    Database_->Query(MinPremIntSpread_, DB_MinPremIntSpread);
+    database().Query(MinPremIntSpread_, DB_MinPremIntSpread);
 }
 
 namespace
@@ -1558,7 +1558,7 @@ std::vector<double> BasicValues::GetUnblendedTable
     return GetActuarialTable
         (TableFile
         ,TableID
-        ,bourn_cast<int>(Database_->Query(TableID))
+        ,bourn_cast<int>(database().Query(TableID))
         );
 }
 
@@ -1570,11 +1570,11 @@ std::vector<double> BasicValues::GetUnblendedTable
     ,mcenum_smoking     smoking
     ) const
 {
-    database_index index = Database_->index().gender(gender).smoking(smoking);
+    database_index index = database().index().gender(gender).smoking(smoking);
     return GetActuarialTable
         (TableFile
         ,TableID
-        ,bourn_cast<int>(Database_->Query(TableID, index))
+        ,bourn_cast<int>(database().Query(TableID, index))
         );
 }
 
@@ -1931,7 +1931,7 @@ std::vector<double> BasicValues::GetWpRates() const
     return GetTable
         (product().datum("WPFilename")
         ,DB_WpTable
-        ,Database_->Query(DB_AllowWp)
+        ,database().Query(DB_AllowWp)
         );
 }
 
@@ -1940,7 +1940,7 @@ std::vector<double> BasicValues::GetAdbRates() const
     return GetTable
         (product().datum("ADDFilename")
         ,DB_AdbTable
-        ,Database_->Query(DB_AllowAdb)
+        ,database().Query(DB_AllowAdb)
         );
 }
 
@@ -1949,20 +1949,20 @@ std::vector<double> BasicValues::GetChildRiderRates() 
const
     return GetTable
         (product().datum("ChildRiderFilename")
         ,DB_ChildRiderTable
-        ,Database_->Query(DB_AllowChildRider)
+        ,database().Query(DB_AllowChildRider)
         );
 }
 
 std::vector<double> BasicValues::GetCurrentSpouseRiderRates() const
 {
-    if(!Database_->Query(DB_AllowSpouseRider))
+    if(!database().Query(DB_AllowSpouseRider))
         {
         return std::vector<double>(GetLength());
         }
 
     std::vector<double> z = actuarial_table_rates
         (AddDataDir(product().datum("CurrSpouseRiderFilename"))
-        ,bourn_cast<int>(Database_->Query(DB_SpouseRiderTable))
+        ,bourn_cast<int>(database().Query(DB_SpouseRiderTable))
         ,yare_input_.SpouseIssueAge
         ,EndtAge - yare_input_.SpouseIssueAge
         );
@@ -1972,14 +1972,14 @@ std::vector<double> 
BasicValues::GetCurrentSpouseRiderRates() const
 
 std::vector<double> BasicValues::GetGuaranteedSpouseRiderRates() const
 {
-    if(!Database_->Query(DB_AllowSpouseRider))
+    if(!database().Query(DB_AllowSpouseRider))
         {
         return std::vector<double>(GetLength());
         }
 
     std::vector<double> z = actuarial_table_rates
         (AddDataDir(product().datum("GuarSpouseRiderFilename"))
-        ,bourn_cast<int>(Database_->Query(DB_SpouseRiderGuarTable))
+        ,bourn_cast<int>(database().Query(DB_SpouseRiderGuarTable))
         ,yare_input_.SpouseIssueAge
         ,EndtAge - yare_input_.SpouseIssueAge
         );
@@ -1992,7 +1992,7 @@ std::vector<double> BasicValues::GetCurrentTermRates() 
const
     return GetTable
         (product().datum("CurrTermFilename")
         ,DB_TermTable
-        ,Database_->Query(DB_AllowTerm)
+        ,database().Query(DB_AllowTerm)
         ,CanBlend
         ,CanBlend
         );
@@ -2003,7 +2003,7 @@ std::vector<double> BasicValues::GetGuaranteedTermRates() 
const
     return GetTable
         (product().datum("GuarTermFilename")
         ,DB_GuarTermTable
-        ,Database_->Query(DB_AllowTerm)
+        ,database().Query(DB_AllowTerm)
         ,CanBlend
         ,CanBlend
         );
@@ -2023,7 +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(DB_SevenPayWhence)
+//        ,1 == database().Query(DB_SevenPayWhence)
         );
 }
 
@@ -2068,7 +2068,7 @@ std::vector<double> 
BasicValues::GetPartialMortalityRates() const
 
 std::vector<double> BasicValues::GetSubstdTblMultTable() const
 {
-    if(0 == Database_->Query(DB_SubstdTableMultTable))
+    if(0 == database().Query(DB_SubstdTableMultTable))
         {
         return std::vector<double>(GetLength(), 1.0);
         }
@@ -2084,7 +2084,7 @@ std::vector<double> 
BasicValues::GetCurrSpecAmtLoadTable() const
     return GetTable
         (product().datum("CurrSpecAmtLoadFilename")
         ,DB_CurrSpecAmtLoadTable
-        ,0 != Database_->Query(DB_CurrSpecAmtLoadTable)
+        ,0 != database().Query(DB_CurrSpecAmtLoadTable)
         );
 }
 
@@ -2093,7 +2093,7 @@ std::vector<double> 
BasicValues::GetGuarSpecAmtLoadTable() const
     return GetTable
         (product().datum("GuarSpecAmtLoadFilename")
         ,DB_GuarSpecAmtLoadTable
-        ,0 != Database_->Query(DB_GuarSpecAmtLoadTable)
+        ,0 != database().Query(DB_GuarSpecAmtLoadTable)
         );
 }
 
diff --git a/interest_rates.cpp b/interest_rates.cpp
index 565bd07..53d723e 100644
--- a/interest_rates.cpp
+++ b/interest_rates.cpp
@@ -256,15 +256,15 @@ InterestRates::InterestRates(BasicValues const& v)
     ,Zero_               (Length_)
     ,NeedMidpointRates_  {v.IsSubjectToIllustrationReg()}
     ,GenAcctRateType_    {v.yare_input_.GeneralAccountRateType}
-    ,NeedSepAcctRates_   {0.0 != v.Database_->Query(DB_AllowSepAcct)}
+    ,NeedSepAcctRates_   {0.0 != v.database().Query(DB_AllowSepAcct)}
     ,SepAcctRateType_    {v.yare_input_.SeparateAccountRateType}
-    
,SepAcctSpreadMethod_{static_cast<mcenum_spread_method>(static_cast<int>(v.Database_->Query(DB_SepAcctSpreadMethod)))}
+    
,SepAcctSpreadMethod_{static_cast<mcenum_spread_method>(static_cast<int>(v.database().Query(DB_SepAcctSpreadMethod)))}
     ,AmortLoad_          {Zero_}
     ,ExtraSepAcctCharge_ {Zero_}
 //    ,NeedLoanRates_      {need_loan_rates(v.yare_input_)}
     ,NeedLoanRates_      {true} // DEPRECATED
     ,LoanRateType_       {v.yare_input_.LoanRateType}
-    ,NeedPrefLoanRates_  {0.0 != v.Database_->Query(DB_AllowPrefLoan)}
+    ,NeedPrefLoanRates_  {0.0 != v.database().Query(DB_AllowPrefLoan)}
     ,NeedHoneymoonRates_ {v.yare_input_.HoneymoonEndorsement}
     ,SpreadFor7702_      {v.SpreadFor7702()}
 {
@@ -275,7 +275,7 @@ void InterestRates::Initialize(BasicValues const& v)
 {
     // Retrieve general-account data from class BasicValues.
 
-    v.Database_->Query(GenAcctGrossRate_[mce_gen_guar], DB_GuarInt);
+    v.database().Query(GenAcctGrossRate_[mce_gen_guar], DB_GuarInt);
 
     std::copy
         (v.yare_input_.GeneralAccountRate.begin()
@@ -293,13 +293,13 @@ void InterestRates::Initialize(BasicValues const& v)
     // almost certainly quoted as an APR. It is assumed that the
     // interest bonus is not guaranteed.
     std::vector<double> general_account_interest_bonus;
-    v.Database_->Query(general_account_interest_bonus, DB_GenAcctIntBonus);
+    v.database().Query(general_account_interest_bonus, DB_GenAcctIntBonus);
     // ET !! GenAcctGrossRate_ += general_account_interest_bonus;
     // ...and this might be further simplified by implementing e.g.
     //   std::vector<double> product_database::QueryVector(int k) const;
     // and replacing 'general_account_interest_bonus' with a
     // temporary:
-    //   GenAcctGrossRate_ += v.Database_->QueryVector(DB_GenAcctIntBonus);
+    //   GenAcctGrossRate_ += v.database().QueryVector(DB_GenAcctIntBonus);
     std::transform
         (GenAcctGrossRate_[mce_gen_curr].begin()
         ,GenAcctGrossRate_[mce_gen_curr].end()
@@ -308,7 +308,7 @@ void InterestRates::Initialize(BasicValues const& v)
         ,std::plus<double>()
         );
 
-    v.Database_->Query(GenAcctSpread_, DB_CurrIntSpread);
+    v.database().Query(GenAcctSpread_, DB_CurrIntSpread);
 
     // Retrieve separate-account data from class BasicValues.
 
@@ -321,21 +321,21 @@ void InterestRates::Initialize(BasicValues const& v)
     // the input class has an inappropriate size.
     SepAcctGrossRate_[mce_sep_full].resize(Length_);
 
-    v.Database_->Query(MAndERate_[mce_gen_guar], DB_GuarMandE          );
-    v.Database_->Query(MAndERate_[mce_gen_curr], DB_CurrMandE          );
+    v.database().Query(MAndERate_[mce_gen_guar], DB_GuarMandE          );
+    v.database().Query(MAndERate_[mce_gen_curr], DB_CurrMandE          );
 
-    v.Database_->Query(Stabilizer_,              DB_StableValFundCharge);
+    v.database().Query(Stabilizer_,              DB_StableValFundCharge);
 
     // Deduct miscellaneous fund charges and input extra asset comp in
     // the same way as M&E, iff database entity DB_AssetChargeType has
     // the value 'oe_asset_charge_spread'; otherwise, reflect them
     // elsewhere as an account-value load.
-    if(oe_asset_charge_spread == v.Database_->Query(DB_AssetChargeType))
+    if(oe_asset_charge_spread == v.database().Query(DB_AssetChargeType))
         {
         // TODO ?? At least for the antediluvian branch, the vector in
         // the input class has an inappropriate size. Truncating it
         // with std::transform() here is far too tricky.
-        LMI_ASSERT(lmi::ssize(ExtraSepAcctCharge_) == v.Database_->length());
+        LMI_ASSERT(lmi::ssize(ExtraSepAcctCharge_) == v.database().length());
 // Not reliably true:
 //        LMI_ASSERT
 //            (   ExtraSepAcctCharge_.size()
@@ -354,7 +354,7 @@ void InterestRates::Initialize(BasicValues const& v)
 
     if(v.yare_input_.AmortizePremiumLoad)
         {
-        v.Database_->Query(AmortLoad_, DB_LoadAmortFundCharge);
+        v.database().Query(AmortLoad_, DB_LoadAmortFundCharge);
         }
 
     // TODO ?? This was once initialized with 'DB_MgmtFeeFundCharge',
@@ -371,7 +371,7 @@ void InterestRates::Initialize(BasicValues const& v)
         {
         case mce_fixed_loan_rate:
             {
-            v.Database_->Query(PublishedLoanRate_, DB_FixedLoanRate);
+            v.database().Query(PublishedLoanRate_, DB_FixedLoanRate);
             }
             break;
         case mce_variable_loan_rate:
@@ -385,12 +385,12 @@ void InterestRates::Initialize(BasicValues const& v)
             }
         }
 
-    v.Database_->Query(PrefLoanRateDecr_, DB_PrefLoanRateDecr);
+    v.database().Query(PrefLoanRateDecr_, DB_PrefLoanRateDecr);
 
-    v.Database_->Query(RegLoanSpread_[mce_gen_guar], DB_GuarRegLoanSpread);
-    v.Database_->Query(RegLoanSpread_[mce_gen_curr], DB_CurrRegLoanSpread);
-    v.Database_->Query(PrfLoanSpread_[mce_gen_guar], DB_GuarPrefLoanSpread);
-    v.Database_->Query(PrfLoanSpread_[mce_gen_curr], DB_CurrPrefLoanSpread);
+    v.database().Query(RegLoanSpread_[mce_gen_guar], DB_GuarRegLoanSpread);
+    v.database().Query(RegLoanSpread_[mce_gen_curr], DB_CurrRegLoanSpread);
+    v.database().Query(PrfLoanSpread_[mce_gen_guar], DB_GuarPrefLoanSpread);
+    v.database().Query(PrfLoanSpread_[mce_gen_curr], DB_CurrPrefLoanSpread);
 
     if(NeedHoneymoonRates_)
         {
diff --git a/ledger_invariant_init.cpp b/ledger_invariant_init.cpp
index 9bc964b..0e8b2ea 100644
--- a/ledger_invariant_init.cpp
+++ b/ledger_invariant_init.cpp
@@ -92,7 +92,7 @@ void LedgerInvariant::Init(BasicValues const* b)
         {
         TermSpecAmt     .assign(Length, b->yare_input_.TermRiderAmount);
         }
-    else if(b->Database_->Query(DB_TermIsNotRider))
+    else if(b->database().Query(DB_TermIsNotRider))
         {
         TermSpecAmt      = b->DeathBfts_->supplamt();
         if(!each_equal(TermSpecAmt, 0.0))
@@ -131,7 +131,7 @@ void LedgerInvariant::Init(BasicValues const* b)
     RefundableSalesLoad  = b->Loads_->refundable_sales_load_proportion();
 
     std::vector<double> coimult;
-    b->Database_->Query(coimult, DB_CurrCoiMultiplier);
+    b->database().Query(coimult, DB_CurrCoiMultiplier);
     CurrentCoiMultiplier =
           coimult                            [b->yare_input_.InforceYear]
         * b->yare_input_.CurrentCoiMultiplier[b->yare_input_.InforceYear]
@@ -204,10 +204,10 @@ void LedgerInvariant::Init(BasicValues const* b)
             )
         ;
 
-    NoLapseAlwaysActive     = b->Database_->Query(DB_NoLapseAlwaysActive);
-    NoLapseMinDur           = b->Database_->Query(DB_NoLapseMinDur);
-    NoLapseMinAge           = b->Database_->Query(DB_NoLapseMinAge);
-    Has1035ExchCharge       = b->Database_->Query(DB_Has1035ExchCharge);
+    NoLapseAlwaysActive     = b->database().Query(DB_NoLapseAlwaysActive);
+    NoLapseMinDur           = b->database().Query(DB_NoLapseMinDur);
+    NoLapseMinAge           = b->database().Query(DB_NoLapseMinAge);
+    Has1035ExchCharge       = b->database().Query(DB_Has1035ExchCharge);
 
     // SOMEDAY !! Things indexed with '[0]' should probably use inforce year 
instead.
     InitBaseSpecAmt         = b->DeathBfts_->specamt()[0];
@@ -248,7 +248,7 @@ void LedgerInvariant::Init(BasicValues const* b)
     Age                     = b->yare_input_.IssueAge;
     RetAge                  = b->yare_input_.RetirementAge;
     EndtAge                 = b->yare_input_.IssueAge + b->GetLength();
-    GroupIndivSelection     = b->Database_->Query(DB_GroupIndivSelection);
+    GroupIndivSelection     = b->database().Query(DB_GroupIndivSelection);
     UseExperienceRating     = b->yare_input_.UseExperienceRating;
     UsePartialMort          = b->yare_input_.UsePartialMortality;
     AvgFund                 = b->yare_input_.UseAverageOfAllFunds;
@@ -263,8 +263,8 @@ void LedgerInvariant::Init(BasicValues const* b)
 
     HasHoneymoon            = b->yare_input_.HoneymoonEndorsement;
     PostHoneymoonSpread     = b->yare_input_.PostHoneymoonSpread;
-    SplitMinPrem            = b->Database_->Query(DB_SplitMinPrem);
-    AllowDbo3               = b->Database_->Query(DB_AllowDbo3);
+    SplitMinPrem            = b->database().Query(DB_SplitMinPrem);
+    AllowDbo3               = b->database().Query(DB_AllowDbo3);
 
     // These are reassigned below based on product data if available.
     std::string dbo_name_option1 = mc_str(mce_option1);
@@ -280,7 +280,7 @@ void LedgerInvariant::Init(BasicValues const* b)
         // DATABASE !! It would be much better, of course, to let all
         // strings in class product_data vary across the same axes as
         // database_entity objects.
-        bool alt_form = b->Database_->Query(DB_UsePolicyFormAlt);
+        bool alt_form = b->database().Query(DB_UsePolicyFormAlt);
         dbo_name_option1               = p.datum("DboNameLevel"                
   );
         dbo_name_option2               = p.datum("DboNameIncreasing"           
   );
         dbo_name_rop                   = p.datum("DboNameReturnOfPremium"      
   );
@@ -442,7 +442,7 @@ void LedgerInvariant::Init(BasicValues const* b)
     //
     oenum_smoking_or_tobacco smoke_or_tobacco =
         static_cast<oenum_smoking_or_tobacco>
-            (b->Database_->Query(DB_SmokeOrTobacco)
+            (b->database().Query(DB_SmokeOrTobacco)
             );
     if(oe_tobacco_nontobacco == smoke_or_tobacco)
         {
diff --git a/loads.cpp b/loads.cpp
index 56a1e84..77e0d96 100644
--- a/loads.cpp
+++ b/loads.cpp
@@ -39,7 +39,7 @@
 Loads::Loads(BasicValues& V)
 {
     int length = V.GetLength();
-    LMI_ASSERT(length == V.Database_->length());
+    LMI_ASSERT(length == V.database().length());
     LMI_ASSERT(!V.yare_input_.AmortizePremiumLoad); // Amortization is 
untested.
     load_details details
         (length
@@ -48,9 +48,9 @@ Loads::Loads(BasicValues& V)
         ,V.PremiumTax_->maximum_load_rate()
         ,V.PremiumTax_->minimum_load_rate()
         ,V.PremiumTax_->levy_rate()
-        ,V.Database_->Query(DB_PremTaxAmortIntRate)
-        ,V.Database_->Query(DB_PremTaxAmortPeriod)
-        ,V.Database_->Query(DB_AssetChargeType)
+        ,V.database().Query(DB_PremTaxAmortIntRate)
+        ,V.database().Query(DB_PremTaxAmortPeriod)
+        ,V.database().Query(DB_AssetChargeType)
         ,V.IsSubjectToIllustrationReg()
         ,V.round_interest_rate()
         ,V.yare_input_.ExtraCompensationOnPremium
@@ -60,7 +60,7 @@ Loads::Loads(BasicValues& V)
         ,V.GetCurrSpecAmtLoadTable()
         );
     Allocate(length);
-    Initialize(*V.Database_);
+    Initialize(V.database());
     Calculate(details);
 }
 
diff --git a/mortality_rates.cpp b/mortality_rates.cpp
index 4c5ca77..7749736 100644
--- a/mortality_rates.cpp
+++ b/mortality_rates.cpp
@@ -47,14 +47,14 @@ void MortalityRates::Init(BasicValues const& basic_values)
 
     MonthlyCurrentCoiRatesBand0_ = actuarial_table_rates
         (CurrentTableFile()
-        ,bourn_cast<int>(basic_values.Database_->Query(DB_CurrCoiTable))
+        ,bourn_cast<int>(basic_values.database().Query(DB_CurrCoiTable))
         ,issue_age
         ,length
         );
 
     MonthlyGuaranteedCoiRates_ = actuarial_table_rates
         (GuaranteedTableFile()
-        ,bourn_cast<int>(basic_values.Database_->Query(DB_GuarCoiTable))
+        ,bourn_cast<int>(basic_values.database().Query(DB_GuarCoiTable))
         ,issue_age
         ,length
         );
@@ -73,21 +73,21 @@ void MortalityRates::Init(BasicValues const& basic_values)
 
     CvatCorridorFactors_ = actuarial_table_rates
         (CurrentTableFile()
-        ,bourn_cast<int>(basic_values.Database_->Query(DB_CorridorTable))
+        ,bourn_cast<int>(basic_values.database().Query(DB_CorridorTable))
         ,issue_age
         ,length
         );
 
     AdbRates_ = actuarial_table_rates
         (CurrentTableFile()
-        ,bourn_cast<int>(basic_values.Database_->Query(DB_AdbTable))
+        ,bourn_cast<int>(basic_values.database().Query(DB_AdbTable))
         ,issue_age
         ,length
         );
 
     WpRates_ = actuarial_table_rates
         (CurrentTableFile()
-        ,bourn_cast<int>(basic_values.Database_->Query(DB_WpTable))
+        ,bourn_cast<int>(basic_values.database().Query(DB_WpTable))
         ,issue_age
         ,length
         );
diff --git a/mortality_rates_fetch.cpp b/mortality_rates_fetch.cpp
index 1595bcf..68727a9 100644
--- a/mortality_rates_fetch.cpp
+++ b/mortality_rates_fetch.cpp
@@ -44,27 +44,27 @@ void MortalityRates::fetch_parameters(BasicValues const& 
basic_values)
     // Some of these data members seem useless for now, but they will
     // become useful when mortality-table access is moved hither from
     // class BasicValues.
-    AllowAdb_          = basic_values.Database_->Query(DB_AllowAdb         );
-    AllowChild_        = basic_values.Database_->Query(DB_AllowChildRider  );
-    AllowFlatExtras_   = basic_values.Database_->Query(DB_AllowFlatExtras  );
-    AllowSpouse_       = basic_values.Database_->Query(DB_AllowSpouseRider );
-    AllowSubstdTable_  = basic_values.Database_->Query(DB_AllowSubstdTable );
-    AllowTerm_         = basic_values.Database_->Query(DB_AllowTerm        );
-    AllowWp_           = basic_values.Database_->Query(DB_AllowWp          );
-    CCoiIsAnnual_      = basic_values.Database_->Query(DB_CurrCoiIsAnnual  );
-    GCoiIsAnnual_      = basic_values.Database_->Query(DB_GuarCoiIsAnnual  );
+    AllowAdb_          = basic_values.database().Query(DB_AllowAdb         );
+    AllowChild_        = basic_values.database().Query(DB_AllowChildRider  );
+    AllowFlatExtras_   = basic_values.database().Query(DB_AllowFlatExtras  );
+    AllowSpouse_       = basic_values.database().Query(DB_AllowSpouseRider );
+    AllowSubstdTable_  = basic_values.database().Query(DB_AllowSubstdTable );
+    AllowTerm_         = basic_values.database().Query(DB_AllowTerm        );
+    AllowWp_           = basic_values.database().Query(DB_AllowWp          );
+    CCoiIsAnnual_      = basic_values.database().Query(DB_CurrCoiIsAnnual  );
+    GCoiIsAnnual_      = basic_values.database().Query(DB_GuarCoiIsAnnual  );
     IsTgtPremTabular_ =
-        oe_modal_table == basic_values.Database_->Query(DB_TgtPremType)
+        oe_modal_table == basic_values.database().Query(DB_TgtPremType)
         ;
 
-    double max_coi_rate = basic_values.Database_->Query(DB_MaxMonthlyCoiRate);
+    double max_coi_rate = basic_values.database().Query(DB_MaxMonthlyCoiRate);
     LMI_ASSERT(0.0 != max_coi_rate);
     max_coi_rate = 1.0 / max_coi_rate;
     MaxMonthlyCoiRate_ = max_coi_rate;
 
-    basic_values.Database_->Query(GCoiMultiplier_, DB_GuarCoiMultiplier);
-    basic_values.Database_->Query(CCoiMultiplier_, DB_CurrCoiMultiplier);
-    basic_values.Database_->Query(SubstdTblMult_ , DB_SubstdTableMult  );
+    basic_values.database().Query(GCoiMultiplier_, DB_GuarCoiMultiplier);
+    basic_values.database().Query(CCoiMultiplier_, DB_CurrCoiMultiplier);
+    basic_values.database().Query(SubstdTblMult_ , DB_SubstdTableMult  );
 
     CountryCoiMultiplier_ = basic_values.yare_input_.CountryCoiMultiplier;
     IsPolicyRated_        = is_policy_rated(basic_values.yare_input_);



reply via email to

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