[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 7b5da91 5/9: Use database_index const accesso
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 7b5da91 5/9: Use database_index const accessors |
Date: |
Wed, 12 Jun 2019 12:53:00 -0400 (EDT) |
branch: master
commit 7b5da9106b10c949fe100602e209acf434e5beef
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Use database_index const accessors
---
database.cpp | 4 ++--
product_file_test.cpp | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/database.cpp b/database.cpp
index 28e123c..7cca20f 100644
--- a/database.cpp
+++ b/database.cpp
@@ -99,7 +99,7 @@ void product_database::query_into
,database_index const& i
) const
{
- int const local_length = maturity_age_ -
i.index_vector()[e_axis_issue_age];
+ int const local_length = maturity_age_ - i.issue_age();
LMI_ASSERT(0 < local_length && local_length <= methuselah);
database_entity const& v = entity_from_key(k);
double const*const z = v[i];
@@ -198,7 +198,7 @@ void product_database::initialize(std::string const&
product_name)
db_ = DBDictionary::read_via_cache(AddDataDir(filename));
}
query_into(DB_MaturityAge, maturity_age_);
- length_ = maturity_age_ - index_.index_vector()[e_axis_issue_age];
+ length_ = maturity_age_ - index_.issue_age();
LMI_ASSERT(0 < length_ && length_ <= methuselah);
}
diff --git a/product_file_test.cpp b/product_file_test.cpp
index dddef03..06e9f94 100644
--- a/product_file_test.cpp
+++ b/product_file_test.cpp
@@ -105,11 +105,11 @@ void product_file_test::test_copying()
,mce_nonmedical
,mce_s_CT
);
- BOOST_TEST(mce_s_CT == d.index().index_vector()[5]);
+ BOOST_TEST(mce_s_CT == d.index().state());
BOOST_TEST( 55 == d.length());
BOOST_TEST( 99 == d.query<int>(DB_MaxIncrAge));
product_database e(std::move(d));
- BOOST_TEST(mce_s_CT == e.index().index_vector()[5]);
+ BOOST_TEST(mce_s_CT == e.index().state());
BOOST_TEST( 55 == e.length());
BOOST_TEST( 99 == e.query<int>(DB_MaxIncrAge));
@@ -124,10 +124,10 @@ void product_file_test::test_copying()
,mce_s_CT
);
product_database g(f);
- BOOST_TEST(mce_s_CT == f.index().index_vector()[5]);
+ BOOST_TEST(mce_s_CT == f.index().state());
BOOST_TEST( 41 == f.length());
BOOST_TEST( 99 == f.query<int>(DB_MaxIncrAge));
- BOOST_TEST(mce_s_CT == g.index().index_vector()[5]);
+ BOOST_TEST(mce_s_CT == g.index().state());
BOOST_TEST( 41 == g.length());
BOOST_TEST( 99 == g.query<int>(DB_MaxIncrAge));
}
- [lmi-commits] [lmi] master updated (a9bcf09 -> d30e9b1), Greg Chicares, 2019/06/12
- [lmi-commits] [lmi] master b6c5d13 6/9: Improve const correctness, Greg Chicares, 2019/06/12
- [lmi-commits] [lmi] master 1f1adcf 8/9: Prefer std::array to std::vector when size is fixed, Greg Chicares, 2019/06/12
- [lmi-commits] [lmi] master 9ffdf78 4/9: Add const accessors to class database_index, Greg Chicares, 2019/06/12
- [lmi-commits] [lmi] master 7b5da91 5/9: Use database_index const accessors,
Greg Chicares <=
- [lmi-commits] [lmi] master fad3d61 1/9: Use forward declarations to improve physical design, Greg Chicares, 2019/06/12
- [lmi-commits] [lmi] master 89c8cc5 2/9: Use forward declarations to improve physical design, Greg Chicares, 2019/06/12
- [lmi-commits] [lmi] master d30e9b1 9/9: Make {{ContractNameCap}} available for all formats, Greg Chicares, 2019/06/12
- [lmi-commits] [lmi] master a8298c9 3/9: Improve list of handy commands, Greg Chicares, 2019/06/12
- [lmi-commits] [lmi] master 8862ffc 7/9: Improve const correctness, Greg Chicares, 2019/06/12