[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master d89a676 22/24: Refactor to avoid a header-onl
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master d89a676 22/24: Refactor to avoid a header-only implementation |
Date: |
Wed, 30 Dec 2020 18:47:02 -0500 (EST) |
branch: master
commit d89a6769c95ee2bc6767c0287671ef6ec1c5d71f
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Refactor to avoid a header-only implementation
Soon the 7702 interest rate will depend on external considerations,
embodied in a set of TUs that may change during development. A
header-only implementation would induce ongoing changes to the
physical design, which are better avoided.
* antediluvian_stubs.cpp: All further changes will be postdiluvian.
It may seem curious that class Irc7702A and its unit test don't depend
on iglp(). The reason is that a table-driven 7702A implementation does
not need to know the interest or mortality rates implicit in the tables
it uses, so this seeming anomaly actually represents an appropriate
separation of concerns.
---
Makefile.am | 3 +++
antediluvian_stubs.cpp | 10 ++++++++++
irc7702_interest.hpp => irc7702_interest.cpp | 13 ++++---------
irc7702_interest.hpp | 15 ++-------------
objects.make | 3 +++
5 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 9180408..bc8185c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -424,6 +424,7 @@ liblmi_la_SOURCES = \
ihs_irc7702a.cpp \
ihs_mortal.cpp \
ihs_server7702.cpp \
+ irc7702_interest.cpp \
irc7702_tables.cpp \
lingo.cpp \
lmi.cpp \
@@ -777,6 +778,7 @@ test_gpt_SOURCES = \
gpt_commutation_functions.cpp \
gpt_test.cpp \
ihs_irc7702.cpp \
+ irc7702_interest.cpp \
miscellany.cpp \
null_stream.cpp \
path_utility.cpp \
@@ -866,6 +868,7 @@ test_irc7702_tables_SOURCES = \
$(common_test_objects) \
commutation_functions.cpp \
cso_table.cpp \
+ irc7702_interest.cpp \
irc7702_tables.cpp \
irc7702_tables_test.cpp
test_irc7702_tables_CXXFLAGS = $(AM_CXXFLAGS)
diff --git a/antediluvian_stubs.cpp b/antediluvian_stubs.cpp
index 236d0c1..cfb5eaa 100644
--- a/antediluvian_stubs.cpp
+++ b/antediluvian_stubs.cpp
@@ -42,6 +42,16 @@ namespace
void authenticate_system()
{}
+double iglp()
+{
+ return 0.04;
+}
+
+double igsp()
+{
+ return 0.02 + iglp();
+}
+
bool is_antediluvian_fork()
{
return true;
diff --git a/irc7702_interest.hpp b/irc7702_interest.cpp
similarity index 84%
copy from irc7702_interest.hpp
copy to irc7702_interest.cpp
index 547b4da..7b00d25 100644
--- a/irc7702_interest.hpp
+++ b/irc7702_interest.cpp
@@ -19,25 +19,20 @@
// email: <gchicares@sbcglobal.net>
// snail: Chicares, 186 Belle Woods Drive, Glastonbury CT 06033, USA
-#ifndef irc7702_interest_hpp
-#define irc7702_interest_hpp
+#include "pchfile.hpp"
-#include "config.hpp"
-
-#include "so_attributes.hpp"
+#include "irc7702_interest.hpp"
/// Statutory interest rate for 7702 and 7702A (except GSP).
-LMI_SO inline double iglp()
+double iglp()
{
return 0.04;
}
/// Statutory interest rate for 7702 (GSP only).
-LMI_SO inline double igsp()
+double igsp()
{
return 0.02 + iglp();
}
-
-#endif // irc7702_interest_hpp
diff --git a/irc7702_interest.hpp b/irc7702_interest.hpp
index 547b4da..cd68ebf 100644
--- a/irc7702_interest.hpp
+++ b/irc7702_interest.hpp
@@ -26,18 +26,7 @@
#include "so_attributes.hpp"
-/// Statutory interest rate for 7702 and 7702A (except GSP).
-
-LMI_SO inline double iglp()
-{
- return 0.04;
-}
-
-/// Statutory interest rate for 7702 (GSP only).
-
-LMI_SO inline double igsp()
-{
- return 0.02 + iglp();
-}
+LMI_SO double iglp();
+LMI_SO double igsp();
#endif // irc7702_interest_hpp
diff --git a/objects.make b/objects.make
index 800c698..9c422de 100644
--- a/objects.make
+++ b/objects.make
@@ -291,6 +291,7 @@ lmi_common_objects := \
ihs_irc7702a.o \
ihs_mortal.o \
ihs_server7702.o \
+ irc7702_interest.o \
irc7702_tables.o \
lingo.o \
lmi.o \
@@ -666,6 +667,7 @@ gpt_test$(EXEEXT): \
gpt_commutation_functions.o \
gpt_test.o \
ihs_irc7702.o \
+ irc7702_interest.o \
miscellany.o \
null_stream.o \
path_utility.o \
@@ -744,6 +746,7 @@ irc7702_tables_test$(EXEEXT): \
$(common_test_objects) \
commutation_functions.o \
cso_table.o \
+ irc7702_interest.o \
irc7702_tables.o \
irc7702_tables_test.o \
- [lmi-commits] [lmi] master 7efa493 05/24: Resolve some marked defects [333], (continued)
- [lmi-commits] [lmi] master 7efa493 05/24: Resolve some marked defects [333], Greg Chicares, 2020/12/30
- [lmi-commits] [lmi] master c9da0f6 07/24: Assert "length" is same in two classes, Greg Chicares, 2020/12/30
- [lmi-commits] [lmi] master ac2e25b 03/24: Expunge an unwanted exception class, Greg Chicares, 2020/12/30
- [lmi-commits] [lmi] master f2efed6 01/24: Guard against accidental Ctrl-D, Greg Chicares, 2020/12/30
- [lmi-commits] [lmi] master bf59b33 06/24: Resolve or demote some more marked defects [326], Greg Chicares, 2020/12/30
- [lmi-commits] [lmi] master 30412af 04/24: Report a range error when a range error is caught [336], Greg Chicares, 2020/12/30
- [lmi-commits] [lmi] master e7c9da0 08/24: Prepare to move a block of code, Greg Chicares, 2020/12/30
- [lmi-commits] [lmi] master 55a3eb0 12/24: Note an apparent defect [327], Greg Chicares, 2020/12/30
- [lmi-commits] [lmi] master 53e98ab 13/24: Fix defect introduced 20100723T2339Z: wrong jurisdiction [326], Greg Chicares, 2020/12/30
- [lmi-commits] [lmi] master e4c790a 18/24: Expunge a defect marker [324], Greg Chicares, 2020/12/30
- [lmi-commits] [lmi] master d89a676 22/24: Refactor to avoid a header-only implementation,
Greg Chicares <=
- [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, 2020/12/30