[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master ec3eff3 4/4: Use new database query function
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master ec3eff3 4/4: Use new database query function |
Date: |
Mon, 5 Nov 2018 19:33:45 -0500 (EST) |
branch: master
commit ec3eff328c6de7f85e7fb04ecdd635fa7e49066e
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Use new database query function
This commit should solve the problem with a nonconforming proprietary
compiler that was reported here:
https://lists.nongnu.org/archive/html/lmi/2018-11/msg00007.html
---
basicvalues.cpp | 2 +-
gpt_input.cpp | 13 +++++--------
ihs_acctval.cpp | 32 ++++++++------------------------
ihs_basicval.cpp | 21 +++++++++++----------
input_harmonization.cpp | 18 ++++++------------
ledger_invariant_init.cpp | 6 ++----
mec_input.cpp | 13 +++++--------
7 files changed, 38 insertions(+), 67 deletions(-)
diff --git a/basicvalues.cpp b/basicvalues.cpp
index 5fa6455..ca24b8a 100644
--- a/basicvalues.cpp
+++ b/basicvalues.cpp
@@ -100,7 +100,7 @@ void BasicValues::Init()
EndtAge = static_cast<int>(database().Query(DB_MaturityAge));
Length = EndtAge - IssueAge;
- ledger_type_ =
static_cast<mcenum_ledger_type>(database().Query(DB_LedgerType));
+ database().query_into(ledger_type_, 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;
diff --git a/gpt_input.cpp b/gpt_input.cpp
index 39c0ab1..ed9c06b 100644
--- a/gpt_input.cpp
+++ b/gpt_input.cpp
@@ -402,10 +402,9 @@ void gpt_input::DoHarmonize()
)
);
- oenum_alb_or_anb const alb_anb =
- static_cast<oenum_alb_or_anb>
- (database_->Query(DB_AgeLastOrNearest)
- );
+ oenum_alb_or_anb alb_anb;
+ database_->query_into(alb_anb, DB_AgeLastOrNearest);
+
DateOfBirth.minimum_and_maximum
(minimum_birthdate(IssueAge.maximum(), EffectiveDate.value(), alb_anb)
,maximum_birthdate(IssueAge.minimum(), EffectiveDate.value(), alb_anb)
@@ -546,10 +545,8 @@ void gpt_input::DoTransmogrify()
InforceContractYear = ym1.first;
InforceContractMonth = ym1.second;
- oenum_alb_or_anb const alb_anb =
- static_cast<oenum_alb_or_anb>
- (database_->Query(DB_AgeLastOrNearest)
- );
+ oenum_alb_or_anb alb_anb;
+ database_->query_into(alb_anb, DB_AgeLastOrNearest);
int apparent_age = attained_age
(DateOfBirth.value()
diff --git a/ihs_acctval.cpp b/ihs_acctval.cpp
index 68bb663..03e8c1b 100644
--- a/ihs_acctval.cpp
+++ b/ihs_acctval.cpp
@@ -698,30 +698,14 @@ void AccountValue::SetInitialValues()
External1035Amount = Outlay_->external_1035_amount();
Internal1035Amount = Outlay_->internal_1035_amount();
- ee_premium_allocation_method = static_cast<oenum_allocation_method>
- (database().Query(DB_EePremMethod)
- );
- ee_premium_preferred_account =
static_cast<oenum_increment_account_preference>
- (database().Query(DB_EePremAcct)
- );
- er_premium_allocation_method = static_cast<oenum_allocation_method>
- (database().Query(DB_ErPremMethod)
- );
- er_premium_preferred_account =
static_cast<oenum_increment_account_preference>
- (database().Query(DB_ErPremAcct)
- );
- deduction_method = static_cast<oenum_increment_method>
- (database().Query(DB_DeductionMethod)
- );
- deduction_preferred_account =
static_cast<oenum_increment_account_preference>
- (database().Query(DB_DeductionAcct)
- );
- distribution_method = static_cast<oenum_increment_method>
- (database().Query(DB_DistributionMethod)
- );
- distribution_preferred_account =
static_cast<oenum_increment_account_preference>
- (database().Query(DB_DistributionAcct)
- );
+ database().query_into(ee_premium_allocation_method , DB_EePremMethod);
+ database().query_into(ee_premium_preferred_account , DB_EePremAcct);
+ database().query_into(er_premium_allocation_method , DB_ErPremMethod);
+ database().query_into(er_premium_preferred_account , DB_ErPremAcct);
+ database().query_into(deduction_method , DB_DeductionMethod);
+ database().query_into(deduction_preferred_account , DB_DeductionAcct);
+ database().query_into(distribution_method ,
DB_DistributionMethod);
+ database().query_into(distribution_preferred_account, DB_DistributionAcct);
// If any account preference is the separate account, then a
// separate account must be available.
diff --git a/ihs_basicval.cpp b/ihs_basicval.cpp
index 8612aba..7a33dde 100644
--- a/ihs_basicval.cpp
+++ b/ihs_basicval.cpp
@@ -176,7 +176,7 @@ void BasicValues::Init()
EndtAge = static_cast<int>(database().Query(DB_MaturityAge));
Length = EndtAge - IssueAge;
- ledger_type_ =
static_cast<mcenum_ledger_type>(database().Query(DB_LedgerType));
+ database().query_into(ledger_type_, 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;
@@ -272,7 +272,7 @@ 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));
+ database().query_into(ledger_type_, 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;
@@ -623,8 +623,8 @@ void BasicValues::SetPermanentInvariants()
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));
+ database().query_into(MinPremType, DB_MinPremType);
+ database().query_into(TgtPremType, DB_TgtPremType);
TgtPremFixedAtIssue = database().Query(DB_TgtPremFixedAtIssue );
TgtPremMonthlyPolFee= database().Query(DB_TgtPremMonthlyPolFee );
// Assertion: see comments on GetModalPremTgtFromTable().
@@ -636,12 +636,12 @@ void BasicValues::SetPermanentInvariants()
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));
+ database().query_into(CoiInforceReentry, DB_CoiInforceReentry);
+ database().query_into(MaxWDDed_ , 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));
+ database().query_into(MaxLoanDed_, DB_MaxLoanDed);
MaxLoanAVMult = database().Query(DB_MaxLoanAcctValMult );
FirstPrefLoanYear =
static_cast<int>(database().Query(DB_FirstPrefLoanYear));
NoLapseMinDur = static_cast<int>(database().Query(DB_NoLapseMinDur));
@@ -655,7 +655,7 @@ void BasicValues::SetPermanentInvariants()
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_into(WaiverChargeMethod, DB_WpChargeMethod);
database().Query(CashValueEnhMult, DB_CashValueEnhMult);
LapseIgnoresSurrChg = database().Query(DB_LapseIgnoresSurrChg );
SurrChgOnIncr = database().Query(DB_SurrChgOnIncr );
@@ -757,10 +757,11 @@ 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 z;
+ database().query_into(z, DB_CvatMatChangeDefn);
DefnMaterialChange_ = (mce_gpt == DefnLifeIns_) ? mce_adjustment_event
: z;
}
- Equiv7702DBO3 =
static_cast<mcenum_dbopt_7702>(database().Query(DB_Equiv7702Dbo3));
+ database().query_into(Equiv7702DBO3, DB_Equiv7702Dbo3);
TermIsDbFor7702 = 1.0 == database().Query(DB_TermIsQABOrDb7702 );
TermIsDbFor7702A = 1.0 == database().Query(DB_TermIsQABOrDb7702A);
MaxNAAR = yare_input_.MaximumNaar;
diff --git a/input_harmonization.cpp b/input_harmonization.cpp
index 0260826..58ffb7e 100644
--- a/input_harmonization.cpp
+++ b/input_harmonization.cpp
@@ -95,10 +95,7 @@ void Input::DoAdaptExternalities()
GleanedMaturityAge_ = static_cast<int>(database_->Query(DB_MaturityAge));
- GleanedLedgerType_ =
- static_cast<mcenum_ledger_type>
- (database_->Query(DB_LedgerType)
- );
+ database_->query_into(GleanedLedgerType_, DB_LedgerType);
}
void Input::DoCustomizeInitialValues()
@@ -274,10 +271,9 @@ void Input::DoHarmonize()
)
);
- oenum_alb_or_anb const alb_anb =
- static_cast<oenum_alb_or_anb>
- (database_->Query(DB_AgeLastOrNearest)
- );
+ oenum_alb_or_anb alb_anb;
+ database_->query_into(alb_anb, DB_AgeLastOrNearest);
+
DateOfBirth.minimum_and_maximum
(minimum_birthdate(IssueAge.maximum(), EffectiveDate.value(), alb_anb)
,maximum_birthdate(IssueAge.minimum(), EffectiveDate.value(), alb_anb)
@@ -914,10 +910,8 @@ void Input::DoTransmogrify()
GeneralAccountRate = current_credited_rate(*database_);
}
- oenum_alb_or_anb const alb_anb =
- static_cast<oenum_alb_or_anb>
- (database_->Query(DB_AgeLastOrNearest)
- );
+ oenum_alb_or_anb alb_anb;
+ database_->query_into(alb_anb, DB_AgeLastOrNearest);
int apparent_age = attained_age
(DateOfBirth.value()
diff --git a/ledger_invariant_init.cpp b/ledger_invariant_init.cpp
index 0e8b2ea..b34c854 100644
--- a/ledger_invariant_init.cpp
+++ b/ledger_invariant_init.cpp
@@ -440,10 +440,8 @@ void LedgerInvariant::Init(BasicValues const* b)
// database if class product_data is rewritten to encompass
// variation across axes (as class DBDictionary does).
//
- oenum_smoking_or_tobacco smoke_or_tobacco =
- static_cast<oenum_smoking_or_tobacco>
- (b->database().Query(DB_SmokeOrTobacco)
- );
+ oenum_smoking_or_tobacco smoke_or_tobacco;
+ b->database().query_into(smoke_or_tobacco, DB_SmokeOrTobacco);
if(oe_tobacco_nontobacco == smoke_or_tobacco)
{
switch(b->yare_input_.Smoking)
diff --git a/mec_input.cpp b/mec_input.cpp
index 6c54b49..f8b18fe 100644
--- a/mec_input.cpp
+++ b/mec_input.cpp
@@ -369,10 +369,9 @@ void mec_input::DoHarmonize()
)
);
- oenum_alb_or_anb const alb_anb =
- static_cast<oenum_alb_or_anb>
- (database_->Query(DB_AgeLastOrNearest)
- );
+ oenum_alb_or_anb alb_anb;
+ database_->query_into(alb_anb, DB_AgeLastOrNearest);
+
DateOfBirth.minimum_and_maximum
(minimum_birthdate(IssueAge.maximum(), EffectiveDate.value(), alb_anb)
,maximum_birthdate(IssueAge.minimum(), EffectiveDate.value(), alb_anb)
@@ -493,10 +492,8 @@ void mec_input::DoTransmogrify()
InforceContractYear = ym1.first;
InforceContractMonth = ym1.second;
- oenum_alb_or_anb const alb_anb =
- static_cast<oenum_alb_or_anb>
- (database_->Query(DB_AgeLastOrNearest)
- );
+ oenum_alb_or_anb alb_anb;
+ database_->query_into(alb_anb, DB_AgeLastOrNearest);
int apparent_age = attained_age
(DateOfBirth.value()