[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 3ee62a7 19/24: Read product data files earlie
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 3ee62a7 19/24: Read product data files earlier |
Date: |
Wed, 30 Dec 2020 18:47:01 -0500 (EST) |
branch: master
commit 3ee62a72fb8294c8cc0918d8c8f1ca3992101392
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Read product data files earlier
The immediate motivation is to make rounding rules available earlier,
so that values can be rounded when they are loaded from the database.
This is safe because the selection of data files depends only on the
product, which is determined by ctor arguments; because these XML files
are always read in the same way (in their entirety, regardless of any
other context); and because failure to read any of them causes the ctor
to throw.
SetRoundingFunctors() is similarly safe: it merely sets the function
objects used for rounding, and it depends only on a '.rounding' file.
The appropriate '.policy' and '.database' files have already been read
upstream from this change. The '.funds', '.lingo', and '.strata' files
may as well be read at the same time as '.rounding', for concinnity.
---
ihs_basicval.cpp | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/ihs_basicval.cpp b/ihs_basicval.cpp
index 8e3f6fe..48ab827 100644
--- a/ihs_basicval.cpp
+++ b/ihs_basicval.cpp
@@ -164,6 +164,16 @@ BasicValues::BasicValues
//============================================================================
void BasicValues::Init()
{
+ lingo_ =
lingo::read_via_cache(AddDataDir(product().datum("LingoFilename")));
+ FundData_.reset(new FundData(AddDataDir(product().datum("FundFilename"))));
+ RoundingRules_.reset
+ (new rounding_rules(AddDataDir(product().datum("RoundingFilename")))
+ );
+ SetRoundingFunctors();
+ StratifiedCharges_.reset
+ (new stratified_charges(AddDataDir(product().datum("TierFilename")))
+ );
+
SetPermanentInvariants();
StateOfDomicile_ = mc_state_from_string(product().datum("InsCoDomicile"));
@@ -214,6 +224,7 @@ void BasicValues::Init()
<< LMI_FLUSH
;
}
+
if(database().query<int>(DB_MaxIssAge) < IssueAge)
{
alarum()
@@ -225,15 +236,7 @@ void BasicValues::Init()
<< LMI_FLUSH
;
}
- lingo_ =
lingo::read_via_cache(AddDataDir(product().datum("LingoFilename")));
- FundData_.reset(new FundData(AddDataDir(product().datum("FundFilename"))));
- RoundingRules_.reset
- (new rounding_rules(AddDataDir(product().datum("RoundingFilename")))
- );
- SetRoundingFunctors();
- StratifiedCharges_.reset
- (new stratified_charges(AddDataDir(product().datum("TierFilename")))
- );
+
SpreadFor7702_.assign
(Length
,StratifiedCharges_->minimum_tiered_spread_for_7702()
- [lmi-commits] [lmi] master d89a676 22/24: Refactor to avoid a header-only implementation, (continued)
- [lmi-commits] [lmi] master d89a676 22/24: Refactor to avoid a header-only implementation, Greg Chicares, 2020/12/30
- [lmi-commits] [lmi] master 3121c90 23/24: Conditionally use H.R. 6800's 7702 transitional rates, Greg Chicares, 2020/12/30
- [lmi-commits] [lmi] master 3ee0c70 15/24: Make two member functions identical, Greg Chicares, 2020/12/30
- [lmi-commits] [lmi] master d7f3337 09/24: Move a block of code as just announced, Greg Chicares, 2020/12/30
- [lmi-commits] [lmi] master d4e0291 10/24: Refactor, Greg Chicares, 2020/12/30
- [lmi-commits] [lmi] master 71d750e 14/24: Make two member functions almost identical, Greg Chicares, 2020/12/30
- [lmi-commits] [lmi] master a473a82 17/24: Expunge a duplicative member function [325], Greg Chicares, 2020/12/30
- [lmi-commits] [lmi] master 2bc3d08 02/24: Move an enum, Greg Chicares, 2020/12/30
- [lmi-commits] [lmi] master b3cbe37 11/24: Move another block of code, Greg Chicares, 2020/12/30
- [lmi-commits] [lmi] master 9180696 16/24: Change a member's type-specifier, Greg Chicares, 2020/12/30
- [lmi-commits] [lmi] master 3ee62a7 19/24: Read product data files earlier,
Greg Chicares <=
- [lmi-commits] [lmi] master 7930f69 20/24: Set 7702 and 7702A interest rates OAOO, Greg Chicares, 2020/12/30
- [lmi-commits] [lmi] master d6701e8 21/24: Split a unit-test TU in twain, Greg Chicares, 2020/12/30
- [lmi-commits] [lmi] master e1047b3 24/24: Record speed measurements, Greg Chicares, 2020/12/30