lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 7d95b60 3/5: Use a minimum-age database for p


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 7d95b60 3/5: Use a minimum-age database for product verification
Date: Tue, 4 Jun 2019 20:09:11 -0400 (EDT)

branch: master
commit 7d95b605dd10584b3639185b51c6eb2a23c6bfd4
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Use a minimum-age database for product verification
    
    In order to validate 7PP, it will be necessary to retrieve the vector
    quantity DB_NaarDiscount by querying the database with the minimum issue
    age, so that the vector has one element for every possible attained age.
    
    Alternatively, class product_database could be given an extra ctor that
    would accomplish the same purpose. However, that seems like too big a
    change for this special case, and the code committed is simple enough.
---
 verify_products.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/verify_products.cpp b/verify_products.cpp
index 38dec9d..e38409e 100644
--- a/verify_products.cpp
+++ b/verify_products.cpp
@@ -32,6 +32,7 @@
 #include "mc_enum.hpp"                  // all_strings<>()
 #include "product_data.hpp"
 #include "ssize_lmi.hpp"
+#include "value_cast.hpp"
 #include "yare_input.hpp"
 
 #include <iostream>
@@ -50,6 +51,10 @@ void verify_one_cell
     input["ProductName"] = product_name;
     input["Gender"     ] = gender;
     input["Smoking"    ] = smoking;
+
+    int const min_age = 
product_database(yare_input(input)).query<int>(DB_MinIssAge);
+    input["IssueAge"   ] = value_cast<std::string>(min_age);
+
     yare_input       const yi(input);
     product_database const db(yi);
     auto const era    = db.query<oenum_cso_era   >(DB_CsoEra);



reply via email to

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