[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [4904] Rename two classes
From: |
Greg Chicares |
Subject: |
[lmi-commits] [4904] Rename two classes |
Date: |
Wed, 05 May 2010 16:12:33 +0000 |
Revision: 4904
http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=4904
Author: chicares
Date: 2010-05-05 16:12:33 +0000 (Wed, 05 May 2010)
Log Message:
-----------
Rename two classes
Modified Paths:
--------------
lmi/trunk/ChangeLog
lmi/trunk/basic_values.hpp
lmi/trunk/basicvalues.cpp
lmi/trunk/custom_io_0.cpp
lmi/trunk/database.cpp
lmi/trunk/database.hpp
lmi/trunk/database_document.cpp
lmi/trunk/database_document.hpp
lmi/trunk/database_view_editor.cpp
lmi/trunk/database_view_editor.hpp
lmi/trunk/dbdict.cpp
lmi/trunk/dbdict.hpp
lmi/trunk/dbvalue.cpp
lmi/trunk/dbvalue.hpp
lmi/trunk/ihs_basicval.cpp
lmi/trunk/ihs_database.cpp
lmi/trunk/input.hpp
lmi/trunk/input_harmonization.cpp
lmi/trunk/interest_rates.cpp
lmi/trunk/loads.cpp
lmi/trunk/loads.hpp
lmi/trunk/loads_impl.hpp
lmi/trunk/loads_test.cpp
lmi/trunk/mec_input.cpp
lmi/trunk/mec_input.hpp
lmi/trunk/mec_server.cpp
lmi/trunk/my_db.cpp
lmi/trunk/surrchg_rates.cpp
lmi/trunk/surrchg_rates.hpp
Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/ChangeLog 2010-05-05 16:12:33 UTC (rev 4904)
@@ -25396,3 +25396,36 @@
dbdict.hpp
Replace a weird with a canonical idiom.
+20100505T1612Z <address@hidden> [718]
+
+ basic_values.hpp
+ basicvalues.cpp
+ custom_io_0.cpp
+ database.cpp
+ database.hpp
+ database_document.cpp
+ database_document.hpp
+ database_view.cpp
+ database_view_editor.cpp
+ database_view_editor.hpp
+ dbdict.cpp
+ dbdict.hpp
+ dbvalue.cpp
+ dbvalue.hpp
+ ihs_basicval.cpp
+ ihs_database.cpp
+ input.hpp
+ input_harmonization.cpp
+ interest_rates.cpp
+ loads.cpp
+ loads.hpp
+ loads_impl.hpp
+ loads_test.cpp
+ mec_input.cpp
+ mec_input.hpp
+ mec_server.cpp
+ my_db.cpp
+ surrchg_rates.cpp
+ surrchg_rates.hpp
+Rename two classes.
+
Modified: lmi/trunk/basic_values.hpp
===================================================================
--- lmi/trunk/basic_values.hpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/basic_values.hpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -58,10 +58,10 @@
class Loads;
class MortalityRates;
class SurrChgRates;
-class TDatabase;
class death_benefits;
class modal_outlay;
class product_data;
+class product_database;
class rounding_rules;
class stratified_charges;
@@ -117,7 +117,7 @@
boost::shared_ptr<Input const> Input_;
yare_input yare_input_;
boost::shared_ptr<product_data> ProductData_;
- boost::shared_ptr<TDatabase> Database_;
+ boost::shared_ptr<product_database> Database_;
boost::shared_ptr<FundData> FundData_;
boost::shared_ptr<rounding_rules> RoundingRules_;
boost::shared_ptr<stratified_charges> StratifiedCharges_;
@@ -518,7 +518,7 @@
}
double lowest_premium_tax_load
- (TDatabase const& db
+ (product_database const& db
,stratified_charges const& stratified
,mcenum_state state_of_jurisdiction
,bool amortize_premium_load
Modified: lmi/trunk/basicvalues.cpp
===================================================================
--- lmi/trunk/basicvalues.cpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/basicvalues.cpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -97,7 +97,7 @@
LMI_ASSERT(IssueAge <= RetAge);
Database_.reset
- (new TDatabase
+ (new product_database
("empty for now" // filename
,yare_input_.Gender
,yare_input_.UnderwritingClass
Modified: lmi/trunk/custom_io_0.cpp
===================================================================
--- lmi/trunk/custom_io_0.cpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/custom_io_0.cpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -412,7 +412,7 @@
z["UseCurrentDeclaredRate"] = "No";
yare_input const yip(z);
- TDatabase database(yip);
+ product_database database(yip);
double first_year_general_account_rate =
0.01
Modified: lmi/trunk/database.cpp
===================================================================
--- lmi/trunk/database.cpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/database.cpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -38,7 +38,7 @@
#include <ostream>
//============================================================================
-TDatabase::TDatabase
+product_database::product_database
(std::string const& a_ProductName
,mcenum_gender a_Gender
,mcenum_class a_Class
@@ -62,7 +62,7 @@
}
//============================================================================
-TDatabase::TDatabase(yare_input const& input)
+product_database::product_database(yare_input const& input)
:Filename("Irrelevant in antediluvian branch for now")
{
Gender = input.Gender;
@@ -78,40 +78,40 @@
}
//============================================================================
-TDatabase::~TDatabase()
+product_database::~product_database()
{
}
//============================================================================
-mcenum_state TDatabase::GetStateOfJurisdiction() const
+mcenum_state product_database::GetStateOfJurisdiction() const
{
return State;
}
//============================================================================
-int TDatabase::length() const
+int product_database::length() const
{
return length_;
}
//============================================================================
-void TDatabase::Init()
+void product_database::Init()
{
index_ = database_index(Gender, Class, Smoker, IssueAge, UWBasis, State);
length_ = static_cast<int>(*GetEntry(DB_EndtAge)[index_]) - IssueAge;
}
//===========================================================================
-double TDatabase::Query(int k) const
+double product_database::Query(int k) const
{
ConstrainScalar(k); // TODO ?? Is the extra overhead acceptable?
return *GetEntry(k)[index_];
}
//===========================================================================
-void TDatabase::Query(std::vector<double>& dst, int k) const
+void product_database::Query(std::vector<double>& dst, int k) const
{
- TDBValue const& v = GetEntry(k);
+ database_entity const& v = GetEntry(k);
double const*const z = v[index_];
dst.resize(length_);
if(1 == v.GetNDims())
@@ -133,7 +133,7 @@
}
//===========================================================================
-TDBValue const& TDatabase::GetEntry(int k) const
+database_entity const& product_database::GetEntry(int k) const
{
dict_map const& d = DBDictionary::instance().GetDictionary();
dict_map::const_iterator i = d.find(k);
@@ -163,7 +163,7 @@
/// invariant by duration. The database item may nonetheless vary
/// across any axis except duration.
-void TDatabase::ConstrainScalar(int k) const
+void product_database::ConstrainScalar(int k) const
{
std::vector<double> z;
Query(z, k);
Modified: lmi/trunk/database.hpp
===================================================================
--- lmi/trunk/database.hpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/database.hpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -38,15 +38,15 @@
// Database of product parameters
-class TDBValue;
+class database_entity;
class yare_input;
-class LMI_SO TDatabase
+class LMI_SO product_database
:private boost::noncopyable
- ,virtual private obstruct_slicing<TDatabase>
+ ,virtual private obstruct_slicing<product_database>
{
public:
- TDatabase
+ product_database
(std::string const& a_ProductName
,mcenum_gender a_Gender
,mcenum_class a_Class
@@ -55,10 +55,10 @@
,mcenum_uw_basis a_UWBasis
,mcenum_state a_State
);
- explicit TDatabase(yare_input const&);
+ explicit product_database(yare_input const&);
// Ctor for unit-testing support.
- explicit TDatabase(int length);
- ~TDatabase();
+ explicit product_database(int length);
+ ~product_database();
mcenum_state GetStateOfJurisdiction() const;
int length() const;
@@ -74,10 +74,10 @@
void ConstrainScalar(int k) const;
- TDBValue const& GetEntry(int k) const;
+ database_entity const& GetEntry(int k) const;
private:
- TDatabase();
+ product_database();
void Init();
void Init(std::string const& NewFilename);
Modified: lmi/trunk/database_document.cpp
===================================================================
--- lmi/trunk/database_document.cpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/database_document.cpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -90,7 +90,7 @@
{
}
-TDBValue& DatabaseDocument::GetTDBValue(DatabaseNames index)
+database_entity& DatabaseDocument::GetTDBValue(DatabaseNames index)
{
if(dict_.find(index) == dict_.end())
{
Modified: lmi/trunk/database_document.hpp
===================================================================
--- lmi/trunk/database_document.hpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/database_document.hpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -31,7 +31,7 @@
#include "dbdict.hpp"
#include "dbnames.hpp"
-class LMI_SO TDBValue;
+class LMI_SO database_entity;
class DatabaseDocument
:public ProductEditorDocument
@@ -40,7 +40,7 @@
DatabaseDocument();
virtual ~DatabaseDocument();
- TDBValue& GetTDBValue(DatabaseNames index);
+ database_entity& GetTDBValue(DatabaseNames index);
private:
// ProductEditorDocument overrides.
Modified: lmi/trunk/database_view_editor.cpp
===================================================================
--- lmi/trunk/database_view_editor.cpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/database_view_editor.cpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -95,7 +95,7 @@
:public AdjustableMaxBoundAxis<int>
{
typedef AdjustableMaxBoundAxis<int> BaseClass;
- static const int max_bound_duration = TDBValue::e_max_dim_duration - 1;
+ static const int max_bound_duration = database_entity::e_max_dim_duration
- 1;
public:
DatabaseDurationAxis()
@@ -103,7 +103,7 @@
{}
};
-DatabaseTableAdapter::DatabaseTableAdapter(TDBValue* db_value)
+DatabaseTableAdapter::DatabaseTableAdapter(database_entity* db_value)
:db_value_(db_value)
,modified_(false)
{
@@ -211,7 +211,7 @@
std::vector<int> axis_lengths = db_value_->GetAxisLengths();
- axis_lengths[n] = varies ? TDBValue::maximum_dimensions()[n] : 1;
+ axis_lengths[n] = varies ? database_entity::maximum_dimensions()[n] : 1;
ReshapeTableData(axis_lengths, varies);
}
Modified: lmi/trunk/database_view_editor.hpp
===================================================================
--- lmi/trunk/database_view_editor.hpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/database_view_editor.hpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -44,12 +44,12 @@
#include <string>
-/// Database dictionary adapter for TDBValue class
+/// Database dictionary adapter for database_entity class
///
/// One could mention Adaptor pattern.
-/// It does not really owns the TDBValue instance which is passed to it.
+/// It does not really owns the database_entity instance which is passed to it.
/// The boost::shared_ptr does.
-/// Regarding the fact that all the instances of TDBValue are reside
+/// Regarding the fact that all the instances of database_entity are reside
/// in the dict_map object and owned by it, one could pass entity via
/// boost::shared_ptr constructed with deallocator object that does nothing.
@@ -69,16 +69,16 @@
BOOST_STATIC_ASSERT
(
static_cast<int>(DatabaseTableAdapter::eda_max)
- == static_cast<int>(TDBValue::e_number_of_axes)
+ == static_cast<int>(database_entity::e_number_of_axes)
);
public:
- DatabaseTableAdapter(TDBValue* db_value = NULL);
+ DatabaseTableAdapter(database_entity* db_value = NULL);
virtual ~DatabaseTableAdapter();
/// Decorated object accessors
- TDBValue* GetTDBValue() const;
- void SetTDBValue(TDBValue* db_value);
+ database_entity* GetTDBValue() const;
+ void SetTDBValue(database_entity* db_value);
/// Return true if the object data is modified since the last save
bool IsModified() const;
@@ -114,7 +114,7 @@
);
/// Pointer to decorated object
- TDBValue* db_value_;
+ database_entity* db_value_;
/// Modification flag (dirty flag)
bool modified_;
@@ -125,12 +125,12 @@
DECLARE_NO_COPY_CLASS(DatabaseTableAdapter)
};
-inline TDBValue* DatabaseTableAdapter::GetTDBValue() const
+inline database_entity* DatabaseTableAdapter::GetTDBValue() const
{
return db_value_;
}
-inline void DatabaseTableAdapter::SetTDBValue(TDBValue* db_value)
+inline void DatabaseTableAdapter::SetTDBValue(database_entity* db_value)
{
db_value_ = db_value;
}
Modified: lmi/trunk/dbdict.cpp
===================================================================
--- lmi/trunk/dbdict.cpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/dbdict.cpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -69,16 +69,16 @@
namespace xml_serialize
{
-template<> struct xml_io<TDBValue>
+template<> struct xml_io<database_entity>
{
- typedef TDBValue T;
+ typedef database_entity T;
static void to_xml(xml::element& e, T const& t) {t.write(e);}
static void from_xml(xml::element const& e, T& t) {t.read (e);}
};
/// Specialize xml_io<> for dict_map rather than coding a generic
/// xml_io<std::map>, because the key would be stored redundantly:
-/// it's already part of TDBValue.
+/// it's already part of class database_entity.
template<> struct xml_io<dict_map>
{
@@ -103,7 +103,7 @@
typedef xml::const_nodes_view::const_iterator cnvi;
for(cnvi i = items.begin(); i != items.end(); ++i)
{
- TDBValue z;
+ database_entity z;
xml_serialize::from_xml(*i, z);
t[z.GetKey()] = z;
}
@@ -218,7 +218,7 @@
/// Add an entry to the dictionary.
-void DBDictionary::Add(TDBValue const& e)
+void DBDictionary::Add(database_entity const& e)
{
dictionary_[e.GetKey()] = e;
}
@@ -232,32 +232,32 @@
dictionary_.clear();
for(int j = DB_FIRST; j < DB_LAST; ++j)
{
- Add(TDBValue(j, 0.0));
+ Add(database_entity(j, 0.0));
}
// It would be dangerous to set these to zero.
- Add(TDBValue(DB_CCOIMultiplier , 1.0));
- Add(TDBValue(DB_GCOIMultiplier , 1.0));
- Add(TDBValue(DB_SubstdTblMult , 1.0));
- Add(TDBValue(DB_SurrChgSADurFactor , 1.0));
- Add(TDBValue(DB_SurrChgAVDurFactor , 1.0));
+ Add(database_entity(DB_CCOIMultiplier , 1.0));
+ Add(database_entity(DB_GCOIMultiplier , 1.0));
+ Add(database_entity(DB_SubstdTblMult , 1.0));
+ Add(database_entity(DB_SurrChgSADurFactor , 1.0));
+ Add(database_entity(DB_SurrChgAVDurFactor , 1.0));
// Usually the maximum is a reciprocal, e.g., 1/11 or 1/12; for
// greatest precision, store the reciprocal of that reciprocal,
// e.g., 11 or 12.
- Add(TDBValue(DB_MaxMonthlyCoiRate , 12.0));
+ Add(database_entity(DB_MaxMonthlyCoiRate , 12.0));
- Add(TDBValue(DB_GuarIntSpread , bignum));
+ Add(database_entity(DB_GuarIntSpread , bignum));
- Add(TDBValue(DB_CurrCOITable0Limit , bignum));
- Add(TDBValue(DB_CurrCOITable1 , 999));
- Add(TDBValue(DB_CurrCOITable1Limit , bignum));
- Add(TDBValue(DB_CurrCOITable2 , 999));
+ Add(database_entity(DB_CurrCOITable0Limit , bignum));
+ Add(database_entity(DB_CurrCOITable1 , 999));
+ Add(database_entity(DB_CurrCOITable1Limit , bignum));
+ Add(database_entity(DB_CurrCOITable2 , 999));
- Add(TDBValue(DB_SpecAmtLoadLimit , bignum));
- Add(TDBValue(DB_DynSepAcctLoadLimit , bignum));
- Add(TDBValue(DB_ADDLimit , bignum));
- Add(TDBValue(DB_ExpPerKLimit , bignum));
+ Add(database_entity(DB_SpecAmtLoadLimit , bignum));
+ Add(database_entity(DB_DynSepAcctLoadLimit , bignum));
+ Add(database_entity(DB_ADDLimit , bignum));
+ Add(database_entity(DB_ExpPerKLimit , bignum));
// SD Chapter 260 (HB 1200), signed 2008-02-19, amended 58-6-70
// by removing the former million-dollar threshold.
@@ -265,7 +265,7 @@
// TODO ?? For now, only the threshold here is changed. Much
// complex code elsewhere can be removed when time permits.
- int premium_tax_dimensions[TDBValue::e_number_of_axes] = {1, 1, 1, 1, 1,
53, 1};
+ int premium_tax_dimensions[database_entity::e_number_of_axes] = {1, 1, 1,
1, 1, 53, 1};
double premium_tax_retaliation_threshold[53] =
{
// AL AK AZ AR CA CO CT
@@ -286,9 +286,9 @@
bignum, bignum, bignum, bignum, bignum, bignum, 0.0 ,
};
Add
- (TDBValue
+ (database_entity
(DB_PremTaxRetalLimit
- ,TDBValue::e_number_of_axes
+ ,database_entity::e_number_of_axes
,premium_tax_dimensions
,premium_tax_retaliation_threshold
)
@@ -299,62 +299,62 @@
void DBDictionary::WriteSampleDBFile()
{
InitDB();
- Add(TDBValue(DB_GuarPolFee , 8.00));
- Add(TDBValue(DB_GuarSpecAmtLoad , 0.0));
- Add(TDBValue(DB_GuarIssueFee , 0.0));
- Add(TDBValue(DB_GuarFundAdminChg , 0.0));
- Add(TDBValue(DB_GuarPremLoadTgt , 0.07));
- Add(TDBValue(DB_GuarPremLoadExc , 0.04));
- Add(TDBValue(DB_GuarPremLoadTgtRfd , 0.00));
- Add(TDBValue(DB_GuarPremLoadExcRfd , 0.00));
- Add(TDBValue(DB_GuarAcctValLoadAMD , 0.0));
- Add(TDBValue(DB_CurrPolFee , 5.00));
- Add(TDBValue(DB_CurrSpecAmtLoad , 0.0));
- Add(TDBValue(DB_CurrIssueFee , 0.0));
- Add(TDBValue(DB_CurrFundAdminChg , 0.0));
- Add(TDBValue(DB_CurrPremLoadTgt , 0.05));
- Add(TDBValue(DB_CurrPremLoadExc , 0.02));
- Add(TDBValue(DB_CurrPremLoadTgtRfd , 0.00));
- Add(TDBValue(DB_CurrPremLoadExcRfd , 0.00));
- Add(TDBValue(DB_CurrAcctValLoadAMD , 0.0));
- Add(TDBValue(DB_DACTaxPremLoad , 0.01));
- Add(TDBValue(DB_FundCharge , 0.0));
- Add(TDBValue(DB_PremTaxFundCharge , 0.0));
- Add(TDBValue(DB_DACTaxFundCharge , 0.0));
- Add(TDBValue(DB_WaivePmTxInt1035 , true));
- Add(TDBValue(DB_FirstWDYear , 0.0));
- Add(TDBValue(DB_MaxWDAVMult , 1.0));
- Add(TDBValue(DB_MaxWDDed , mce_to_next_anniversary));
- Add(TDBValue(DB_MinWD , 100.0));
- Add(TDBValue(DB_WDFee , 25.0));
- Add(TDBValue(DB_WDFeeRate , 0.02));
- Add(TDBValue(DB_WDCanDecrSADBO1 , true));
- Add(TDBValue(DB_WDCanDecrSADBO2 , true));
- Add(TDBValue(DB_WDCanDecrSADBO3 , true));
- Add(TDBValue(DB_FirstLoanYear , 0.0));
- Add(TDBValue(DB_AllowPrefLoan , false));
- Add(TDBValue(DB_AllowFixedLoan , true));
- Add(TDBValue(DB_FixedLoanRate , 0.06));
- Add(TDBValue(DB_AllowVLR , true));
- Add(TDBValue(DB_MaxLoanAVMult , 1.0));
- Add(TDBValue(DB_MaxLoanDed , mce_to_next_anniversary));
- Add(TDBValue(DB_GuarPrefLoanSpread , 0.0));
- Add(TDBValue(DB_GuarRegLoanSpread , 0.04));
- Add(TDBValue(DB_CurrPrefLoanSpread , 0.0));
- Add(TDBValue(DB_CurrRegLoanSpread , 0.02));
- Add(TDBValue(DB_GuarInt , 0.03));
- Add(TDBValue(DB_NAARDiscount , 0.00246627));
- Add(TDBValue(DB_GuarIntSpread , 0.03));
- Add(TDBValue(DB_GuarMandE , 0.009));
- Add(TDBValue(DB_CurrIntSpread , 0.01));
- Add(TDBValue(DB_CurrMandE , 0.009));
- Add(TDBValue(DB_BonusInt , 0.0));
- Add(TDBValue(DB_IntFloor , 0.0));
- Add(TDBValue(DB_SepAcctSpreadMethod , mce_spread_is_effective_annual));
- Add(TDBValue(DB_DynamicMandE , false));
+ Add(database_entity(DB_GuarPolFee , 8.00));
+ Add(database_entity(DB_GuarSpecAmtLoad , 0.0));
+ Add(database_entity(DB_GuarIssueFee , 0.0));
+ Add(database_entity(DB_GuarFundAdminChg , 0.0));
+ Add(database_entity(DB_GuarPremLoadTgt , 0.07));
+ Add(database_entity(DB_GuarPremLoadExc , 0.04));
+ Add(database_entity(DB_GuarPremLoadTgtRfd , 0.00));
+ Add(database_entity(DB_GuarPremLoadExcRfd , 0.00));
+ Add(database_entity(DB_GuarAcctValLoadAMD , 0.0));
+ Add(database_entity(DB_CurrPolFee , 5.00));
+ Add(database_entity(DB_CurrSpecAmtLoad , 0.0));
+ Add(database_entity(DB_CurrIssueFee , 0.0));
+ Add(database_entity(DB_CurrFundAdminChg , 0.0));
+ Add(database_entity(DB_CurrPremLoadTgt , 0.05));
+ Add(database_entity(DB_CurrPremLoadExc , 0.02));
+ Add(database_entity(DB_CurrPremLoadTgtRfd , 0.00));
+ Add(database_entity(DB_CurrPremLoadExcRfd , 0.00));
+ Add(database_entity(DB_CurrAcctValLoadAMD , 0.0));
+ Add(database_entity(DB_DACTaxPremLoad , 0.01));
+ Add(database_entity(DB_FundCharge , 0.0));
+ Add(database_entity(DB_PremTaxFundCharge , 0.0));
+ Add(database_entity(DB_DACTaxFundCharge , 0.0));
+ Add(database_entity(DB_WaivePmTxInt1035 , true));
+ Add(database_entity(DB_FirstWDYear , 0.0));
+ Add(database_entity(DB_MaxWDAVMult , 1.0));
+ Add(database_entity(DB_MaxWDDed , mce_to_next_anniversary));
+ Add(database_entity(DB_MinWD , 100.0));
+ Add(database_entity(DB_WDFee , 25.0));
+ Add(database_entity(DB_WDFeeRate , 0.02));
+ Add(database_entity(DB_WDCanDecrSADBO1 , true));
+ Add(database_entity(DB_WDCanDecrSADBO2 , true));
+ Add(database_entity(DB_WDCanDecrSADBO3 , true));
+ Add(database_entity(DB_FirstLoanYear , 0.0));
+ Add(database_entity(DB_AllowPrefLoan , false));
+ Add(database_entity(DB_AllowFixedLoan , true));
+ Add(database_entity(DB_FixedLoanRate , 0.06));
+ Add(database_entity(DB_AllowVLR , true));
+ Add(database_entity(DB_MaxLoanAVMult , 1.0));
+ Add(database_entity(DB_MaxLoanDed , mce_to_next_anniversary));
+ Add(database_entity(DB_GuarPrefLoanSpread , 0.0));
+ Add(database_entity(DB_GuarRegLoanSpread , 0.04));
+ Add(database_entity(DB_CurrPrefLoanSpread , 0.0));
+ Add(database_entity(DB_CurrRegLoanSpread , 0.02));
+ Add(database_entity(DB_GuarInt , 0.03));
+ Add(database_entity(DB_NAARDiscount , 0.00246627));
+ Add(database_entity(DB_GuarIntSpread , 0.03));
+ Add(database_entity(DB_GuarMandE , 0.009));
+ Add(database_entity(DB_CurrIntSpread , 0.01));
+ Add(database_entity(DB_CurrMandE , 0.009));
+ Add(database_entity(DB_BonusInt , 0.0));
+ Add(database_entity(DB_IntFloor , 0.0));
+ Add(database_entity(DB_SepAcctSpreadMethod ,
mce_spread_is_effective_annual));
+ Add(database_entity(DB_DynamicMandE , false));
// gender, smoker
- int dims313[TDBValue::e_number_of_axes] = {3, 1, 3, 1, 1, 1, 1};
+ int dims313[database_entity::e_number_of_axes] = {3, 1, 3, 1, 1, 1, 1};
// US 1980 CSO age last; unisex = table D.
// Male uses table E, which is correct, as opposed to table F,
@@ -368,10 +368,10 @@
// For now at least, just use (a multiple of) guaranteed COI rates
// as current.
- Add(TDBValue(DB_CurrCOITable, TDBValue::e_number_of_axes, dims313, TgCOI));
- Add(TDBValue(DB_GuarCOITable, TDBValue::e_number_of_axes, dims313, TgCOI));
+ Add(database_entity(DB_CurrCOITable, database_entity::e_number_of_axes,
dims313, TgCOI));
+ Add(database_entity(DB_GuarCOITable, database_entity::e_number_of_axes,
dims313, TgCOI));
- Add(TDBValue(DB_COINYMinTable , 0.0));
+ Add(database_entity(DB_COINYMinTable , 0.0));
double coimult[9] =
{
@@ -379,53 +379,53 @@
0.60, 0.50, 0.55, // male: sm ns us
0.50, 0.40, 0.45, // unisex: sm ns us
};
- Add(TDBValue(DB_CCOIMultiplier, TDBValue::e_number_of_axes, dims313,
coimult));
+ Add(database_entity(DB_CCOIMultiplier, database_entity::e_number_of_axes,
dims313, coimult));
- Add(TDBValue(DB_UseNYCOIFloor , 0.0));
- Add(TDBValue(DB_GuarCOICeiling , 0.0));
- Add(TDBValue(DB_COIGuarIsMin , 0.0));
- Add(TDBValue(DB_COINonforfIsGuar , 0.0));
- Add(TDBValue(DB_CCoiIsAnnual , true));
- Add(TDBValue(DB_GCoiIsAnnual , true));
- Add(TDBValue(DB_MCoiIsAnnual , true));
- Add(TDBValue(DB_AgeLastOrNearest , 0, "0 = ALB")); // ALB
- Add(TDBValue(DB_AllowRetirees , true));
- Add(TDBValue(DB_MinSpecAmt , 100000.0));
- Add(TDBValue(DB_AllowSubstdTable , true));
- Add(TDBValue(DB_AllowFlatExtras , true));
- Add(TDBValue(DB_MinIssAge , 15));
- Add(TDBValue(DB_MaxIssAge , 70));
- Add(TDBValue(DB_MinIssSpecAmt , 0.0));
- Add(TDBValue(DB_MaxIssSpecAmt , 0.0));
- Add(TDBValue(DB_MinRenlBaseSpecAmt , 50000.0));
- Add(TDBValue(DB_MinRenlSpecAmt , 50000.0));
- Add(TDBValue(DB_MaxRenlSpecAmt , 0.0));
- Add(TDBValue(DB_MinSpecAmtIncr , 0.0));
- Add(TDBValue(DB_MaxIncrAge , 99));
- Add(TDBValue(DB_MinPmt , 0.0));
- Add(TDBValue(DB_SmokeOrTobacco , oe_tobacco_nontobacco));
- Add(TDBValue(DB_AllowUnisex , true));
- Add(TDBValue(DB_AllowSexDistinct , true));
- Add(TDBValue(DB_AllowUnismoke , true));
- Add(TDBValue(DB_AllowSmokeDistinct , true));
- Add(TDBValue(DB_AllowFullUW , true));
- Add(TDBValue(DB_AllowSimpUW , true));
- Add(TDBValue(DB_AllowGuarUW , true));
- Add(TDBValue(DB_AllowMortBlendSex , true));
- Add(TDBValue(DB_AllowMortBlendSmoke , true));
- Add(TDBValue(DB_AllowRatedWP , true));
- Add(TDBValue(DB_AllowRatedADD , true));
- Add(TDBValue(DB_AllowRatedTerm , true));
- Add(TDBValue(DB_Allowable , true));
- Add(TDBValue(DB_AllowPreferredClass , true));
- Add(TDBValue(DB_AllowCVAT , true));
- Add(TDBValue(DB_AllowGPT , true));
+ Add(database_entity(DB_UseNYCOIFloor , 0.0));
+ Add(database_entity(DB_GuarCOICeiling , 0.0));
+ Add(database_entity(DB_COIGuarIsMin , 0.0));
+ Add(database_entity(DB_COINonforfIsGuar , 0.0));
+ Add(database_entity(DB_CCoiIsAnnual , true));
+ Add(database_entity(DB_GCoiIsAnnual , true));
+ Add(database_entity(DB_MCoiIsAnnual , true));
+ Add(database_entity(DB_AgeLastOrNearest , 0, "0 = ALB")); // ALB
+ Add(database_entity(DB_AllowRetirees , true));
+ Add(database_entity(DB_MinSpecAmt , 100000.0));
+ Add(database_entity(DB_AllowSubstdTable , true));
+ Add(database_entity(DB_AllowFlatExtras , true));
+ Add(database_entity(DB_MinIssAge , 15));
+ Add(database_entity(DB_MaxIssAge , 70));
+ Add(database_entity(DB_MinIssSpecAmt , 0.0));
+ Add(database_entity(DB_MaxIssSpecAmt , 0.0));
+ Add(database_entity(DB_MinRenlBaseSpecAmt , 50000.0));
+ Add(database_entity(DB_MinRenlSpecAmt , 50000.0));
+ Add(database_entity(DB_MaxRenlSpecAmt , 0.0));
+ Add(database_entity(DB_MinSpecAmtIncr , 0.0));
+ Add(database_entity(DB_MaxIncrAge , 99));
+ Add(database_entity(DB_MinPmt , 0.0));
+ Add(database_entity(DB_SmokeOrTobacco , oe_tobacco_nontobacco));
+ Add(database_entity(DB_AllowUnisex , true));
+ Add(database_entity(DB_AllowSexDistinct , true));
+ Add(database_entity(DB_AllowUnismoke , true));
+ Add(database_entity(DB_AllowSmokeDistinct , true));
+ Add(database_entity(DB_AllowFullUW , true));
+ Add(database_entity(DB_AllowSimpUW , true));
+ Add(database_entity(DB_AllowGuarUW , true));
+ Add(database_entity(DB_AllowMortBlendSex , true));
+ Add(database_entity(DB_AllowMortBlendSmoke , true));
+ Add(database_entity(DB_AllowRatedWP , true));
+ Add(database_entity(DB_AllowRatedADD , true));
+ Add(database_entity(DB_AllowRatedTerm , true));
+ Add(database_entity(DB_Allowable , true));
+ Add(database_entity(DB_AllowPreferredClass , true));
+ Add(database_entity(DB_AllowCVAT , true));
+ Add(database_entity(DB_AllowGPT , true));
// This is just a sample product, so we make do with plausible
// all-male seven-pay premiums, and use GPT corridor factors for
// CVAT.
- Add(TDBValue(DB_CorridorTable , 7));
- Add(TDBValue(DB_TAMRA7PayTable , 10));
+ Add(database_entity(DB_CorridorTable , 7));
+ Add(database_entity(DB_TAMRA7PayTable , 10));
// Following IRS Notice 88-128, use only the male and female
// tables with no smoker distinction, and a unisex table where
@@ -434,25 +434,25 @@
// US 1980 CSO age last, not smoker distinct. Unisex = table D.
// Male uses table E, which is correct, as opposed to table F,
// which contains a numerical error but was adopted by NAIC.
- int dims311[TDBValue::e_number_of_axes] = {3, 1, 1, 1, 1, 1, 1}; // gender
+ int dims311[database_entity::e_number_of_axes] = {3, 1, 1, 1, 1, 1, 1}; //
gender
double T7702q[9] = {35, 41, 107,}; // Female, male, unisex.
- Add(TDBValue(DB_IRC7702QTable, TDBValue::e_number_of_axes, dims311,
T7702q));
+ Add(database_entity(DB_IRC7702QTable, database_entity::e_number_of_axes,
dims311, T7702q));
- Add(TDBValue(DB_PremLoad7702 , 0.02));
- Add(TDBValue(DB_AllowDBO1 , true));
- Add(TDBValue(DB_AllowDBO2 , true));
- Add(TDBValue(DB_AllowDBO3 , true));
- Add(TDBValue(DB_OptChgCanIncrSA , true));
- Add(TDBValue(DB_OptChgCanDecrSA , true));
- Add(TDBValue(DB_NonforfQTable , 0.0));
- Add(TDBValue(DB_SurrChgByFormula , 0.0));
- Add(TDBValue(DB_SurrChgPeriod , 0.0));
- Add(TDBValue(DB_SurrChgZeroDur , 0.0));
- Add(TDBValue(DB_SurrChgNLPMult , 0.0));
- Add(TDBValue(DB_SurrChgNLPMax , 0.0));
- Add(TDBValue(DB_SurrChgEAMax , 0.0));
- Add(TDBValue(DB_SurrChgPremMult , 0.0));
- Add(TDBValue(DB_SurrChgIsMly , 0.0));
+ Add(database_entity(DB_PremLoad7702 , 0.02));
+ Add(database_entity(DB_AllowDBO1 , true));
+ Add(database_entity(DB_AllowDBO2 , true));
+ Add(database_entity(DB_AllowDBO3 , true));
+ Add(database_entity(DB_OptChgCanIncrSA , true));
+ Add(database_entity(DB_OptChgCanDecrSA , true));
+ Add(database_entity(DB_NonforfQTable , 0.0));
+ Add(database_entity(DB_SurrChgByFormula , 0.0));
+ Add(database_entity(DB_SurrChgPeriod , 0.0));
+ Add(database_entity(DB_SurrChgZeroDur , 0.0));
+ Add(database_entity(DB_SurrChgNLPMult , 0.0));
+ Add(database_entity(DB_SurrChgNLPMax , 0.0));
+ Add(database_entity(DB_SurrChgEAMax , 0.0));
+ Add(database_entity(DB_SurrChgPremMult , 0.0));
+ Add(database_entity(DB_SurrChgIsMly , 0.0));
// These aren't actual premium tax rates. Actual rates change
// often, and depend on the insurer's domicile because of
@@ -464,7 +464,7 @@
// be used where no premium tax applies, as for offshore business.
// DE has a tiered premium tax that this program cannot yet
// handle, so we punt and use two percent in DE.
- int premium_tax_dimensions[TDBValue::e_number_of_axes] = {1, 1, 1, 1, 1,
53, 1};
+ int premium_tax_dimensions[database_entity::e_number_of_axes] = {1, 1, 1,
1, 1, 53, 1};
double const tiered = 0.0;
double premium_tax_rates[53] =
{
@@ -486,91 +486,91 @@
0.0200, 0.0200, 0.0200, 0.0200, 0.0200, 0.0200, 0.0000,
};
Add
- (TDBValue
+ (database_entity
(DB_PremTaxRate
- ,TDBValue::e_number_of_axes
+ ,database_entity::e_number_of_axes
,premium_tax_dimensions
,premium_tax_rates
)
);
- Add(TDBValue(DB_PremTaxState , oe_ee_state));
- Add(TDBValue(DB_EndtAge , 100));
- Add(TDBValue(DB_AllowExtEndt , true));
- Add(TDBValue(DB_AllowGenAcct , true));
- Add(TDBValue(DB_AllowSepAcct , true));
- Add(TDBValue(DB_MinPremType , oe_monthly_deduction));
- Add(TDBValue(DB_TgtPremType , oe_modal_nonmec));
- Add(TDBValue(DB_TgtPmFixedAtIssue , false));
- Add(TDBValue(DB_TgtPmIgnoreSubstd , true));
- Add(TDBValue(DB_NoLapseMinDur , 0.0));
- Add(TDBValue(DB_NoLapseMinAge , 0.0));
- Add(TDBValue(DB_NoLapseUnratedOnly , false));
- Add(TDBValue(DB_NoLapseOpt1Only , false));
- Add(TDBValue(DB_PremRefund , 0.0));
+ Add(database_entity(DB_PremTaxState , oe_ee_state));
+ Add(database_entity(DB_EndtAge , 100));
+ Add(database_entity(DB_AllowExtEndt , true));
+ Add(database_entity(DB_AllowGenAcct , true));
+ Add(database_entity(DB_AllowSepAcct , true));
+ Add(database_entity(DB_MinPremType , oe_monthly_deduction));
+ Add(database_entity(DB_TgtPremType , oe_modal_nonmec));
+ Add(database_entity(DB_TgtPmFixedAtIssue , false));
+ Add(database_entity(DB_TgtPmIgnoreSubstd , true));
+ Add(database_entity(DB_NoLapseMinDur , 0.0));
+ Add(database_entity(DB_NoLapseMinAge , 0.0));
+ Add(database_entity(DB_NoLapseUnratedOnly , false));
+ Add(database_entity(DB_NoLapseOpt1Only , false));
+ Add(database_entity(DB_PremRefund , 0.0));
// Reuse current COI rates as current and guaranteed term rates.
- Add(TDBValue(DB_TermTable, TDBValue::e_number_of_axes, dims313, TgCOI));
- Add(TDBValue(DB_GuarTermTable, TDBValue::e_number_of_axes, dims313,
TgCOI));
- Add(TDBValue(DB_AllowTerm , true));
- Add(TDBValue(DB_TermMinIssAge , 0.0));
- Add(TDBValue(DB_TermMaxIssAge , 0.0));
- Add(TDBValue(DB_TermForcedConvAge , 0.0));
- Add(TDBValue(DB_MaxTermProportion , 0.0));
- Add(TDBValue(DB_TermCOIRate , 0.0));
- Add(TDBValue(DB_TermPremRate , 0.0));
- Add(TDBValue(DB_WPTable , 8));
- Add(TDBValue(DB_AllowWP , true));
- Add(TDBValue(DB_WPMinIssAge , 0.0));
- Add(TDBValue(DB_WPMaxIssAge , 0.0));
- Add(TDBValue(DB_WPMax , 0.0));
- Add(TDBValue(DB_WPCOIRate , 0.0));
- Add(TDBValue(DB_WPPremRate , 0.0));
+ Add(database_entity(DB_TermTable, database_entity::e_number_of_axes,
dims313, TgCOI));
+ Add(database_entity(DB_GuarTermTable, database_entity::e_number_of_axes,
dims313, TgCOI));
+ Add(database_entity(DB_AllowTerm , true));
+ Add(database_entity(DB_TermMinIssAge , 0.0));
+ Add(database_entity(DB_TermMaxIssAge , 0.0));
+ Add(database_entity(DB_TermForcedConvAge , 0.0));
+ Add(database_entity(DB_MaxTermProportion , 0.0));
+ Add(database_entity(DB_TermCOIRate , 0.0));
+ Add(database_entity(DB_TermPremRate , 0.0));
+ Add(database_entity(DB_WPTable , 8));
+ Add(database_entity(DB_AllowWP , true));
+ Add(database_entity(DB_WPMinIssAge , 0.0));
+ Add(database_entity(DB_WPMaxIssAge , 0.0));
+ Add(database_entity(DB_WPMax , 0.0));
+ Add(database_entity(DB_WPCOIRate , 0.0));
+ Add(database_entity(DB_WPPremRate , 0.0));
// SOA qx_ins table 708 is 70-75 US ADB experience.
- Add(TDBValue(DB_ADDTable , 708));
- Add(TDBValue(DB_AllowADD , true));
- Add(TDBValue(DB_ADDMinIssAge , 0.0));
- Add(TDBValue(DB_ADDMaxIssAge , 0.0));
- Add(TDBValue(DB_ADDLimit , 1000000.0));
- Add(TDBValue(DB_ADDCOIRate , 0.0));
- Add(TDBValue(DB_ADDPremRate , 0.0));
- Add(TDBValue(DB_WeightClass , 0.0));
- Add(TDBValue(DB_WeightGender , 0.0));
- Add(TDBValue(DB_WeightSmoking , 0.0));
- Add(TDBValue(DB_WeightAge , 0.0));
- Add(TDBValue(DB_WeightSpecAmt , 0.0));
- Add(TDBValue(DB_WeightState , 0.0));
- Add(TDBValue(DB_FullExpPol , 0.0));
- Add(TDBValue(DB_FullExpPrem , 0.0));
- Add(TDBValue(DB_FullExpDumpin , 0.0));
- Add(TDBValue(DB_FullExpPerK , 0.0));
- Add(TDBValue(DB_VarExpPol , 0.0));
- Add(TDBValue(DB_VarExpPrem , 0.0));
- Add(TDBValue(DB_VarExpDumpin , 0.0));
- Add(TDBValue(DB_VarExpPerK , 0.0));
- Add(TDBValue(DB_MedicalProportion , 0.0));
- Add(TDBValue(DB_UWTestCost , 0.0));
- Add(TDBValue(DB_VxBasicQTable , 0.0));
- Add(TDBValue(DB_VxDeficQTable , 0.0));
- Add(TDBValue(DB_VxTaxQTable , 0.0));
- Add(TDBValue(DB_StatVxInt , 0.0));
- Add(TDBValue(DB_TaxVxInt , 0.0));
- Add(TDBValue(DB_StatVxQ , 0.0));
- Add(TDBValue(DB_TaxVxQ , 0.0));
- Add(TDBValue(DB_DefVxQ , 0.0));
- Add(TDBValue(DB_NonforfQ , 0.0));
- Add(TDBValue(DB_CompTarget , 0.0));
- Add(TDBValue(DB_CompExcess , 0.0));
- Add(TDBValue(DB_CompChargeBack , 0.0));
- Add(TDBValue(DB_LapseRate , 0.0));
- Add(TDBValue(DB_ReqSurpNAAR , 0.0));
- Add(TDBValue(DB_ReqSurpVx , 0.0));
- Add(TDBValue(DB_LICFitRate , 0.0));
- Add(TDBValue(DB_LicDacTaxRate , 0.0));
- Add(TDBValue(DB_GDBVxMethod , 0.0));
- Add(TDBValue(DB_PrimaryHurdle , 0.0));
- Add(TDBValue(DB_SecondaryHurdle , 0.0));
- Add(TDBValue(DB_LedgerType , mce_ill_reg));
- Add(TDBValue(DB_AllowExpRating , false));
+ Add(database_entity(DB_ADDTable , 708));
+ Add(database_entity(DB_AllowADD , true));
+ Add(database_entity(DB_ADDMinIssAge , 0.0));
+ Add(database_entity(DB_ADDMaxIssAge , 0.0));
+ Add(database_entity(DB_ADDLimit , 1000000.0));
+ Add(database_entity(DB_ADDCOIRate , 0.0));
+ Add(database_entity(DB_ADDPremRate , 0.0));
+ Add(database_entity(DB_WeightClass , 0.0));
+ Add(database_entity(DB_WeightGender , 0.0));
+ Add(database_entity(DB_WeightSmoking , 0.0));
+ Add(database_entity(DB_WeightAge , 0.0));
+ Add(database_entity(DB_WeightSpecAmt , 0.0));
+ Add(database_entity(DB_WeightState , 0.0));
+ Add(database_entity(DB_FullExpPol , 0.0));
+ Add(database_entity(DB_FullExpPrem , 0.0));
+ Add(database_entity(DB_FullExpDumpin , 0.0));
+ Add(database_entity(DB_FullExpPerK , 0.0));
+ Add(database_entity(DB_VarExpPol , 0.0));
+ Add(database_entity(DB_VarExpPrem , 0.0));
+ Add(database_entity(DB_VarExpDumpin , 0.0));
+ Add(database_entity(DB_VarExpPerK , 0.0));
+ Add(database_entity(DB_MedicalProportion , 0.0));
+ Add(database_entity(DB_UWTestCost , 0.0));
+ Add(database_entity(DB_VxBasicQTable , 0.0));
+ Add(database_entity(DB_VxDeficQTable , 0.0));
+ Add(database_entity(DB_VxTaxQTable , 0.0));
+ Add(database_entity(DB_StatVxInt , 0.0));
+ Add(database_entity(DB_TaxVxInt , 0.0));
+ Add(database_entity(DB_StatVxQ , 0.0));
+ Add(database_entity(DB_TaxVxQ , 0.0));
+ Add(database_entity(DB_DefVxQ , 0.0));
+ Add(database_entity(DB_NonforfQ , 0.0));
+ Add(database_entity(DB_CompTarget , 0.0));
+ Add(database_entity(DB_CompExcess , 0.0));
+ Add(database_entity(DB_CompChargeBack , 0.0));
+ Add(database_entity(DB_LapseRate , 0.0));
+ Add(database_entity(DB_ReqSurpNAAR , 0.0));
+ Add(database_entity(DB_ReqSurpVx , 0.0));
+ Add(database_entity(DB_LICFitRate , 0.0));
+ Add(database_entity(DB_LicDacTaxRate , 0.0));
+ Add(database_entity(DB_GDBVxMethod , 0.0));
+ Add(database_entity(DB_PrimaryHurdle , 0.0));
+ Add(database_entity(DB_SecondaryHurdle , 0.0));
+ Add(database_entity(DB_LedgerType , mce_ill_reg));
+ Add(database_entity(DB_AllowExpRating , false));
// These aren't really NY Table Y group rates--in fact, they're
// US 65-70 male ALB. Though NY Table Y is occasionally
@@ -585,73 +585,73 @@
// this support request:
// http://savannah.nongnu.org/support/?105593
// would offer a choice and make that database entity unnecessary.
- Add(TDBValue(DB_TableYTable , 358));
+ Add(database_entity(DB_TableYTable , 358));
// Use male rates for unisex--1983 GAM seems to have no unisex version.
double T83Gam[3] = {825, 826, 826,};
- Add(TDBValue(DB_83GamTable, TDBValue::e_number_of_axes, dims311, T83Gam,
"Use male rates for unisex--1983 GAM seems to have no unisex version."));
+ Add(database_entity(DB_83GamTable, database_entity::e_number_of_axes,
dims311, T83Gam, "Use male rates for unisex--1983 GAM seems to have no unisex
version."));
- Add(TDBValue(DB_AllowWD , true));
- Add(TDBValue(DB_AllowLoan , true));
- Add(TDBValue(DB_AllowChangeToDBO2 , true));
- Add(TDBValue(DB_AllowSAIncr , true));
- Add(TDBValue(DB_NoLapseAlwaysActive , false));
- Add(TDBValue(DB_PrefOrSelect , oe_called_select));
- Add(TDBValue(DB_ExpRatStdDevMult , 0.0));
- Add(TDBValue(DB_ExpRatIBNRMult , 0.0));
- Add(TDBValue(DB_ExpRatCOIRetention , 0.0));
- Add(TDBValue(DB_StableValFundCharge , 0.0));
- Add(TDBValue(DB_AmortPmLdFundCharge , 0.0030));
- Add(TDBValue(DB_AllowAmortPremLoad , false));
- Add(TDBValue(DB_PmTxAmortPeriod , 0));
- Add(TDBValue(DB_PmTxAmortIntRate , 0.0));
+ Add(database_entity(DB_AllowWD , true));
+ Add(database_entity(DB_AllowLoan , true));
+ Add(database_entity(DB_AllowChangeToDBO2 , true));
+ Add(database_entity(DB_AllowSAIncr , true));
+ Add(database_entity(DB_NoLapseAlwaysActive , false));
+ Add(database_entity(DB_PrefOrSelect , oe_called_select));
+ Add(database_entity(DB_ExpRatStdDevMult , 0.0));
+ Add(database_entity(DB_ExpRatIBNRMult , 0.0));
+ Add(database_entity(DB_ExpRatCOIRetention , 0.0));
+ Add(database_entity(DB_StableValFundCharge , 0.0));
+ Add(database_entity(DB_AmortPmLdFundCharge , 0.0030));
+ Add(database_entity(DB_AllowAmortPremLoad , false));
+ Add(database_entity(DB_PmTxAmortPeriod , 0));
+ Add(database_entity(DB_PmTxAmortIntRate , 0.0));
// Pass through premium tax.
Add
- (TDBValue
+ (database_entity
(DB_PremTaxLoad
- ,TDBValue::e_number_of_axes
+ ,database_entity::e_number_of_axes
,premium_tax_dimensions
,premium_tax_rates
)
);
- Add(TDBValue(DB_AllowHoneymoon , true));
+ Add(database_entity(DB_AllowHoneymoon , true));
// Set target equal to seven-pay premium.
- Add(TDBValue(DB_TgtPremTable , 10));
- Add(TDBValue(DB_TgtPremPolFee , 0.0));
- Add(TDBValue(DB_AllowExtraAssetComp , true));
- Add(TDBValue(DB_AllowExtraPremComp , true));
- Add(TDBValue(DB_AssetChargeType , oe_asset_charge_spread));
- Add(TDBValue(DB_AllowUltraPrefClass , false));
- Add(TDBValue(DB_MaxGenAcctRate , 0.06));
- Add(TDBValue(DB_MaxSepAcctRate , 0.12));
- Add(TDBValue(DB_MaxVLRRate , 0.18));
- Add(TDBValue(DB_SurrChgAVMult , 0.0));
- Add(TDBValue(DB_IntSpreadFreq , mce_spread_daily));
- Add(TDBValue(DB_StateApproved , true));
- Add(TDBValue(DB_AllowStateXX , true));
- Add(TDBValue(DB_AllowForeign , true));
- Add(TDBValue(DB_AllowCustomFund , false));
- Add(TDBValue(DB_AllowNo7702 , false));
- Add(TDBValue(DB_EnforceNAARLimit , true));
- Add(TDBValue(DB_DynamicSepAcctLoad , false));
- Add(TDBValue(DB_SpecAmtLoadLimit , 10000000.0));
- Add(TDBValue(DB_Equiv7702DBO3 , 0));
- Add(TDBValue(DB_ExpRatRiskCOIMult , 0));
- Add(TDBValue(DB_SurrChgSAMult , 0.0));
- Add(TDBValue(DB_AllowSpouse , false));
- Add(TDBValue(DB_AllowChild , false));
+ Add(database_entity(DB_TgtPremTable , 10));
+ Add(database_entity(DB_TgtPremPolFee , 0.0));
+ Add(database_entity(DB_AllowExtraAssetComp , true));
+ Add(database_entity(DB_AllowExtraPremComp , true));
+ Add(database_entity(DB_AssetChargeType , oe_asset_charge_spread));
+ Add(database_entity(DB_AllowUltraPrefClass , false));
+ Add(database_entity(DB_MaxGenAcctRate , 0.06));
+ Add(database_entity(DB_MaxSepAcctRate , 0.12));
+ Add(database_entity(DB_MaxVLRRate , 0.18));
+ Add(database_entity(DB_SurrChgAVMult , 0.0));
+ Add(database_entity(DB_IntSpreadFreq , mce_spread_daily));
+ Add(database_entity(DB_StateApproved , true));
+ Add(database_entity(DB_AllowStateXX , true));
+ Add(database_entity(DB_AllowForeign , true));
+ Add(database_entity(DB_AllowCustomFund , false));
+ Add(database_entity(DB_AllowNo7702 , false));
+ Add(database_entity(DB_EnforceNAARLimit , true));
+ Add(database_entity(DB_DynamicSepAcctLoad , false));
+ Add(database_entity(DB_SpecAmtLoadLimit , 10000000.0));
+ Add(database_entity(DB_Equiv7702DBO3 , 0));
+ Add(database_entity(DB_ExpRatRiskCOIMult , 0));
+ Add(database_entity(DB_SurrChgSAMult , 0.0));
+ Add(database_entity(DB_AllowSpouse , false));
+ Add(database_entity(DB_AllowChild , false));
// Spouse and child riders unavailable, so it doesn't matter
// what table we specify.
- Add(TDBValue(DB_SpouseRiderTable , 708));
- Add(TDBValue(DB_ChildRiderTable , 708));
+ Add(database_entity(DB_SpouseRiderTable , 708));
+ Add(database_entity(DB_ChildRiderTable , 708));
- Add(TDBValue(DB_GAIntBonus , 0.0));
+ Add(database_entity(DB_GAIntBonus , 0.0));
// Allow experience rating.
- Add(TDBValue(DB_AllowExpRating , 1.0));
- Add(TDBValue(DB_ExpRatIBNRMult , 6.0));
- Add(TDBValue(DB_ExpRatAmortPeriod , 4.0));
+ Add(database_entity(DB_AllowExpRating , 1.0));
+ Add(database_entity(DB_ExpRatIBNRMult , 6.0));
+ Add(database_entity(DB_ExpRatAmortPeriod , 4.0));
WriteDB(AddDataDir("sample.database"));
}
@@ -667,42 +667,42 @@
// database entities.
for(int j = DB_FIRST; j < DB_LAST; ++j)
{
- Add(TDBValue(j, 0.0));
+ Add(database_entity(j, 0.0));
}
- Add(TDBValue(DB_GuarInt, 0.03));
+ Add(database_entity(DB_GuarInt, 0.03));
- Add(TDBValue(DB_FixedLoanRate, 0.06));
+ Add(database_entity(DB_FixedLoanRate, 0.06));
- Add(TDBValue(DB_GuarRegLoanSpread, 0.0));
- Add(TDBValue(DB_CurrRegLoanSpread, 0.0));
- Add(TDBValue(DB_GuarPrefLoanSpread, 0.0));
- Add(TDBValue(DB_CurrPrefLoanSpread, 0.0));
+ Add(database_entity(DB_GuarRegLoanSpread, 0.0));
+ Add(database_entity(DB_CurrRegLoanSpread, 0.0));
+ Add(database_entity(DB_GuarPrefLoanSpread, 0.0));
+ Add(database_entity(DB_CurrPrefLoanSpread, 0.0));
- Add(TDBValue(DB_AllowGenAcct, 1.0));
- Add(TDBValue(DB_AllowPreferredClass, 1.0));
+ Add(database_entity(DB_AllowGenAcct, 1.0));
+ Add(database_entity(DB_AllowPreferredClass, 1.0));
// premium loads
- Add(TDBValue(DB_GuarPolFee, 12.00));
- Add(TDBValue(DB_GuarSpecAmtLoad, 0.0));
- Add(TDBValue(DB_GuarPremLoadTgt, 0.025));
- Add(TDBValue(DB_GuarPremLoadExc, 0.025));
- Add(TDBValue(DB_CurrPolFee, 5.00));
- Add(TDBValue(DB_CurrSpecAmtLoad, 0.0));
- Add(TDBValue(DB_CurrPremLoadTgt, 0.025));
- Add(TDBValue(DB_CurrPremLoadExc, 0.025));
+ Add(database_entity(DB_GuarPolFee, 12.00));
+ Add(database_entity(DB_GuarSpecAmtLoad, 0.0));
+ Add(database_entity(DB_GuarPremLoadTgt, 0.025));
+ Add(database_entity(DB_GuarPremLoadExc, 0.025));
+ Add(database_entity(DB_CurrPolFee, 5.00));
+ Add(database_entity(DB_CurrSpecAmtLoad, 0.0));
+ Add(database_entity(DB_CurrPremLoadTgt, 0.025));
+ Add(database_entity(DB_CurrPremLoadExc, 0.025));
- Add(TDBValue(DB_MinWD, 100.0));
- Add(TDBValue(DB_WDFee, 5.0));
- Add(TDBValue(DB_WDFeeRate, 0.01));
+ Add(database_entity(DB_MinWD, 100.0));
+ Add(database_entity(DB_WDFee, 5.0));
+ Add(database_entity(DB_WDFeeRate, 0.01));
- int guar_coi_dims[TDBValue::e_number_of_axes] = {1, 1, 3, 1, 1, 1, 1};
+ int guar_coi_dims[database_entity::e_number_of_axes] = {1, 1, 3, 1, 1, 1,
1};
// smoker, nonsmoker, unismoke
double guar_coi_tables[3] = {111, 109, 107};
- Add(TDBValue(DB_GuarCOITable, TDBValue::e_number_of_axes, guar_coi_dims,
guar_coi_tables));
+ Add(database_entity(DB_GuarCOITable, database_entity::e_number_of_axes,
guar_coi_dims, guar_coi_tables));
- int curr_coi_dims[TDBValue::e_number_of_axes] = {1, 4, 3, 1, 1, 1, 1};
+ int curr_coi_dims[database_entity::e_number_of_axes] = {1, 4, 3, 1, 1, 1,
1};
// preferred, standard, rated, ultrapreferred by smoker, nonsmoker,
unismoke
double curr_coi_tables[] =
{
@@ -711,46 +711,46 @@
5, 6, 4, // rated sm ns us
0, 0, 0, // ultra sm ns us
};
- Add(TDBValue(DB_CurrCOITable, TDBValue::e_number_of_axes, curr_coi_dims,
curr_coi_tables));
+ Add(database_entity(DB_CurrCOITable, database_entity::e_number_of_axes,
curr_coi_dims, curr_coi_tables));
- Add(TDBValue(DB_CorridorTable, 7));
- Add(TDBValue(DB_WPTable, 8));
- Add(TDBValue(DB_ADDTable, 9));
- Add(TDBValue(DB_EndtAge, 100));
- Add(TDBValue(DB_AgeLastOrNearest, 1.0));
- Add(TDBValue(DB_MinSpecAmt, 10000.0));
+ Add(database_entity(DB_CorridorTable, 7));
+ Add(database_entity(DB_WPTable, 8));
+ Add(database_entity(DB_ADDTable, 9));
+ Add(database_entity(DB_EndtAge, 100));
+ Add(database_entity(DB_AgeLastOrNearest, 1.0));
+ Add(database_entity(DB_MinSpecAmt, 10000.0));
- Add(TDBValue(DB_MaxGenAcctRate, 0.12));
- Add(TDBValue(DB_MaxSepAcctRate, 0.12));
+ Add(database_entity(DB_MaxGenAcctRate, 0.12));
+ Add(database_entity(DB_MaxSepAcctRate, 0.12));
- Add(TDBValue(DB_AllowLoan, 1.0));
- Add(TDBValue(DB_AllowWD, 1.0));
- Add(TDBValue(DB_AllowFlatExtras, 1.0));
- Add(TDBValue(DB_AllowChangeToDBO2, 1.0));
- Add(TDBValue(DB_AllowDBO3, 1.0));
+ Add(database_entity(DB_AllowLoan, 1.0));
+ Add(database_entity(DB_AllowWD, 1.0));
+ Add(database_entity(DB_AllowFlatExtras, 1.0));
+ Add(database_entity(DB_AllowChangeToDBO2, 1.0));
+ Add(database_entity(DB_AllowDBO3, 1.0));
- Add(TDBValue(DB_SurrChgPremMult, 0.0));
- Add(TDBValue(DB_SurrChgAVMult, 0.0));
- Add(TDBValue(DB_SurrChgSAMult, 0.0));
- Add(TDBValue(DB_SurrChgAVDurFactor, 1.0));
- Add(TDBValue(DB_SurrChgSADurFactor, 1.0));
+ Add(database_entity(DB_SurrChgPremMult, 0.0));
+ Add(database_entity(DB_SurrChgAVMult, 0.0));
+ Add(database_entity(DB_SurrChgSAMult, 0.0));
+ Add(database_entity(DB_SurrChgAVDurFactor, 1.0));
+ Add(database_entity(DB_SurrChgSADurFactor, 1.0));
- Add(TDBValue(DB_LedgerType, mce_ill_reg));
+ Add(database_entity(DB_LedgerType, mce_ill_reg));
- Add(TDBValue(DB_NoLapseAlwaysActive, 0.0));
- Add(TDBValue(DB_NoLapseMinDur, 0.0));
- Add(TDBValue(DB_NoLapseMinAge, 0.0));
+ Add(database_entity(DB_NoLapseAlwaysActive, 0.0));
+ Add(database_entity(DB_NoLapseMinDur, 0.0));
+ Add(database_entity(DB_NoLapseMinAge, 0.0));
- Add(TDBValue(DB_NominallyPar, 0.0));
- Add(TDBValue(DB_Has1035ExchCharge, 0.0));
- Add(TDBValue(DB_SmokeOrTobacco, 0.0));
- Add(TDBValue(DB_DACTaxFundCharge, 0.0));
- Add(TDBValue(DB_AllowWP, 0.0));
- Add(TDBValue(DB_AllowADD, 0.0));
- Add(TDBValue(DB_AllowSpouse, 0.0));
- Add(TDBValue(DB_AllowChild, 0.0));
+ Add(database_entity(DB_NominallyPar, 0.0));
+ Add(database_entity(DB_Has1035ExchCharge, 0.0));
+ Add(database_entity(DB_SmokeOrTobacco, 0.0));
+ Add(database_entity(DB_DACTaxFundCharge, 0.0));
+ Add(database_entity(DB_AllowWP, 0.0));
+ Add(database_entity(DB_AllowADD, 0.0));
+ Add(database_entity(DB_AllowSpouse, 0.0));
+ Add(database_entity(DB_AllowChild, 0.0));
- Add(TDBValue(DB_ExpRatAmortPeriod, 4.0));
+ Add(database_entity(DB_ExpRatAmortPeriod, 4.0));
}
/// Print databases to file in an alternative text format.
Modified: lmi/trunk/dbdict.hpp
===================================================================
--- lmi/trunk/dbdict.hpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/dbdict.hpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -35,7 +35,7 @@
#include <map>
#include <string>
-typedef std::map<int, TDBValue> dict_map;
+typedef std::map<int, database_entity> dict_map;
/// Cached product database.
@@ -62,7 +62,7 @@
DBDictionary();
void WriteDB(std::string const& filename);
- void Add(TDBValue const&);
+ void Add(database_entity const&);
void InitDB();
static void InvalidateCache();
Modified: lmi/trunk/dbvalue.cpp
===================================================================
--- lmi/trunk/dbvalue.cpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/dbvalue.cpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -43,10 +43,10 @@
#include <numeric>
#include <ostream>
-static int const ScalarDims[TDBValue::e_number_of_axes] = {1, 1, 1, 1, 1, 1,
1};
+static int const ScalarDims[database_entity::e_number_of_axes] = {1, 1, 1, 1,
1, 1, 1};
static int const MaxPossibleElements = std::numeric_limits<int>::max();
-std::vector<int> const& TDBValue::maximum_dimensions()
+std::vector<int> const& database_entity::maximum_dimensions()
{
static int const d[e_number_of_axes] =
{e_max_dim_gender
@@ -69,20 +69,20 @@
/// - DB_PremTaxLoad (what the insurer charges the customer)
/// may be equivalent when premium tax is passed through as a load.
-bool TDBValue::Equivalent(TDBValue const& a, TDBValue const& b)
+bool database_entity::Equivalent(database_entity const& a, database_entity
const& b)
{
return(a.axis_lengths_ == b.axis_lengths_ && a.data_values_ ==
b.data_values_);
}
//============================================================================
-bool TDBValue::VariesByState(TDBValue const& z)
+bool database_entity::VariesByState(database_entity const& z)
{
LMI_ASSERT(5 < z.axis_lengths_.size());
return 1 != z.axis_lengths_[5];
}
//============================================================================
-TDBValue::TDBValue()
+database_entity::database_entity()
:key_ (0)
,axis_lengths_ (e_number_of_axes)
{
@@ -90,7 +90,7 @@
/// Handy ctor for writing programs to generate '.database' files.
-TDBValue::TDBValue
+database_entity::database_entity
(int key
,int ndims
,int const* dims
@@ -107,7 +107,7 @@
}
//============================================================================
-TDBValue::TDBValue
+database_entity::database_entity
(int key
,std::vector<int> const& dims
,std::vector<double> const& data
@@ -123,7 +123,7 @@
/// Handy ctor for scalar data.
-TDBValue::TDBValue
+database_entity::database_entity
(int key
,double datum
,std::string const& gloss
@@ -136,12 +136,12 @@
}
//============================================================================
-TDBValue::~TDBValue()
+database_entity::~database_entity()
{
}
//============================================================================
-void TDBValue::ParanoidCheck() const
+void database_entity::ParanoidCheck() const
{
if
(
@@ -169,7 +169,7 @@
}
//============================================================================
-int TDBValue::getndata() const
+int database_entity::getndata() const
{
LMI_ASSERT(!axis_lengths_.empty());
@@ -218,10 +218,10 @@
/// Two indexing operators are provided. This one's argument includes
/// the number of durations--which, as far as the product editor is
/// concerned, is much like the other axes. However, for illustration
-/// production, TDatabase::Query() handles the last (duration) axis,
-/// replicating the last value as required to extend to maturity.
+/// production, product_database::Query() handles the last (duration)
+/// axis, replicating the last value as needed to extend to maturity.
-double& TDBValue::operator[](std::vector<int> const& index)
+double& database_entity::operator[](std::vector<int> const& index)
{
LMI_ASSERT(e_number_of_axes == index.size());
LMI_ASSERT(e_number_of_axes == axis_lengths_.size());
@@ -250,7 +250,7 @@
/// Indexing operator for illustration production.
-double const* TDBValue::operator[](database_index const& idx) const
+double const* database_entity::operator[](database_index const& idx) const
{
std::vector<int> const& index(idx.index_vector());
LMI_ASSERT(e_number_of_axes == 1 + index.size());
@@ -280,7 +280,7 @@
}
//============================================================================
-void TDBValue::Reshape(std::vector<int> const& dims)
+void database_entity::Reshape(std::vector<int> const& dims)
{
// Create a new instance of this class having the same
// key but the desired number of axes
@@ -293,7 +293,7 @@
,std::multiplies<int>()
)
);
- TDBValue new_object
+ database_entity new_object
(GetKey()
,dims
,new_data
@@ -391,7 +391,7 @@
}
//============================================================================
-std::ostream& TDBValue::write(std::ostream& os) const
+std::ostream& database_entity::write(std::ostream& os) const
{
os
<< '"' << GetDBNames()[key_].LongName << '"'
@@ -429,7 +429,7 @@
//============================================================================
// TODO ?? Combine this with ParanoidCheck()?
-bool TDBValue::AreAllAxesOK() const
+bool database_entity::AreAllAxesOK() const
{
bool rc = true;
std::vector<int> const& max_dims(maximum_dimensions());
@@ -470,34 +470,34 @@
return rc;
}
-int TDBValue::GetKey() const
+int database_entity::GetKey() const
{
return key_;
}
-int TDBValue::GetNDims() const
+int database_entity::GetNDims() const
{
return axis_lengths_.size();
}
-int TDBValue::GetLength() const
+int database_entity::GetLength() const
{
LMI_ASSERT(0 < axis_lengths_.size());
return axis_lengths_.back();
}
-int TDBValue::GetLength(int axis) const
+int database_entity::GetLength(int axis) const
{
LMI_ASSERT(0 <= axis && axis < static_cast<int>(axis_lengths_.size()));
return axis_lengths_[axis];
}
-std::vector<int> const& TDBValue::GetAxisLengths() const
+std::vector<int> const& database_entity::GetAxisLengths() const
{
return axis_lengths_;
}
-void TDBValue::read(xml::element const& e)
+void database_entity::read(xml::element const& e)
{
std::string short_name;
xml_serialize::get_element(e, "key" , short_name );
@@ -514,7 +514,7 @@
AreAllAxesOK();
}
-void TDBValue::write(xml::element& e) const
+void database_entity::write(xml::element& e) const
{
LMI_ASSERT(getndata() == static_cast<int>(data_values_.size()));
LMI_ASSERT
Modified: lmi/trunk/dbvalue.hpp
===================================================================
--- lmi/trunk/dbvalue.hpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/dbvalue.hpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -56,10 +56,10 @@
///
/// Implicitly-declared special member functions do the right thing.
-class LMI_SO TDBValue
- :virtual private obstruct_slicing<TDBValue>
+class LMI_SO database_entity
+ :virtual private obstruct_slicing<database_entity>
{
- friend struct xml_serialize::xml_io<TDBValue>;
+ friend struct xml_serialize::xml_io<database_entity>;
public:
// Separate enumerators here facilitate compile-time assertions
@@ -74,26 +74,26 @@
enum {e_max_dim_state = 53};
enum {e_max_dim_duration = 100};
- TDBValue();
- TDBValue
+ database_entity();
+ database_entity
(int key
,int ndims
,int const* dims
,double const* data
,std::string const& gloss = std::string()
);
- TDBValue
+ database_entity
(int key
,std::vector<int> const& dims
,std::vector<double> const& data
,std::string const& gloss = std::string()
);
- TDBValue
+ database_entity
(int key
,double datum
,std::string const& gloss = std::string()
);
- ~TDBValue();
+ ~database_entity();
double const* operator[](database_index const& idx) const;
double& operator[](std::vector<int> const& idx);
@@ -109,8 +109,8 @@
std::ostream& write(std::ostream&) const;
static std::vector<int> const& maximum_dimensions();
- static bool Equivalent(TDBValue const&, TDBValue const&);
- static bool VariesByState(TDBValue const&);
+ static bool Equivalent(database_entity const&, database_entity const&);
+ static bool VariesByState(database_entity const&);
private:
int getndata() const;
Modified: lmi/trunk/ihs_basicval.cpp
===================================================================
--- lmi/trunk/ihs_basicval.cpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/ihs_basicval.cpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -189,10 +189,10 @@
// is used, then reset the database, then recalculate the age. If any
// circularity
// remains, it will be detected and an error message given when we look
- // up the ALB/ANB switch using TDatabase::Query(int), which restricts
- // looked-up values to scalars that vary across no database axis.
+ // up the ALB/ANB switch using product_database::Query(int), which
+ // restricts looked-up values to scalars that vary across no database axis.
- Database_.reset(new TDatabase(yare_input_));
+ Database_.reset(new product_database(yare_input_));
StateOfJurisdiction_ = Database_->GetStateOfJurisdiction();
@@ -289,7 +289,7 @@
void BasicValues::GPTServerInit()
{
ProductData_.reset(new product_data(yare_input_.ProductName));
- Database_.reset(new TDatabase(yare_input_));
+ Database_.reset(new product_database(yare_input_));
IssueAge = yare_input_.IssueAge;
RetAge = yare_input_.RetirementAge;
@@ -720,7 +720,7 @@
yare_input YI(*Input_);
YI.State = GetStateOfDomicile();
YI.CorporationState = GetStateOfDomicile();
- TDatabase TempDatabase(YI);
+ product_database TempDatabase(YI);
DomiciliaryPremiumTaxLoad_ = 0.0;
if(!yare_input_.AmortizePremiumLoad)
{
@@ -880,7 +880,7 @@
/// Lowest premium-tax load, for 7702 and 7702A purposes.
double lowest_premium_tax_load
- (TDatabase const& db
+ (product_database const& db
,stratified_charges const& stratified
,mcenum_state state_of_jurisdiction
,bool amortize_premium_load
@@ -912,8 +912,8 @@
z = db.Query(DB_PremTaxLoad);
- TDBValue const& premium_tax_loads = db.GetEntry(DB_PremTaxLoad);
- if(!TDBValue::VariesByState(premium_tax_loads))
+ database_entity const& premium_tax_loads = db.GetEntry(DB_PremTaxLoad);
+ if(!database_entity::VariesByState(premium_tax_loads))
{
return z;
}
@@ -922,8 +922,8 @@
// it equals premium-tax rate--i.e. that premium tax is passed
// through exactly--and that therefore tiered tax rates determine
// loads where applicable and implemented.
- TDBValue const& premium_tax_rates = db.GetEntry(DB_PremTaxRate);
- if(!TDBValue::Equivalent(premium_tax_loads, premium_tax_rates))
+ database_entity const& premium_tax_rates = db.GetEntry(DB_PremTaxRate);
+ if(!database_entity::Equivalent(premium_tax_loads, premium_tax_rates))
{
fatal_error()
<< "Premium-tax load varies by state, but differs"
@@ -968,8 +968,8 @@
// TODO ?? Don't override parameters--instead, only detect and
// report inconsistencies.
//
- TDBValue const& premium_tax_loads = Database_->GetEntry(DB_PremTaxLoad);
- if(!TDBValue::VariesByState(premium_tax_loads))
+ database_entity const& premium_tax_loads =
Database_->GetEntry(DB_PremTaxLoad);
+ if(!database_entity::VariesByState(premium_tax_loads))
{
return;
}
@@ -1691,7 +1691,7 @@
YI.Gender = gender ;
YI.Smoking = smoking;
- TDatabase TempDatabase(YI);
+ product_database TempDatabase(YI);
return GetActuarialTable
(TableFile
Modified: lmi/trunk/ihs_database.cpp
===================================================================
--- lmi/trunk/ihs_database.cpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/ihs_database.cpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -44,7 +44,7 @@
#include <algorithm>
//============================================================================
-TDatabase::TDatabase
+product_database::product_database
(std::string const& a_ProductName
,mcenum_gender a_Gender
,mcenum_class a_Class
@@ -66,7 +66,7 @@
}
//============================================================================
-TDatabase::TDatabase(yare_input const& input)
+product_database::product_database(yare_input const& input)
:Filename(AddDataDir(product_data(input.ProductName).datum("DatabaseFilename")))
{
// GET RID OF Gender, Class, Smoker, etc.
@@ -86,7 +86,7 @@
// of the database object.
// State of jurisdiction must not depend on itself
- TDBValue const& StateEntry = GetEntry(DB_PremTaxState);
+ database_entity const& StateEntry = GetEntry(DB_PremTaxState);
if(1 != StateEntry.GetLength(5))
{
fatal_error()
@@ -125,24 +125,24 @@
}
//============================================================================
-TDatabase::~TDatabase()
+product_database::~product_database()
{
}
//============================================================================
-mcenum_state TDatabase::GetStateOfJurisdiction() const
+mcenum_state product_database::GetStateOfJurisdiction() const
{
return State;
}
//============================================================================
-int TDatabase::length() const
+int product_database::length() const
{
return length_;
}
//============================================================================
-void TDatabase::Init()
+void product_database::Init()
{
index_ = database_index(Gender, Class, Smoker, IssueAge, UWBasis, State);
@@ -161,16 +161,16 @@
}
//===========================================================================
-double TDatabase::Query(int k) const
+double product_database::Query(int k) const
{
ConstrainScalar(k); // TODO ?? Is the extra overhead acceptable?
return *GetEntry(k)[index_];
}
//===========================================================================
-void TDatabase::Query(std::vector<double>& dst, int k) const
+void product_database::Query(std::vector<double>& dst, int k) const
{
- TDBValue const& v = GetEntry(k);
+ database_entity const& v = GetEntry(k);
double const*const z = v[index_];
// TODO ?? Can this be right?
if(1 == v.GetNDims())
@@ -212,7 +212,7 @@
}
//===========================================================================
-TDBValue const& TDatabase::GetEntry(int k) const
+database_entity const& product_database::GetEntry(int k) const
{
dict_map const& dict = DBDictionary::instance().GetDictionary();
dict_map::const_iterator p = dict.find(k);
@@ -230,7 +230,7 @@
<< " not found."
<< LMI_FLUSH
;
- return *new TDBValue;
+ return *new database_entity;
}
else
{
@@ -243,7 +243,7 @@
/// invariant by duration. The database item may nonetheless vary
/// across any axis except duration.
-void TDatabase::ConstrainScalar(int k) const
+void product_database::ConstrainScalar(int k) const
{
std::vector<double> z;
Query(z, k);
Modified: lmi/trunk/input.hpp
===================================================================
--- lmi/trunk/input.hpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/input.hpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -41,7 +41,7 @@
#include "xml_serializable.hpp"
class InputSequence;
-class TDatabase;
+class product_database;
#include <boost/operators.hpp>
#include <boost/scoped_ptr.hpp>
@@ -232,7 +232,7 @@
void make_term_rider_consistent(bool aggressively = true);
- boost::scoped_ptr<TDatabase> database_;
+ boost::scoped_ptr<product_database> database_;
// Database axes are independent variables; they're "cached" along
// with the database, which is reset when any of them changes.
Modified: lmi/trunk/input_harmonization.cpp
===================================================================
--- lmi/trunk/input_harmonization.cpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/input_harmonization.cpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -45,7 +45,7 @@
namespace
{
- std::string current_credited_rate(TDatabase const& database)
+ std::string current_credited_rate(product_database const& database)
{
std::vector<double> z;
database.Query(z, DB_MaxGenAcctRate);
@@ -86,7 +86,7 @@
CachedStateOfJurisdiction_ = StateOfJurisdiction .value();
database_.reset
- (new TDatabase
+ (new product_database
(CachedProductName_
,CachedGender_
,CachedUnderwritingClass_
Modified: lmi/trunk/interest_rates.cpp
===================================================================
--- lmi/trunk/interest_rates.cpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/interest_rates.cpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -299,7 +299,7 @@
v.Database_->Query(general_account_interest_bonus, DB_GAIntBonus);
// ET !! GenAcctGrossRate_ += general_account_interest_bonus;
// ...and this might be further simplified by implementing e.g.
- // std::vector<double> TDatabase::QueryVector(int k) const;
+ // std::vector<double> product_database::QueryVector(int k) const;
// and replacing 'general_account_interest_bonus' with a
// temporary:
// GenAcctGrossRate_ += v.Database_->QueryVector(DB_GAIntBonus);
Modified: lmi/trunk/loads.cpp
===================================================================
--- lmi/trunk/loads.cpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/loads.cpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -121,7 +121,7 @@
/// Set various data members from product database.
-void Loads::Initialize(TDatabase const& database)
+void Loads::Initialize(product_database const& database)
{
database.Query(refundable_sales_load_proportion_, DB_PremRefund );
database.Query(premium_tax_load_ , DB_PremTaxLoad );
@@ -341,7 +341,7 @@
/// Ctor for antediluvian branch.
-Loads::Loads(TDatabase const& database, bool NeedMidpointRates)
+Loads::Loads(product_database const& database, bool NeedMidpointRates)
{
monthly_policy_fee_ .resize(mc_n_gen_bases);
target_premium_load_ .resize(mc_n_gen_bases);
Modified: lmi/trunk/loads.hpp
===================================================================
--- lmi/trunk/loads.hpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/loads.hpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -31,7 +31,8 @@
#include <vector>
class BasicValues;
-class TDatabase;
+class product_database;
+
struct load_details;
/// Declaration of class Loads.
@@ -42,7 +43,7 @@
public:
Loads(BasicValues& values);
- Loads(TDatabase const&, bool NeedMidpointRates); // Antediluvian branch.
+ Loads(product_database const&, bool NeedMidpointRates); // Antediluvian
branch.
// Accessors.
@@ -74,7 +75,7 @@
Loads(); // Ctor for unit testing.
void Allocate(int length);
- void Initialize(TDatabase const&);
+ void Initialize(product_database const&);
void Calculate(load_details const&);
void AmortizePremiumTax(load_details const& details);
Modified: lmi/trunk/loads_impl.hpp
===================================================================
--- lmi/trunk/loads_impl.hpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/loads_impl.hpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -31,7 +31,7 @@
#include <vector>
class BasicValues;
-class TDatabase;
+class product_database;
/// Declaration of struct load_details.
///
Modified: lmi/trunk/loads_test.cpp
===================================================================
--- lmi/trunk/loads_test.cpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/loads_test.cpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -54,11 +54,11 @@
std::vector<double> BasicValues::GetGuarSpecAmtLoadTable() const {return
dummy_vector;}
#include "database.hpp"
-TDatabase::TDatabase(int length) :length_(length) {}
-TDatabase::~TDatabase() {}
-int TDatabase::length() const {return length_;}
-void TDatabase::Query(std::vector<double>& v, int) const {v.resize(length_);}
-double TDatabase::Query(int) const {return 0.0;}
+product_database::product_database(int length) :length_(length) {}
+product_database::~product_database() {}
+int product_database::length() const {return length_;}
+void product_database::Query(std::vector<double>& v, int) const
{v.resize(length_);}
+double product_database::Query(int) const {return 0.0;}
struct LoadsTest
{
@@ -79,7 +79,7 @@
void TestCalculations (char const* file, int line);
load_details details_;
- TDatabase database_;
+ product_database database_;
Loads loads_;
};
Modified: lmi/trunk/mec_input.cpp
===================================================================
--- lmi/trunk/mec_input.cpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/mec_input.cpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -234,7 +234,7 @@
CachedStateOfJurisdiction_ = StateOfJurisdiction .value();
database_.reset
- (new TDatabase
+ (new product_database
(CachedProductName_
,CachedGender_
,CachedUnderwritingClass_
Modified: lmi/trunk/mec_input.hpp
===================================================================
--- lmi/trunk/mec_input.hpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/mec_input.hpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -41,7 +41,7 @@
#include "xml_serializable.hpp"
class InputSequence;
-class TDatabase;
+class product_database;
#include <boost/operators.hpp>
#include <boost/scoped_ptr.hpp>
@@ -126,7 +126,7 @@
std::string RealizePaymentHistory();
std::string RealizeBenefitHistory();
- boost::scoped_ptr<TDatabase> database_;
+ boost::scoped_ptr<product_database> database_;
// Database axes are independent variables; they're "cached" along
// with the database, which is reset when any of them changes.
Modified: lmi/trunk/mec_server.cpp
===================================================================
--- lmi/trunk/mec_server.cpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/mec_server.cpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -108,7 +108,7 @@
product_data product_filenames(ProductName);
- TDatabase database
+ product_database database
(ProductName
,Gender
,UnderwritingClass
Modified: lmi/trunk/my_db.cpp
===================================================================
--- lmi/trunk/my_db.cpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/my_db.cpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -50,7 +50,7 @@
// Sample policy form.
{
InitDB();
- Add(TDBValue(DB_GuarPolFee, 10.00));
+ Add(database_entity(DB_GuarPolFee, 10.00));
// etc.
// Not necessary for 'sample' product only, because it's built in.
// WriteDB(AddDataDir("sample.database"));
Modified: lmi/trunk/surrchg_rates.cpp
===================================================================
--- lmi/trunk/surrchg_rates.cpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/surrchg_rates.cpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -32,13 +32,13 @@
#include "dbnames.hpp"
//============================================================================
-SurrChgRates::SurrChgRates(TDatabase const& database)
+SurrChgRates::SurrChgRates(product_database const& database)
{
Initialize(database);
}
//============================================================================
-void SurrChgRates::Initialize(TDatabase const& database)
+void SurrChgRates::Initialize(product_database const& database)
{
database.Query(RatePerDollarOfPremium_ , DB_SurrChgPremMult );
database.Query(RatePerDollarOfAcctval_ , DB_SurrChgAVMult );
Modified: lmi/trunk/surrchg_rates.hpp
===================================================================
--- lmi/trunk/surrchg_rates.hpp 2010-05-05 14:27:25 UTC (rev 4903)
+++ lmi/trunk/surrchg_rates.hpp 2010-05-05 16:12:33 UTC (rev 4904)
@@ -28,12 +28,12 @@
#include <vector>
-class TDatabase;
+class product_database;
class SurrChgRates
{
public:
- SurrChgRates(TDatabase const&);
+ SurrChgRates(product_database const&);
std::vector<double> const& RatePerDollarOfPremium() const;
std::vector<double> const& RatePerDollarOfAcctval() const;
@@ -48,7 +48,7 @@
// Ultimately, we'll want a pointer to a mortality-rate object
// too, that we can do SNFL calculations.
- void Initialize(TDatabase const&);
+ void Initialize(product_database const&);
std::vector<double> RatePerDollarOfPremium_;
std::vector<double> RatePerDollarOfAcctval_;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [4904] Rename two classes,
Greg Chicares <=