[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [4892] Refactor
From: |
Greg Chicares |
Subject: |
[lmi-commits] [4892] Refactor |
Date: |
Sun, 02 May 2010 15:20:43 +0000 |
Revision: 4892
http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=4892
Author: chicares
Date: 2010-05-02 15:20:39 +0000 (Sun, 02 May 2010)
Log Message:
-----------
Refactor
Modified Paths:
--------------
lmi/trunk/database.cpp
lmi/trunk/dbdict.hpp
Modified: lmi/trunk/database.cpp
===================================================================
--- lmi/trunk/database.cpp 2010-05-02 03:05:27 UTC (rev 4891)
+++ lmi/trunk/database.cpp 2010-05-02 15:20:39 UTC (rev 4892)
@@ -56,20 +56,12 @@
,UWBasis (a_UWBasis)
,State (a_State)
{
- DBDictionary::instance().Init(Filename);
+// DBDictionary::instance().Init(Filename);
+ DBDictionary::instance().InitAntediluvian();
Init();
- length_ = 100 - IssueAge;
-// TODO ?? This is better...once we implement DB_EndtAge.
-// length_ = static_cast<int>(Query(DB_EndtAge)) - IssueAge;
}
//============================================================================
-// TODO ?? This function is mostly copied and pasted from the production
-// branch's implementation, and duplicates its shortcomings. It would
-// seem better to factor out what's common between the two branches, but
-// eventually the two implementations must be completely merged--and
-// this expedient doesn't make that harder.
-//
TDatabase::TDatabase(yare_input const& input)
:Filename("Irrelevant in antediluvian branch for now")
{
@@ -80,9 +72,9 @@
UWBasis = input.GroupUnderwritingType;
State = input.State;
- DBDictionary::instance().Init(Filename);
+// DBDictionary::instance().Init(Filename);
+ DBDictionary::instance().InitAntediluvian();
Init();
- length_ = 100 - IssueAge;
}
//============================================================================
@@ -118,6 +110,8 @@
Idx.IssueAge () = IssueAge ;
Idx.UWBasis () = UWBasis ;
Idx.State () = State ;
+
+ length_ = static_cast<int>(*GetEntry(DB_EndtAge)[Idx]) - IssueAge;
}
//===========================================================================
Modified: lmi/trunk/dbdict.hpp
===================================================================
--- lmi/trunk/dbdict.hpp 2010-05-02 03:05:27 UTC (rev 4891)
+++ lmi/trunk/dbdict.hpp 2010-05-02 15:20:39 UTC (rev 4892)
@@ -55,6 +55,8 @@
void WriteSampleDBFile();
void WriteProprietaryDBFiles();
+ void InitAntediluvian(); // Antediluvian
+
private:
DBDictionary();
@@ -63,8 +65,6 @@
void BadFile(std::string const& Filename, std::string const& why);
void InitDB();
- void InitAntediluvian(); // Antediluvian
-
static void InvalidateCache();
static std::string CachedFilename;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [4892] Refactor,
Greg Chicares <=