[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] valyuta/004 260857d 2/9: Read product data files ear
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] valyuta/004 260857d 2/9: Read product data files earlier |
Date: |
Tue, 29 Dec 2020 14:46:01 -0500 (EST) |
branch: valyuta/004
commit 260857dfb2311b0debb72a4324245ea23cda5cab
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 32e1291..0830e7f 100644
--- a/ihs_basicval.cpp
+++ b/ihs_basicval.cpp
@@ -174,6 +174,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"));
@@ -224,6 +234,7 @@ void BasicValues::Init()
<< LMI_FLUSH
;
}
+
if(database().query<int>(DB_MaxIssAge) < IssueAge)
{
alarum()
@@ -235,15 +246,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] valyuta/004 updated (cf62b44 -> 506051a), Greg Chicares, 2020/12/29
- [lmi-commits] [lmi] valyuta/004 260857d 2/9: Read product data files earlier,
Greg Chicares <=
- [lmi-commits] [lmi] valyuta/004 296ee07 5/9: Set 7702 and 7702A interest rates OAOO, Greg Chicares, 2020/12/29
- [lmi-commits] [lmi] valyuta/004 288c26f 8/9: Refactor to avoid a header-only implementation, Greg Chicares, 2020/12/29
- [lmi-commits] [lmi] valyuta/004 4a1687e 1/9: Expunge a defect marker [324], Greg Chicares, 2020/12/29
- [lmi-commits] [lmi] valyuta/004 50ed405 3/9: Prefer explicit to implicit currency rounding, Greg Chicares, 2020/12/29
- [lmi-commits] [lmi] valyuta/004 9e6c7e1 4/9: Abjure converting currency ctors, Greg Chicares, 2020/12/29
- [lmi-commits] [lmi] valyuta/004 806f2fd 6/9: fixup, Greg Chicares, 2020/12/29
- [lmi-commits] [lmi] valyuta/004 87f1e13 7/9: Split a unit-test TU in twain, Greg Chicares, 2020/12/29
- [lmi-commits] [lmi] valyuta/004 506051a 9/9: Conditionally use H.R. 6800's 7702 transitional rates, Greg Chicares, 2020/12/29