[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master a58de62 5/6: Remove an unneeded Query() overl
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master a58de62 5/6: Remove an unneeded Query() overload |
Date: |
Fri, 9 Nov 2018 20:48:00 -0500 (EST) |
branch: master
commit a58de628e23f381f77d36a7f4c9162a20562f8a5
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Remove an unneeded Query() overload
---
database.cpp | 9 ---------
database.hpp | 1 -
input_test.cpp | 18 +++++++++---------
3 files changed, 9 insertions(+), 19 deletions(-)
diff --git a/database.cpp b/database.cpp
index 3de4054..d948868 100644
--- a/database.cpp
+++ b/database.cpp
@@ -136,15 +136,6 @@ double product_database::Query(e_database_key k,
database_index const& i) const
return *v[i];
}
-/// Query database, using default index; return a scalar.
-///
-/// Throw if the database entity is not scalar.
-
-double product_database::Query(e_database_key k) const
-{
- return Query(k, index_);
-}
-
/// Ascertain whether two database entities are equivalent.
///
/// Equivalence here means that the dimensions and data are identical.
diff --git a/database.hpp b/database.hpp
index 28a946a..755841c 100644
--- a/database.hpp
+++ b/database.hpp
@@ -74,7 +74,6 @@ class LMI_SO product_database final
void query_into(e_database_key, std::vector<double>&) const;
double Query(e_database_key, database_index const&) const;
- double Query(e_database_key) const;
template<typename T>
T query(e_database_key) const;
diff --git a/input_test.cpp b/input_test.cpp
index bba9bbc..15337d6 100644
--- a/input_test.cpp
+++ b/input_test.cpp
@@ -146,7 +146,7 @@ void input_test::test_product_database()
// Scalar access is forbidden when entity varies by duration.
BOOST_TEST_THROW
- (db.Query(DB_StatVxQ)
+ (db.query<double>(DB_StatVxQ)
,std::runtime_error
,"Assertion '1 == v.extent()' failed."
);
@@ -176,18 +176,18 @@ void input_test::test_product_database()
auto f0 = [&db] {db.initialize("sample");};
auto f1 = [&db, &v] {db.query_into(DB_MaturityAge, v);};
- auto f2 = [&db] {db.Query(DB_MaturityAge);};
+ auto f2 = [&db] {db.query<int>(DB_MaturityAge);};
auto f3 = [&db] {db.query<oenum_alb_or_anb>(DB_AgeLastOrNearest);};
auto f4 = [&db, &a] {db.query_into(DB_AgeLastOrNearest, a);};
auto f5 = [&db] {db.entity_from_key(DB_MaturityAge);};
std::cout
<< "\n Database speed tests..."
- << "\n initialize() : " << TimeAnAliquot(f0)
- << "\n query_into(vector): " << TimeAnAliquot(f1)
- << "\n Query(scalar) : " << TimeAnAliquot(f2)
- << "\n query<T>(scalar) : " << TimeAnAliquot(f3)
- << "\n query_into(scalar): " << TimeAnAliquot(f4)
- << "\n entity_from_key() : " << TimeAnAliquot(f5)
+ << "\n initialize() : " << TimeAnAliquot(f0)
+ << "\n query_into (vector) : " << TimeAnAliquot(f1)
+ << "\n query<int> (scalar) : " << TimeAnAliquot(f2)
+ << "\n query<enum>(scalar) : " << TimeAnAliquot(f3)
+ << "\n query_into (scalar) : " << TimeAnAliquot(f4)
+ << "\n entity_from_key() : " << TimeAnAliquot(f5)
<< '\n'
;
@@ -201,7 +201,7 @@ void input_test::test_product_database()
,stat
);
BOOST_TEST_THROW
- (db.Query(DB_MaturityAge)
+ (db.query<int>(DB_MaturityAge)
,std::runtime_error
,"Assertion '1 == v.extent()' failed."
);
- [lmi-commits] [lmi] master updated (53201ac -> b3acc4a), Greg Chicares, 2018/11/09
- [lmi-commits] [lmi] master e0decd5 2/6: Note a future database improvement, Greg Chicares, 2018/11/09
- [lmi-commits] [lmi] master 0f1933d 3/6: Alphabetize enums, Greg Chicares, 2018/11/09
- [lmi-commits] [lmi] master 2b88ca2 1/6: Use query<int> with an obsolescent database entity, Greg Chicares, 2018/11/09
- [lmi-commits] [lmi] master f092e7e 4/6: Add and use a new enumerator for 7702 treatment of term, Greg Chicares, 2018/11/09
- [lmi-commits] [lmi] master a58de62 5/6: Remove an unneeded Query() overload,
Greg Chicares <=
- [lmi-commits] [lmi] master b3acc4a 6/6: Rename the last (capital 'Q') Query() function, Greg Chicares, 2018/11/09