lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [4792] Make a free function a member


From: Greg Chicares
Subject: [lmi-commits] [4792] Make a free function a member
Date: Fri, 19 Mar 2010 13:23:47 +0000

Revision: 4792
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=4792
Author:   chicares
Date:     2010-03-19 13:23:47 +0000 (Fri, 19 Mar 2010)
Log Message:
-----------
Make a free function a member

Modified Paths:
--------------
    lmi/trunk/input.hpp
    lmi/trunk/input_xml_io.cpp
    lmi/trunk/mec_input.cpp
    lmi/trunk/mec_input.hpp
    lmi/trunk/mec_state.cpp
    lmi/trunk/mec_state.hpp

Modified: lmi/trunk/input.hpp
===================================================================
--- lmi/trunk/input.hpp 2010-03-19 12:43:23 UTC (rev 4791)
+++ lmi/trunk/input.hpp 2010-03-19 13:23:47 UTC (rev 4792)
@@ -176,6 +176,7 @@
     virtual std::string xml_root_name() const;
 
     // Backward compatibility.
+    bool is_detritus(std::string const&);
     std::string redintegrate_ex_ante
         (int                file_version
         ,std::string const& name

Modified: lmi/trunk/input_xml_io.cpp
===================================================================
--- lmi/trunk/input_xml_io.cpp  2010-03-19 12:43:23 UTC (rev 4791)
+++ lmi/trunk/input_xml_io.cpp  2010-03-19 13:23:47 UTC (rev 4792)
@@ -42,40 +42,6 @@
 
 namespace
 {
-/// Entities that were present in older versions and then removed
-/// are recognized and ignored. If they're resurrected in a later
-/// version, then they aren't ignored.
-
-bool is_detritus(std::string const& s)
-{
-    static std::string const a[] =
-        {"AgentFirstName"                // Single name instead.
-        ,"AgentLastName"                 // Single name instead.
-        ,"AgentMiddleName"               // Single name instead.
-        ,"AssumedCaseNumberOfLives"      // Withdrawn.
-        ,"CaseAssumedAssets"             // Withdrawn.
-        ,"CorporationPremiumTableNumber" // Never implemented.
-        ,"CorporationTaxpayerId"         // Would violate privacy.
-        ,"CurrentCoiGrading"             // Withdrawn.
-        ,"FirstName"                     // Single name instead.
-        ,"InforceDcvDeathBenefit"        // Misbegotten.
-        ,"InforceExperienceReserve"      // Renamed before implementation.
-        ,"InsuredPremiumTableNumber"     // Never implemented.
-        ,"LastName"                      // Single name instead.
-        ,"MiddleName"                    // Single name instead.
-        ,"NetMortalityChargeHistory"     // Renamed before implementation.
-        ,"PartialMortalityTable"         // Never implemented.
-        ,"PayLoanInterestInCash"         // Never implemented.
-        ,"PolicyDate"                    // Never implemented.
-        ,"PolicyLevelFlatExtra"          // Never implemented; poor name.
-        ,"SocialSecurityNumber"          // Withdrawn: would violate privacy.
-        ,"TermProportion"                // 'TermRiderProportion' instead.
-        ,"YearsOfZeroDeaths"             // Withdrawn.
-        };
-    static std::vector<std::string> const v(a, a + lmi_array_size(a));
-    return v.end() != std::find(v.begin(), v.end(), s);
-}
-
 std::string full_name
     (std::string first_name
     ,std::string middle_name
@@ -227,6 +193,40 @@
     return "cell";
 }
 
+/// Entities that were present in older versions and then removed
+/// are recognized and ignored. If they're resurrected in a later
+/// version, then they aren't ignored.
+
+bool Input::is_detritus(std::string const& s)
+{
+    static std::string const a[] =
+        {"AgentFirstName"                // Single name instead.
+        ,"AgentLastName"                 // Single name instead.
+        ,"AgentMiddleName"               // Single name instead.
+        ,"AssumedCaseNumberOfLives"      // Withdrawn.
+        ,"CaseAssumedAssets"             // Withdrawn.
+        ,"CorporationPremiumTableNumber" // Never implemented.
+        ,"CorporationTaxpayerId"         // Would violate privacy.
+        ,"CurrentCoiGrading"             // Withdrawn.
+        ,"FirstName"                     // Single name instead.
+        ,"InforceDcvDeathBenefit"        // Misbegotten.
+        ,"InforceExperienceReserve"      // Renamed before implementation.
+        ,"InsuredPremiumTableNumber"     // Never implemented.
+        ,"LastName"                      // Single name instead.
+        ,"MiddleName"                    // Single name instead.
+        ,"NetMortalityChargeHistory"     // Renamed before implementation.
+        ,"PartialMortalityTable"         // Never implemented.
+        ,"PayLoanInterestInCash"         // Never implemented.
+        ,"PolicyDate"                    // Never implemented.
+        ,"PolicyLevelFlatExtra"          // Never implemented; poor name.
+        ,"SocialSecurityNumber"          // Withdrawn: would violate privacy.
+        ,"TermProportion"                // 'TermRiderProportion' instead.
+        ,"YearsOfZeroDeaths"             // Withdrawn.
+        };
+    static std::vector<std::string> const v(a, a + lmi_array_size(a));
+    return v.end() != std::find(v.begin(), v.end(), s);
+}
+
 /// Provide for backward compatibility before assigning values.
 
 std::string Input::redintegrate_ex_ante

Modified: lmi/trunk/mec_input.cpp
===================================================================
--- lmi/trunk/mec_input.cpp     2010-03-19 12:43:23 UTC (rev 4791)
+++ lmi/trunk/mec_input.cpp     2010-03-19 13:23:47 UTC (rev 4792)
@@ -48,20 +48,6 @@
 
 namespace
 {
-/// Entities that were present in older versions and then removed
-/// are recognized and ignored. If they're resurrected in a later
-/// version, then they aren't ignored.
-
-bool is_detritus(std::string const& s)
-{
-    static std::string const a[] =
-        {"EffectiveDateToday"
-        ,"InforceSevenPayPremium"
-        };
-    static std::vector<std::string> const v(a, a + lmi_array_size(a));
-    return v.end() != std::find(v.begin(), v.end(), s);
-}
-
 template<typename T>
 std::string realize_sequence_string
     (mec_input           & input
@@ -735,6 +721,20 @@
     return "mec";
 }
 
+/// Entities that were present in older versions and then removed
+/// are recognized and ignored. If they're resurrected in a later
+/// version, then they aren't ignored.
+
+bool mec_input::is_detritus(std::string const& s)
+{
+    static std::string const a[] =
+        {"EffectiveDateToday"
+        ,"InforceSevenPayPremium"
+        };
+    static std::vector<std::string> const v(a, a + lmi_array_size(a));
+    return v.end() != std::find(v.begin(), v.end(), s);
+}
+
 /// Provide for backward compatibility before assigning values.
 
 std::string mec_input::redintegrate_ex_ante

Modified: lmi/trunk/mec_input.hpp
===================================================================
--- lmi/trunk/mec_input.hpp     2010-03-19 12:43:23 UTC (rev 4791)
+++ lmi/trunk/mec_input.hpp     2010-03-19 13:23:47 UTC (rev 4792)
@@ -110,6 +110,7 @@
     virtual std::string xml_root_name() const;
 
     // Backward compatibility.
+    bool is_detritus(std::string const&);
     std::string redintegrate_ex_ante
         (int                file_version
         ,std::string const& name

Modified: lmi/trunk/mec_state.cpp
===================================================================
--- lmi/trunk/mec_state.cpp     2010-03-19 12:43:23 UTC (rev 4791)
+++ lmi/trunk/mec_state.cpp     2010-03-19 13:23:47 UTC (rev 4792)
@@ -43,22 +43,6 @@
 #include <sstream>
 #include <vector>
 
-namespace
-{
-/// Entities that were present in older versions and then removed
-/// are recognized and ignored. If they're resurrected in a later
-/// version, then they aren't ignored.
-
-bool is_detritus(std::string const& s)
-{
-    static std::string const a[] =
-        {"Remove this string when adding the first removed entity."
-        };
-    static std::vector<std::string> const v(a, a + lmi_array_size(a));
-    return v.end() != std::find(v.begin(), v.end(), s);
-}
-} // Unnamed namespace.
-
 /// Initialize all ascribed members to zero.
 
 mec_state::mec_state()
@@ -511,6 +495,19 @@
     return "mec_state";
 }
 
+/// Entities that were present in older versions and then removed
+/// are recognized and ignored. If they're resurrected in a later
+/// version, then they aren't ignored.
+
+bool mec_state::is_detritus(std::string const& s)
+{
+    static std::string const a[] =
+        {"Remove this string when adding the first removed entity."
+        };
+    static std::vector<std::string> const v(a, a + lmi_array_size(a));
+    return v.end() != std::find(v.begin(), v.end(), s);
+}
+
 /// Provide for backward compatibility before assigning values.
 
 std::string mec_state::redintegrate_ex_ante

Modified: lmi/trunk/mec_state.hpp
===================================================================
--- lmi/trunk/mec_state.hpp     2010-03-19 12:43:23 UTC (rev 4791)
+++ lmi/trunk/mec_state.hpp     2010-03-19 13:23:47 UTC (rev 4792)
@@ -76,6 +76,7 @@
     virtual std::string xml_root_name() const;
 
     // Backward compatibility.
+    bool is_detritus(std::string const&);
     std::string redintegrate_ex_ante
         (int                file_version
         ,std::string const& name





reply via email to

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