lmi-commits
[Top][All Lists]
Advanced

[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));
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]