[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 359c74c 09/16: Treat 'InitErMode' the same as
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 359c74c 09/16: Treat 'InitErMode' the same as any other ledger string |
Date: |
Sat, 11 Apr 2020 20:36:03 -0400 (EDT) |
branch: master
commit 359c74c31d303312e42af0950cddabc814b608a6
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Treat 'InitErMode' the same as any other ledger string
'InitErMode' and 'InitDBOpt' are "special" in the same sense: they're
strings representing initial values of enumerative vectors. They're
arguably redundant, because they simply store the string corresponding
to the first element of their respective enumerative vectors. However,
they had heretofore been treated differently: 'InitDBOpt' was part of
the 'Strings' map, whose elements are handled in the base class's Copy()
and PlusEq() functions, but 'InitErMode' was not; now it is.
This affects '.test' output, which now includes 'InitErMode'.
Some other strings are "special" and redundant in a different way: they
represent formatted dates corresponding to JDN members. Those strings
are excluded from 'Strings', because date formatting depends on OS
settings, and regression tests wouldn't match between machines with
different settings if they were included in '.test' output.
---
ledger_invariant.cpp | 10 +---------
ledger_invariant.hpp | 16 ++++++++--------
2 files changed, 9 insertions(+), 17 deletions(-)
diff --git a/ledger_invariant.cpp b/ledger_invariant.cpp
index 4de989c..963eed8 100644
--- a/ledger_invariant.cpp
+++ b/ledger_invariant.cpp
@@ -381,8 +381,7 @@ void LedgerInvariant::Alloc(int len)
Strings["SupplementalReportColumn10" ] = &SupplementalReportColumn10
;
Strings["SupplementalReportColumn11" ] = &SupplementalReportColumn11
;
- // Special-case strings.
-
+ Strings["InitErMode" ] = &InitErMode
;
Strings["InitDBOpt" ] = &InitDBOpt
;
LedgerBase::Alloc();
@@ -437,8 +436,6 @@ void LedgerInvariant::Copy(LedgerInvariant const& obj)
LastCoiReentryDate = obj.LastCoiReentryDate ;
ListBillDate = obj.ListBillDate ;
InforceAsOfDate = obj.InforceAsOfDate ;
- InitErMode = obj.InitErMode ;
- InitDBOpt = obj.InitDBOpt ;
// Private internals.
irr_precision_ = obj.irr_precision_ ;
@@ -662,11 +659,6 @@ LedgerInvariant& LedgerInvariant::PlusEq(LedgerInvariant
const& a_Addend)
ListBillDate = a_Addend.ListBillDate;
InforceAsOfDate = a_Addend.InforceAsOfDate;
- // Special-case enumerative data.
-
- InitErMode = a_Addend.InitErMode;
- InitDBOpt = a_Addend.InitDBOpt;
-
return *this;
}
diff --git a/ledger_invariant.hpp b/ledger_invariant.hpp
index 7d39631..7187276 100644
--- a/ledger_invariant.hpp
+++ b/ledger_invariant.hpp
@@ -428,6 +428,14 @@ class LMI_SO LedgerInvariant final
std::string SupplementalReportColumn10;
std::string SupplementalReportColumn11;
+ // Arguably enumerative members such as 'ErMode' should be of type
+ // std::string instead, because strings would be more useful for
+ // generating reports from this class's data, and mc_enum::str()
+ // is not visible across a shared-library boundary. For now, this
+ // kludge solves an immediate problem for premium quotes.
+ std::string InitErMode;
+ std::string InitDBOpt;
+
// Special-case strings.
// Calendar dates are special because date formatting might be
@@ -440,14 +448,6 @@ class LMI_SO LedgerInvariant final
std::string ListBillDate;
std::string InforceAsOfDate;
- // Arguably enumerative members such as 'ErMode' should be of type
- // std::string instead, because strings would be more useful for
- // generating reports from this class's data, and mc_enum::str()
- // is not visible across a shared-library boundary. For now, this
- // kludge solves an immediate problem for premium quotes.
- std::string InitErMode;
- std::string InitDBOpt;
-
private:
void Alloc(int len);
void Copy(LedgerInvariant const&);
- [lmi-commits] [lmi] master updated (dfb045a -> ed9a11d), Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master 5f5f3b5 01/16: Move a large comment block outside a function definition, Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master d888936 06/16: Move a comment to a more appropriate place, Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master cbc0ec5 03/16: Sort string members together in declaration order, Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master f7689a2 08/16: Regularize whitespace, Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master 95c2f88 02/16: Declutter, Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master ce9d6b8 04/16: Change compositing for some string members, Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master df9c566 07/16: Sort nonscalable scalar members together in declaration order, Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master a7a9404 05/16: Simplify [348], Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master 359c74c 09/16: Treat 'InitErMode' the same as any other ledger string,
Greg Chicares <=
- [lmi-commits] [lmi] master 255b816 15/16: Mark ledger members dubiously ignored in compositing, Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master ed9a11d 16/16: Address ledger members formerly ignored in compositing, Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master 2e134db 11/16: Add 'InitEeMode' to ledger, Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master bb389e4 10/16: Alphabetize members of enumerative type, Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master 5dfa890 13/16: Reorder and label for greater uniformity, Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master db81cdc 12/16: Correct a guaranteed-premium footnote, Greg Chicares, 2020/04/11
- [lmi-commits] [lmi] master 1f6064d 14/16: Fix index-origin errors in port from XSL-FO, Greg Chicares, 2020/04/11